Skip to content

Commit 6acbded

Browse files
working on #270
1 parent 2069936 commit 6acbded

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

src/main/java/org/woehlke/twitterwall/oodm/model/tasks/TaskBasedCaching.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public class TaskBasedCaching implements Serializable {
2222
@Column(name=COLUMN_PREFIX+"update_users")
2323
private Date updateUsers;
2424

25+
@Column(name=COLUMN_PREFIX+"update_urls")
26+
private Date updatedUrls;
27+
2528
@Column(name=COLUMN_PREFIX+"update_users_from_mentions")
2629
private Date updateUsersFromMentions;
2730

@@ -89,6 +92,9 @@ public Boolean isCached(TaskType taskType, long timeToLive){
8992
case UPDATE_MENTIONS_FOR_USERS:
9093
lastApiCall = updateUsersFromMentions;
9194
break;
95+
case UPDATE_URLS:
96+
lastApiCall = updatedUrls;
97+
break;
9298
case FETCH_USERS_FROM_LIST:
9399
lastApiCall = fetchUsersFromList;
94100
break;
@@ -172,6 +178,9 @@ public void store(TaskType taskType){
172178
case FETCH_USERS_FROM_LIST:
173179
fetchUsersFromList = lastApiCall;
174180
break;
181+
case UPDATE_URLS:
182+
updatedUrls = lastApiCall;
183+
break;
175184
case CREATE_TESTDATA_TWEETS:
176185
controllerGetTestdataTweets = lastApiCall;
177186
break;
@@ -219,7 +228,7 @@ public void store(TaskType taskType){
219228
}
220229
}
221230

222-
public TaskBasedCaching(Date fetchTweetsFromSearch, Date updateTweets, Date updateUsers, Date updateUsersFromMentions, Date fetchUsersFromList, Date controllerGetTestdataTweets, Date controllerGetTestdataUser, Date controllerAddUserForScreenName, Date controllerCreateImprintUser, Date removeOldDataFromStorage, Date fetchFollower, Date fetchFriends, Date getHomeTimeline, Date getUserTimeline, Date getMentions, Date getFavorites, Date getRetweetsOfMe, Date getLists,Date fetchUserlistOwners,Date startGarbageCollection) {
231+
public TaskBasedCaching(Date fetchTweetsFromSearch, Date updateTweets, Date updateUsers, Date updateUsersFromMentions, Date fetchUsersFromList, Date controllerGetTestdataTweets, Date controllerGetTestdataUser, Date controllerAddUserForScreenName, Date controllerCreateImprintUser, Date removeOldDataFromStorage, Date fetchFollower, Date fetchFriends, Date getHomeTimeline, Date getUserTimeline, Date getMentions, Date getFavorites, Date getRetweetsOfMe, Date getLists,Date fetchUserlistOwners,Date startGarbageCollection, Date updatedUrls) {
223232
this.fetchTweetsFromSearch = fetchTweetsFromSearch;
224233
this.updateTweets = updateTweets;
225234
this.updateUsers = updateUsers;
@@ -240,6 +249,7 @@ public TaskBasedCaching(Date fetchTweetsFromSearch, Date updateTweets, Date upda
240249
this.getLists = getLists;
241250
this.fetchUserlistOwners = fetchUserlistOwners;
242251
this.startGarbageCollection = startGarbageCollection;
252+
this.updatedUrls = updatedUrls;
243253
}
244254

245255
public TaskBasedCaching() {
@@ -262,6 +272,7 @@ public TaskBasedCaching() {
262272
this.getLists = null;
263273
this.fetchUserlistOwners = null;
264274
this.startGarbageCollection = null;
275+
this.updatedUrls = null;
265276
}
266277

267278
public Date getFetchTweetsFromSearch() {
@@ -344,6 +355,10 @@ public Date getStartGarbageCollection() {
344355
return startGarbageCollection;
345356
}
346357

358+
public Date getUpdatedUrls() {
359+
return updatedUrls;
360+
}
361+
347362
@Override
348363
public boolean equals(Object o) {
349364
if (this == o) return true;
@@ -355,6 +370,7 @@ public boolean equals(Object o) {
355370
return false;
356371
if (updateTweets != null ? !updateTweets.equals(that.updateTweets) : that.updateTweets != null) return false;
357372
if (updateUsers != null ? !updateUsers.equals(that.updateUsers) : that.updateUsers != null) return false;
373+
if (updatedUrls != null ? !updatedUrls.equals(that.updatedUrls) : that.updatedUrls != null) return false;
358374
if (updateUsersFromMentions != null ? !updateUsersFromMentions.equals(that.updateUsersFromMentions) : that.updateUsersFromMentions != null)
359375
return false;
360376
if (fetchUsersFromList != null ? !fetchUsersFromList.equals(that.fetchUsersFromList) : that.fetchUsersFromList != null)
@@ -391,6 +407,7 @@ public int hashCode() {
391407
int result = fetchTweetsFromSearch != null ? fetchTweetsFromSearch.hashCode() : 0;
392408
result = 31 * result + (updateTweets != null ? updateTweets.hashCode() : 0);
393409
result = 31 * result + (updateUsers != null ? updateUsers.hashCode() : 0);
410+
result = 31 * result + (updatedUrls != null ? updatedUrls.hashCode() : 0);
394411
result = 31 * result + (updateUsersFromMentions != null ? updateUsersFromMentions.hashCode() : 0);
395412
result = 31 * result + (fetchUsersFromList != null ? fetchUsersFromList.hashCode() : 0);
396413
result = 31 * result + (controllerGetTestdataTweets != null ? controllerGetTestdataTweets.hashCode() : 0);
@@ -417,6 +434,7 @@ public String toString() {
417434
"fetchTweetsFromSearch=" + fetchTweetsFromSearch +
418435
", updateTweets=" + updateTweets +
419436
", updateUsers=" + updateUsers +
437+
", updatedUrls=" + updatedUrls +
420438
", updateUsersFromMentions=" + updateUsersFromMentions +
421439
", fetchUsersFromList=" + fetchUsersFromList +
422440
", controllerGetTestdataTweets=" + controllerGetTestdataTweets +

src/main/java/org/woehlke/twitterwall/oodm/model/tasks/TaskInfo.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public class TaskInfo implements Serializable {
2828
@Column(nullable = false,name="update_users")
2929
private Boolean updatedUsers = false;
3030

31+
@NotNull
32+
@Column(nullable = false,name="update_urls")
33+
private Boolean updatedUrls = false;
34+
3135
@NotNull
3236
@Column(nullable = false,name="update_users_from_mentions")
3337
private Boolean updateUsersFromMentions = false;
@@ -109,6 +113,9 @@ public void setTaskInfoFromTask(Task task) {
109113
case UPDATE_MENTIONS_FOR_USERS:
110114
this.updateUsersFromMentions = true;
111115
break;
116+
case UPDATE_URLS:
117+
this.updatedUrls = true;
118+
break;
112119
case FETCH_USERS_FROM_LIST:
113120
this.fetchUsersFromList = true;
114121
break;
@@ -163,7 +170,7 @@ public void setTaskInfoFromTask(Task task) {
163170
public TaskInfo() {
164171
}
165172

166-
public TaskInfo(Boolean fetchTweetsFromSearch, Boolean updateTweets, Boolean updatedUsers, Boolean updateUsersFromMentions, Boolean fetchUsersFromList, Boolean controllerCreateTestdataTweets, Boolean controllerCreateTestdataUsers, Boolean controllerCreateImprintUser, Boolean removeOldDataFromStorage, Boolean fetchFollower, Boolean fetchFriends,Boolean fetchUserlistOwners) {
173+
public TaskInfo(Boolean fetchTweetsFromSearch, Boolean updateTweets, Boolean updatedUsers, Boolean updateUsersFromMentions, Boolean fetchUsersFromList, Boolean controllerCreateTestdataTweets, Boolean controllerCreateTestdataUsers, Boolean controllerCreateImprintUser, Boolean removeOldDataFromStorage, Boolean fetchFollower, Boolean fetchFriends,Boolean fetchUserlistOwners, Boolean updatedUrls) {
167174
this.fetchTweetsFromSearch = fetchTweetsFromSearch;
168175
this.updateTweets = updateTweets;
169176
this.updatedUsers = updatedUsers;
@@ -176,6 +183,7 @@ public TaskInfo(Boolean fetchTweetsFromSearch, Boolean updateTweets, Boolean upd
176183
this.fetchFollower = fetchFollower;
177184
this.fetchFriends = fetchFriends;
178185
this.fetchUserlistOwners = fetchUserlistOwners;
186+
this.updatedUrls = updatedUrls;
179187
}
180188

181189
public Boolean getFetchTweetsFromSearch() {
@@ -254,6 +262,10 @@ public Boolean getStartGarbageCollection() {
254262
return startGarbageCollection;
255263
}
256264

265+
public Boolean getUpdatedUrls() {
266+
return updatedUrls;
267+
}
268+
257269
@Override
258270
public boolean equals(Object o) {
259271
if (this == o) return true;
@@ -267,6 +279,8 @@ public boolean equals(Object o) {
267279
return false;
268280
if (updatedUsers != null ? !updatedUsers.equals(taskInfo.updatedUsers) : taskInfo.updatedUsers != null)
269281
return false;
282+
if (updatedUrls != null ? !updatedUrls.equals(taskInfo.updatedUrls) : taskInfo.updatedUrls != null)
283+
return false;
270284
if (updateUsersFromMentions != null ? !updateUsersFromMentions.equals(taskInfo.updateUsersFromMentions) : taskInfo.updateUsersFromMentions != null)
271285
return false;
272286
if (fetchUsersFromList != null ? !fetchUsersFromList.equals(taskInfo.fetchUsersFromList) : taskInfo.fetchUsersFromList != null)
@@ -304,6 +318,7 @@ public int hashCode() {
304318
int result = fetchTweetsFromSearch != null ? fetchTweetsFromSearch.hashCode() : 0;
305319
result = 31 * result + (updateTweets != null ? updateTweets.hashCode() : 0);
306320
result = 31 * result + (updatedUsers != null ? updatedUsers.hashCode() : 0);
321+
result = 31 * result + (updatedUrls != null ? updatedUrls.hashCode() : 0);
307322
result = 31 * result + (updateUsersFromMentions != null ? updateUsersFromMentions.hashCode() : 0);
308323
result = 31 * result + (fetchUsersFromList != null ? fetchUsersFromList.hashCode() : 0);
309324
result = 31 * result + (controllerCreateTestdataTweets != null ? controllerCreateTestdataTweets.hashCode() : 0);
@@ -329,6 +344,7 @@ public String toString() {
329344
"fetchTweetsFromSearch=" + fetchTweetsFromSearch +
330345
", updateTweets=" + updateTweets +
331346
", updatedUsers=" + updatedUsers +
347+
", updatedUrls=" + updatedUrls +
332348
", updateUsersFromMentions=" + updateUsersFromMentions +
333349
", fetchUsersFromList=" + fetchUsersFromList +
334350
", controllerCreateTestdataTweets=" + controllerCreateTestdataTweets +

0 commit comments

Comments
 (0)