Skip to content

Commit 8e330a4

Browse files
Merge pull request #144 from phasenraum2010/milestone-1.0.14
Milestone 1.0.14
2 parents 9a5f834 + 695a5ae commit 8e330a4

File tree

64 files changed

+1974
-287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1974
-287
lines changed

pom.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,28 @@
7676
<groupId>org.springframework.boot</groupId>
7777
<artifactId>spring-boot-starter-data-jpa</artifactId>
7878
</dependency>
79-
<!--
80-
<dependency>
81-
<groupId>org.springframework.boot</groupId>
82-
<artifactId>spring-boot-starter-validation</artifactId>
83-
</dependency>
8479
<dependency>
8580
<groupId>org.springframework.boot</groupId>
8681
<artifactId>spring-boot-starter-integration</artifactId>
8782
</dependency>
83+
<!--
8884
<dependency>
8985
<groupId>org.springframework.boot</groupId>
9086
<artifactId>spring-boot-starter-security</artifactId>
9187
</dependency>
88+
-->
9289
<dependency>
9390
<groupId>org.springframework.boot</groupId>
94-
<artifactId>spring-boot-starter-hateoas</artifactId>
91+
<artifactId>spring-boot-starter-mobile</artifactId>
9592
</dependency>
93+
<!--
94+
<dependency>
95+
<groupId>org.springframework.boot</groupId>
96+
<artifactId>spring-boot-starter-validation</artifactId>
97+
</dependency>
9698
<dependency>
9799
<groupId>org.springframework.boot</groupId>
98-
<artifactId>spring-boot-starter-mobile</artifactId>
100+
<artifactId>spring-boot-starter-hateoas</artifactId>
99101
</dependency>
100102
-->
101103
<dependency>

