Skip to content

Commit d42f17b

Browse files
added use cases
1 parent 363bd12 commit d42f17b

File tree

4 files changed

+84
-6
lines changed

4 files changed

+84
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void updateUserProfiles() {
9090
@Scheduled(initialDelay= TEN_SECONDS *9, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS_HOME_TIMELINE)
9191
public void getHomeTimeline() {
9292
String msg = "get Home Timeline Tweets ";
93-
if((schedulerProperties.getAllowUpdateUserProfiles()) && (!schedulerProperties.getSkipFortesting())) {
93+
if((schedulerProperties.getAllowGetHomeTimeline()) && (!schedulerProperties.getSkipFortesting())) {
9494
Task task = asyncStartTask.getHomeTimeline();
9595
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
9696
}
@@ -99,7 +99,7 @@ public void getHomeTimeline() {
9999
@Scheduled(initialDelay= TEN_SECONDS *10, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS_USER_TIMELINE)
100100
public void getUserTimeline() {
101101
String msg = " get User Timeline Tweets ";
102-
if((schedulerProperties.getAllowUpdateUserProfiles()) && (!schedulerProperties.getSkipFortesting())) {
102+
if((schedulerProperties.getAllowGetUserTimeline()) && (!schedulerProperties.getSkipFortesting())) {
103103
Task task = asyncStartTask.getUserTimeline();
104104
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
105105
}
@@ -108,7 +108,7 @@ public void getUserTimeline() {
108108
@Scheduled(initialDelay= TEN_SECONDS *11, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS_MENTIONS)
109109
public void getMentions() {
110110
String msg = " get Mentions ";
111-
if((schedulerProperties.getAllowUpdateUserProfiles()) && (!schedulerProperties.getSkipFortesting())) {
111+
if((schedulerProperties.getAllowGetMentions()) && (!schedulerProperties.getSkipFortesting())) {
112112
Task task = asyncStartTask.getMentions();
113113
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
114114
}
@@ -117,7 +117,7 @@ public void getMentions() {
117117
@Scheduled(initialDelay= TEN_SECONDS *12, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS_FAVORITES)
118118
public void getFavorites() {
119119
String msg = " get Favorites ";
120-
if((schedulerProperties.getAllowUpdateUserProfiles()) && (!schedulerProperties.getSkipFortesting())) {
120+
if((schedulerProperties.getAllowGetFavorites()) && (!schedulerProperties.getSkipFortesting())) {
121121
Task task = asyncStartTask.getFavorites();
122122
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
123123
}
@@ -126,7 +126,7 @@ public void getFavorites() {
126126
@Scheduled(initialDelay= TEN_SECONDS *13, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS_RETWEETS_OF_ME)
127127
public void getRetweetsOfMe() {
128128
String msg = " get Retweets Of Me ";
129-
if((schedulerProperties.getAllowUpdateUserProfiles()) && (!schedulerProperties.getSkipFortesting())) {
129+
if((schedulerProperties.getAllowGetRetweetsOfMe()) && (!schedulerProperties.getSkipFortesting())) {
130130
Task task = asyncStartTask.getRetweetsOfMe();
131131
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
132132
}
@@ -135,7 +135,7 @@ public void getRetweetsOfMe() {
135135
@Scheduled(initialDelay= TEN_SECONDS *14, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS_USER_LISTS)
136136
public void getLists() {
137137
String msg = " get Lists ";
138-
if((schedulerProperties.getAllowUpdateUserProfiles()) && (!schedulerProperties.getSkipFortesting())) {
138+
if((schedulerProperties.getAllowGetLists()) && (!schedulerProperties.getSkipFortesting())) {
139139
Task task = asyncStartTask.getLists();
140140
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
141141
}

src/main/java/org/woehlke/twitterwall/conf/properties/SchedulerProperties.java

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ public class SchedulerProperties {
4545
@NotNull
4646
private Boolean fetchFriendsAllow;
4747

48+
@NotNull
49+
private Boolean allowGetHomeTimeline;
50+
51+
@NotNull
52+
private Boolean allowGetUserTimeline;
53+
54+
@NotNull
55+
private Boolean allowGetMentions;
56+
57+
@NotNull
58+
private Boolean allowGetFavorites;
59+
60+
@NotNull
61+
private Boolean allowGetRetweetsOfMe;
62+
63+
@NotNull
64+
private Boolean allowGetLists;
65+
4866
public Boolean getAllowFetchTweetsFromTwitterSearch() {
4967
return allowFetchTweetsFromTwitterSearch;
5068
}
@@ -132,4 +150,52 @@ public void setFetchFriendsAllow(Boolean fetchFriendsAllow) {
132150
public Boolean getFetchFriendsAllow() {
133151
return fetchFriendsAllow;
134152
}
153+
154+
public Boolean getAllowGetHomeTimeline() {
155+
return allowGetHomeTimeline;
156+
}
157+
158+
public void setAllowGetHomeTimeline(Boolean allowGetHomeTimeline) {
159+
this.allowGetHomeTimeline = allowGetHomeTimeline;
160+
}
161+
162+
public Boolean getAllowGetUserTimeline() {
163+
return allowGetUserTimeline;
164+
}
165+
166+
public void setAllowGetUserTimeline(Boolean allowGetUserTimeline) {
167+
this.allowGetUserTimeline = allowGetUserTimeline;
168+
}
169+
170+
public Boolean getAllowGetMentions() {
171+
return allowGetMentions;
172+
}
173+
174+
public void setAllowGetMentions(Boolean allowGetMentions) {
175+
this.allowGetMentions = allowGetMentions;
176+
}
177+
178+
public Boolean getAllowGetFavorites() {
179+
return allowGetFavorites;
180+
}
181+
182+
public void setAllowGetFavorites(Boolean allowGetFavorites) {
183+
this.allowGetFavorites = allowGetFavorites;
184+
}
185+
186+
public Boolean getAllowGetRetweetsOfMe() {
187+
return allowGetRetweetsOfMe;
188+
}
189+
190+
public void setAllowGetRetweetsOfMe(Boolean allowGetRetweetsOfMe) {
191+
this.allowGetRetweetsOfMe = allowGetRetweetsOfMe;
192+
}
193+
194+
public Boolean getAllowGetLists() {
195+
return allowGetLists;
196+
}
197+
198+
public void setAllowGetLists(Boolean allowGetLists) {
199+
this.allowGetLists = allowGetLists;
200+
}
135201
}

src/main/resources/application.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ twitterwall:
125125
allowUpdateUserProfiles: false
126126
herokuDbRowsLimit: false
127127
removeOldDataFromStorageAllow: false
128+
allowGetHomeTimeline: false
129+
allowGetUserTimeline: false
130+
allowGetMentions: false
131+
allowGetFavorites: false
132+
allowGetRetweetsOfMe: false
133+
allowGetLists: false
128134
skipFortesting: false
129135
testdata:
130136
oodm:

src/test/resources/application-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,10 @@ twitterwall:
4343
removeOldDataFromStorageAllow: true
4444
fetchFollowerAllow: true
4545
fetchFriendsAllow: true
46+
allowGetHomeTimeline: true
47+
allowGetUserTimeline: true
48+
allowGetMentions: true
49+
allowGetFavorites: true
50+
allowGetRetweetsOfMe: true
51+
allowGetLists: true
4652
skipFortesting: true

0 commit comments

Comments
 (0)