src/main/java/org/woehlke/twitterwall/Application.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import org.springframework.boot.SpringApplication;
55
import org.springframework.boot.autoconfigure.SpringBootApplication;
66
import org.springframework.boot.context.properties.EnableConfigurationProperties;
7+
import org.springframework.context.annotation.ImportResource;
8+
import org.springframework.data.web.config.EnableSpringDataWebSupport;
79
import org.springframework.scheduling.annotation.EnableScheduling;
810
import org.woehlke.twitterwall.conf.TwitterProperties;
911
import org.woehlke.twitterwall.conf.TwitterwallBackendProperties;
@@ -22,6 +24,9 @@
2224
TwitterwallSchedulerProperties.class,
2325
TwitterProperties.class
2426
})
27+
//@EnableWebMvc
28+
@EnableSpringDataWebSupport
29+
@ImportResource("classpath:integration.xml")
2530
public class Application {
2631

2732
public static void main(String[] args) {

src/main/java/org/woehlke/twitterwall/ScheduledTasks.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public ScheduledTasks(TwitterwallSchedulerProperties twitterwallSchedulerPropert
7979

8080
private final static long FIXED_RATE_FOR_SCHEDULAR_FETCH_USER_LIST = ZWOELF_STUNDEN;
8181

82-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS)
82+
//@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS)
8383
public void fetchTweetsFromTwitterSearch() {
8484
String msg = "fetch Tweets From TwitterSearch ";
8585
logEnv(msg);
@@ -115,7 +115,7 @@ public void fetchTweetsFromTwitterSearch() {
115115
logEnv(msg);
116116
}
117117

118-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_TWEETS)
118+
//@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_TWEETS)
119119
public void updateTweets() {
120120
String msg = "update Tweets ";
121121
logEnv(msg);
@@ -151,7 +151,7 @@ public void updateTweets() {
151151
logEnv(msg);
152152
}
153153

154-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER)
154+
//@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER)
155155
public void updateUserProfiles() {
156156
String msg = "update User Profiles ";
157157
logEnv(msg);
@@ -185,7 +185,7 @@ public void updateUserProfiles() {
185185
logEnv(msg);
186186
}
187187

188-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION)
188+
//@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION)
189189
public void updateUserProfilesFromMentions(){
190190
String msg = "update User Profiles From Mentions";
191191
logEnv(msg);
@@ -219,7 +219,7 @@ public void updateUserProfilesFromMentions(){
219219
logEnv(msg);
220220
}
221221

222-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_USER_LIST)
222+
//@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_USER_LIST)
223223
public void fetchUsersFromDefinedUserList(){
224224
String msg = "fetch Users from Defined User List ";
225225
logEnv(msg);

src/main/java/org/woehlke/twitterwall/conf/TwitterwallSchedulerProperties.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ public static class Facade {
126126

127127
private List<Long> idTwitterToFetchForUserControllerTest = new ArrayList<Long>();
128128

129+
private List<String> screenNamesToFetchForUserControllerTest = new ArrayList<String>();
130+
129131
public List<Long> getIdTwitterToFetchForTweetTest() {
130132
return idTwitterToFetchForTweetTest;
131133
}
@@ -141,6 +143,14 @@ public List<Long> getIdTwitterToFetchForUserControllerTest() {
141143
public void setIdTwitterToFetchForUserControllerTest(List<Long> idTwitterToFetchForUserControllerTest) {
142144
this.idTwitterToFetchForUserControllerTest = idTwitterToFetchForUserControllerTest;
143145
}
146+
147+
public List<String> getScreenNamesToFetchForUserControllerTest() {
148+
return screenNamesToFetchForUserControllerTest;
149+
}
150+
151+
public void setScreenNamesToFetchForUserControllerTest(List<String> screenNamesToFetchForUserControllerTest) {
152+
this.screenNamesToFetchForUserControllerTest = screenNamesToFetchForUserControllerTest;
153+
}
144154
}
145155

146156
public Facade getFacade() {

src/main/java/org/woehlke/twitterwall/frontend/controller/PagesController.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
import org.springframework.ui.Model;
88
import org.springframework.web.bind.annotation.RequestMapping;
99
import org.springframework.web.servlet.ModelAndView;
10-
import org.woehlke.twitterwall.conf.TwitterProperties;
1110
import org.woehlke.twitterwall.conf.TwitterwallFrontendProperties;
1211
import org.woehlke.twitterwall.frontend.controller.common.Symbols;
1312
import org.woehlke.twitterwall.frontend.controller.common.ControllerHelper;
1413
import org.woehlke.twitterwall.oodm.entities.User;
15-
import org.woehlke.twitterwall.scheduled.service.facade.CreateTestData;
14+
import org.woehlke.twitterwall.scheduled.mq.endoint.StartTask;
1615

1716

1817
/**
@@ -35,8 +34,9 @@ public String imprint(Model model) {
3534
String title = "Impressum";
3635
String subtitle = twitterwallFrontendProperties.getImprintSubtitle();
3736
model = controllerHelper.setupPage(model, title, subtitle, symbol);
38-
String screenName = twitterwallFrontendProperties.getImprintScreenName();
39-
User user = createTestData.addUserForScreenName(screenName);
37+
User user = startTask.createImprintUser();
38+
//String screenName = twitterwallFrontendProperties.getImprintScreenName();
39+
//User user = createTestData.addUserForScreenName(screenName);
4040
model.addAttribute("user", user);
4141
log.info("-----------------------------------------");
4242
return "imprint";
@@ -46,15 +46,18 @@ public String imprint(Model model) {
4646

4747
private final TwitterwallFrontendProperties twitterwallFrontendProperties;
4848

49-
private final TwitterProperties twitterProperties;
49+
//private final TwitterProperties twitterProperties;
5050

51-
private final CreateTestData createTestData;
51+
//private final CreateTestData createTestData;
52+
53+
private final StartTask startTask;
5254

5355
@Autowired
54-
public PagesController(TwitterwallFrontendProperties twitterwallFrontendProperties, TwitterProperties twitterProperties, CreateTestData createTestData, ControllerHelper controllerHelper) {
56+
public PagesController(TwitterwallFrontendProperties twitterwallFrontendProperties, StartTask startTask, ControllerHelper controllerHelper) {
5557
this.twitterwallFrontendProperties = twitterwallFrontendProperties;
56-
this.twitterProperties = twitterProperties;
57-
this.createTestData = createTestData;
58+
//this.twitterProperties = twitterProperties;
59+
//this.createTestData = createTestData;
60+
this.startTask = startTask;
5861
this.controllerHelper = controllerHelper;
5962
}
6063

src/main/java/org/woehlke/twitterwall/frontend/controller/TestController.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.woehlke.twitterwall.frontend.controller.common.ControllerHelper;
1818
import org.woehlke.twitterwall.oodm.entities.User;
1919
import org.woehlke.twitterwall.oodm.service.UserService;
20+
import org.woehlke.twitterwall.scheduled.mq.endoint.StartTask;
2021
import org.woehlke.twitterwall.scheduled.service.facade.CreateTestData;
2122
import org.woehlke.twitterwall.scheduled.service.facade.FetchUsersFromDefinedUserList;
2223

@@ -35,8 +36,8 @@ public String getTestData(Model model) {
3536
model = controllerHelper.setupPage(model,"Test Data Tweets",twitterProperties.getSearchQuery(),Symbols.GET_TEST_DATA.toString());
3637
String msg = "/getTestData : ";
3738
if(twitterwallFrontendProperties.getContextTest()){
38-
model.addAttribute("latestTweets", createTestData.getTestDataTweets());
39-
model.addAttribute("users", createTestData.getTestDataUser());
39+
model.addAttribute("latestTweets", startTask.createTestDataForTweets());
40+
model.addAttribute("users", startTask.createTestDataForUser());
4041
} else {
4142
model.addAttribute("latestTweets",null);
4243
model.addAttribute("users",null);
@@ -73,21 +74,24 @@ public String getOnListRenew(@RequestParam(name= "page" ,defaultValue=""+ Contro
7374

7475
private final TwitterProperties twitterProperties;
7576

77+
private final StartTask startTask;
78+
7679
@Autowired
77-
public TestController(UserService userService, FetchUsersFromDefinedUserList fetchUsersFromDefinedUserList, CreateTestData createTestData, ControllerHelper controllerHelper, TwitterwallFrontendProperties twitterwallFrontendProperties, TwitterProperties twitterProperties) {
80+
public TestController(UserService userService, FetchUsersFromDefinedUserList fetchUsersFromDefinedUserList, CreateTestData createTestData, ControllerHelper controllerHelper, TwitterwallFrontendProperties twitterwallFrontendProperties, TwitterProperties twitterProperties, StartTask startTask) {
7881
this.userService = userService;
7982
this.fetchUsersFromDefinedUserList = fetchUsersFromDefinedUserList;
8083
this.createTestData = createTestData;
8184
this.controllerHelper = controllerHelper;
8285
this.twitterwallFrontendProperties = twitterwallFrontendProperties;
8386
this.twitterProperties = twitterProperties;
87+
this.startTask = startTask;
8488
}
8589

8690
@Async
8791
protected void startOnListRenew(){
8892
String msg = "startOnListRenew: ";
89-
log.info(msg+"START scheduledTasksFacade.fetchUsersFromDefinedUserList: ");
90-
fetchUsersFromDefinedUserList.fetchUsersFromDefinedUserList();
91-
log.info(msg+"DONE scheduledTasksFacade.fetchUsersFromDefinedUserList: ");
93+
log.info(msg+"START startTask.fetchUsersFromDefinedUserList: ");
94+
startTask.fetchUsersFromDefinedUserList();
95+
log.info(msg+"DONE startTask.fetchUsersFromDefinedUserList: ");
9296
}
9397
}

src/main/java/org/woehlke/twitterwall/oodm/entities/Mention.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ public class Mention extends AbstractDomainObject<Mention> implements DomainObje
5757
@Column(name = "name",length=4096, nullable = false)
5858
private String name = "";
5959

60-
@NotNull
61-
@JoinColumn(name = "fk_user")
60+
@JoinColumn(name = "fk_user",nullable = true)
6261
@OneToOne(optional=true, fetch = EAGER, cascade = {DETACH, REFRESH, REMOVE})
6362
private User user;
6463

@@ -78,10 +77,6 @@ public Mention(Task createdBy, Task updatedBy, String mentionString) {
7877
this.idTwitter = ID_TWITTER_UNDEFINED;
7978
this.screenName = mentionString;
8079
this.name = mentionString;
81-
try {
82-
Thread.sleep(100L);
83-
} catch (InterruptedException e) {
84-
}
8580
}
8681

8782
private Mention() {

src/main/java/org/woehlke/twitterwall/oodm/entities/Task.java

Lines changed: 1 addition & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -75,61 +75,6 @@ public class Task implements DomainObjectMinimal<Task> {
7575
@Column(name="time_finished")
7676
private Date timeFinished = null;
7777

78-
@NotNull
79-
@OneToMany(cascade = {DETACH, REFRESH, REMOVE}, fetch = EAGER,orphanRemoval=true, mappedBy="task")
80-
private List<TaskHistory> history = new ArrayList<>();
81-
82-
@NotNull
83-
@Embedded
84-
@AttributeOverrides({
85-
@AttributeOverride(name = "countUser", column = @Column(name = "start_count_user",nullable=false)),
86-
@AttributeOverride(name = "countTweets", column = @Column(name = "start_count_tweets",nullable=false)),
87-
@AttributeOverride(name = "countHashTags", column = @Column(name = "start_count_hashtags",nullable=false)),
88-
@AttributeOverride(name = "countMedia", column = @Column(name = "start_count_media",nullable=false)),
89-
@AttributeOverride(name = "countMention", column = @Column(name = "start_count_mention",nullable=false)),
90-
@AttributeOverride(name = "countTickerSymbol", column = @Column(name = "start_count_tickersymbol",nullable=false)),
91-
@AttributeOverride(name = "countUrl", column = @Column(name = "start_count_url",nullable=false)),
92-
@AttributeOverride(name = "countUrlCache", column = @Column(name = "start_count_urlcache",nullable=false)),
93-
@AttributeOverride(name = "countTask", column = @Column(name = "start_count_task",nullable=false)),
94-
@AttributeOverride(name = "countTaskHistory", column = @Column(name = "start_count_task_history",nullable=false)),
95-
@AttributeOverride(name = "tweet2hashtag", column = @Column(name = "start_count_tweet2hashtag",nullable=false)),
96-
@AttributeOverride(name = "tweet2media", column = @Column(name = "start_count_tweet2media",nullable=false)),
97-
@AttributeOverride(name = "tweet2mention", column = @Column(name = "start_count_tweet2mention",nullable=false)),
98-
@AttributeOverride(name = "tweet2tickersymbol", column = @Column(name = "start_count_tweet2tickersymbol",nullable=false)),
99-
@AttributeOverride(name = "tweet2url", column = @Column(name = "start_count_tweet2url",nullable=false)),
100-
@AttributeOverride(name = "userprofile2hashtag", column = @Column(name = "start_count_userprofile2hashtag",nullable=false)),
101-
@AttributeOverride(name = "userprofile2media", column = @Column(name = "start_count_userprofile2media",nullable=false)),
102-
@AttributeOverride(name = "userprofile2mention", column = @Column(name = "start_count_userprofile2mention",nullable=false)),
103-
@AttributeOverride(name = "userprofile2tickersymbol", column = @Column(name = "start_count_userprofile2tickersymbol",nullable=false)),
104-
@AttributeOverride(name = "userprofile2url", column = @Column(name = "start_count_userprofile2url",nullable=false))
105-
})
106-
private CountedEntities countedEntitiesAtStart;
107-
108-
@Embedded
109-
@AttributeOverrides({
110-
@AttributeOverride(name = "countUser", column = @Column(name = "done_count_user")),
111-
@AttributeOverride(name = "countTweets", column = @Column(name = "done_count_tweets")),
112-
@AttributeOverride(name = "countHashTags", column = @Column(name = "done_count_hashtags")),
113-
@AttributeOverride(name = "countMedia", column = @Column(name = "done_count_media")),
114-
@AttributeOverride(name = "countMention", column = @Column(name = "done_count_mention")),
115-
@AttributeOverride(name = "countTickerSymbol", column = @Column(name = "done_count_tickersymbol")),
116-
@AttributeOverride(name = "countUrl", column = @Column(name = "done_count_url")),
117-
@AttributeOverride(name = "countUrlCache", column = @Column(name = "done_count_urlcache")),
118-
@AttributeOverride(name = "countTask", column = @Column(name = "done_count_task")),
119-
@AttributeOverride(name = "countTaskHistory", column = @Column(name = "done_count_task_history")),
120-
@AttributeOverride(name = "tweet2hashtag", column = @Column(name = "done_count_tweet2hashtag")),
121-
@AttributeOverride(name = "tweet2media", column = @Column(name = "done_count_tweet2media")),
122-
@AttributeOverride(name = "tweet2mention", column = @Column(name = "done_count_tweet2mention")),
123-
@AttributeOverride(name = "tweet2tickersymbol", column = @Column(name = "done_count_tweet2tickersymbol")),
124-
@AttributeOverride(name = "tweet2url", column = @Column(name = "done_count_tweet2url")),
125-
@AttributeOverride(name = "userprofile2hashtag", column = @Column(name = "done_count_userprofile2hashtag")),
126-
@AttributeOverride(name = "userprofile2media", column = @Column(name = "done_count_userprofile2media")),
127-
@AttributeOverride(name = "userprofile2mention", column = @Column(name = "done_count_userprofile2mention")),
128-
@AttributeOverride(name = "userprofile2tickersymbol", column = @Column(name = "done_count_userprofile2tickersymbol")),
129-
@AttributeOverride(name = "userprofile2url", column = @Column(name = "done_count_userprofile2url"))
130-
})
131-
private CountedEntities countedEntitiesAtFinish;
132-
13378
private Task() {
13479
}
13580

@@ -138,16 +83,13 @@ public Task(String description,TaskType taskType) {
13883
this.description = description;
13984
}
14085

141-
public Task(String description, TaskType taskType, TaskStatus taskStatus, Date timeStarted, Date timeLastUpdate, Date timeFinished, List<TaskHistory> history, CountedEntities countedEntitiesAtStart, CountedEntities countedEntitiesAtFinish) {
86+
public Task(String description, TaskType taskType, TaskStatus taskStatus, Date timeStarted, Date timeLastUpdate, Date timeFinished) {
14287
this.description = description;
14388
this.taskType = taskType;
14489
this.taskStatus = taskStatus;
14590
this.timeStarted = timeStarted;
14691
this.timeLastUpdate = timeLastUpdate;
14792
this.timeFinished = timeFinished;
148-
this.history = history;
149-
this.countedEntitiesAtStart = countedEntitiesAtStart;
150-
this.countedEntitiesAtFinish = countedEntitiesAtFinish;
15193
}
15294

15395
@Override
@@ -189,22 +131,6 @@ public void setTimeFinished(Date timeFinished) {
189131
this.timeFinished = timeFinished;
190132
}
191133

192-
public CountedEntities getCountedEntitiesAtStart() {
193-
return countedEntitiesAtStart;
194-
}
195-
196-
public void setCountedEntitiesAtStart(CountedEntities countedEntitiesAtStart) {
197-
this.countedEntitiesAtStart = countedEntitiesAtStart;
198-
}
199-
200-
public CountedEntities getCountedEntitiesAtFinish() {
201-
return countedEntitiesAtFinish;
202-
}
203-
204-
public void setCountedEntitiesAtFinish(CountedEntities countedEntitiesAtFinish) {
205-
this.countedEntitiesAtFinish = countedEntitiesAtFinish;
206-
}
207-
208134
public TaskStatus getTaskStatus() {
209135
return taskStatus;
210136
}
@@ -221,18 +147,6 @@ public void setDescription(String description) {
221147
this.description = description;
222148
}
223149

224-
public List<TaskHistory> getHistory() {
225-
return history;
226-
}
227-
228-
public void setHistory(List<TaskHistory> history) {
229-
this.history = history;
230-
}
231-
232-
public void addHistory(TaskHistory history) {
233-
this.history.add(history);
234-
}
235-
236150
public Date getTimeLastUpdate() {
237151
return timeLastUpdate;
238152
}
@@ -248,23 +162,13 @@ public void setTimeLastUpdate() {
248162

249163
@Override
250164
public String toString() {
251-
String countedEntitiesAtFinishStr = "null";
252-
if(countedEntitiesAtFinish != null){
253-
countedEntitiesAtFinishStr = countedEntitiesAtFinish.toString();
254-
}
255-
String countedEntitiesAtStartStr = "null";
256-
if(countedEntitiesAtStart != null){
257-
countedEntitiesAtStartStr = countedEntitiesAtStart.toString();
258-
}
259165
return "Task{" +
260166
"id=" + id +
261167
", taskType=" + taskType +
262168
", taskStatus=" +taskStatus +
263169
", timeStarted=" + timeStarted +
264170
", timeLastUpdate=" + timeLastUpdate +
265171
", timeFinished=" + timeFinished +
266-
", countedEntitiesAtStart=" + countedEntitiesAtStartStr +
267-
", countedEntitiesAtFinish=" + countedEntitiesAtFinishStr +
268172
'}';
269173
}
270174

0 commit comments

Comments
 (0)