Skip to content

Commit ed9d8cf

Browse files
Merge pull request #231 from phasenraum2010/milestone-1.0.22
Milestone 1.0.22
2 parents 8914d9e + 4d6985d commit ed9d8cf

Some content is hidden

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

54 files changed

+611
-603
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,11 @@ indent_size = 2
2020
indent_style = space
2121
insert_final_newline = false
2222
trim_trailing_whitespace = true
23+
24+
[LICENSE.code.txt]
25+
charset = utf-8
26+
end_of_line = lf
27+
indent_size = 3
28+
indent_style = space
29+
insert_final_newline = false
30+
trim_trailing_whitespace = true

.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ buildNumber.properties
1212
!/.mvn/wrapper/maven-wrapper.jar
1313

1414
.idea
15-
*.iml
1615
twitterwall.log
1716
twitterwall.log*
1817
maven-build.log
@@ -21,7 +20,20 @@ maven-testing.log.txt
2120
spring-boot.log.txt
2221
maven-testing-site.log.txt
2322
test.log.txt
23+
24+
test/twitterwall.log.txt
25+
test/twitterwall.log.txt*
26+
test/maven-build.log
27+
test/maven-build.log.txt
28+
test/maven-testing.log.txt
29+
test/spring-boot.log.txt
30+
test/maven-testing-site.log.txt
31+
test/test.log.txt
32+
33+
.m2
34+
2435
docs2
36+
docs-site-deployed
2537
.bundle
2638
.sass-cache
2739
Gemfile.lock
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
1+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sudo: false
2+
language: java
3+
jdk:
4+
- oraclejdk8
5+
script:
6+
- test/run-travis.sh

LICENSE

Lines changed: 0 additions & 339 deletions
This file was deleted.

LICENSE.code.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
All code in this repository is:
2+
=======================================================================
3+
Copyright (c) 2013 Thomas Woehlke All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.

LICENSE.writing.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Except where otherwise noted, this work is licensed under http://creativecommons.org/licenses/by-nd/3.0/

pom.xml

Lines changed: 74 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
<parent>
1515
<groupId>org.springframework.boot</groupId>
1616
<artifactId>spring-boot-starter-parent</artifactId>
17-
<version>1.5.4.RELEASE</version>
17+
<version>1.5.6.RELEASE</version>
1818
</parent>
1919

2020
<organization>
2121
<name>Thomas Woehlke</name>
2222
<url>https://twitter.com/ThomasWoehlke</url>
2323
</organization>
24+
2425
<inceptionYear>2017</inceptionYear>
26+
2527
<scm>
2628
<url>https://github.com/phasenraum2010/twitterwall2.git</url>
2729
<connection>scm:git:https://github.com/phasenraum2010/twitterwall2.git</connection>
@@ -33,23 +35,26 @@
3335
<system>GitHub</system>
3436
<url>https://github.com/phasenraum2010/twitterwall2/issues</url>
3537
</issueManagement>
38+
3639
<distributionManagement>
3740
<site>
3841
<id>simpleworklist.shadowfax.fritz.box</id>
39-
<url>file://${project.basedir}/docs2</url>
42+
<url>file://${project.basedir}/target/site-deployed</url>
4043
</site>
4144
</distributionManagement>
45+
4246
<developers>
4347
<developer>
4448
<name>Thomas Wöhlke</name>
4549
<email>thomas@woehlke.org</email>
4650
<url>https://github.com/phasenraum2010</url>
4751
</developer>
4852
</developers>
53+
4954
<licenses>
5055
<license>
51-
<name>GNU General Public License v2.0</name>
52-
<url>http://www.gnu.org/licenses/old-licenses/gpl-2.0</url>
56+
<name>Apache License, Version 2.0</name>
57+
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
5358
</license>
5459
</licenses>
5560

@@ -88,16 +93,6 @@
8893
<groupId>org.springframework.boot</groupId>
8994
<artifactId>spring-boot-starter-mobile</artifactId>
9095
</dependency>
91-
<!--
92-
<dependency>
93-
<groupId>org.springframework.boot</groupId>
94-
<artifactId>spring-boot-starter-validation</artifactId>
95-
</dependency>
96-
<dependency>
97-
<groupId>org.springframework.boot</groupId>
98-
<artifactId>spring-boot-starter-hateoas</artifactId>
99-
</dependency>
100-
-->
10196
<dependency>
10297
<groupId>org.springframework.boot</groupId>
10398
<artifactId>spring-boot-starter-logging</artifactId>
@@ -185,6 +180,11 @@
185180
<build>
186181
<plugins>
187182

183+
<plugin>
184+
<groupId>org.springframework.boot</groupId>
185+
<artifactId>spring-boot-maven-plugin</artifactId>
186+
</plugin>
187+
188188
<plugin>
189189
<groupId>org.apache.maven.plugins</groupId>
190190
<artifactId>maven-compiler-plugin</artifactId>
@@ -200,10 +200,29 @@
200200
<artifactId>maven-source-plugin</artifactId>
201201
</plugin>
202202

203+
<plugin>
204+
<groupId>org.apache.maven.plugins</groupId>
205+
<artifactId>maven-dependency-plugin</artifactId>
206+
<executions>
207+
<execution>
208+
<id>src-dependencies</id>
209+
<phase>package</phase>
210+
<goals>
211+
<!-- use copy-dependencies instead if you don't want to explode the sources -->
212+
<goal>copy-dependencies</goal>
213+
</goals>
214+
<configuration>
215+
<classifier>sources</classifier>
216+
<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
217+
<outputDirectory>${project.build.directory}/sources</outputDirectory>
218+
</configuration>
219+
</execution>
220+
</executions>
221+
</plugin>
222+
203223
<plugin>
204224
<groupId>org.apache.maven.plugins</groupId>
205225
<artifactId>maven-javadoc-plugin</artifactId>
206-
<version>2.10.4</version>
207226
<configuration>
208227
<!--
209228
<linksource>true</linksource>
@@ -213,17 +232,26 @@
213232
<encoding>${project.build.sourceEncoding}</encoding>
214233
<javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
215234
</configuration>
235+
<executions>
236+
<execution>
237+
<id>javadoc-javadoc-package</id>
238+
<phase>package</phase>
239+
<goals>
240+
<goal>javadoc</goal>
241+
</goals>
242+
<configuration>
243+
<!--
244+
<linksource>true</linksource>
245+
-->
246+
<maxmemory>2048m</maxmemory>
247+
<source>1.8</source>
248+
<encoding>${project.build.sourceEncoding}</encoding>
249+
<javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
250+
</configuration>
251+
</execution>
252+
</executions>
216253
</plugin>
217254

218-
<plugin>
219-
<groupId>org.apache.maven.plugins</groupId>
220-
<artifactId>maven-dependency-plugin</artifactId>
221-
</plugin>
222-
223-
<plugin>
224-
<groupId>org.springframework.boot</groupId>
225-
<artifactId>spring-boot-maven-plugin</artifactId>
226-
</plugin>
227255
<!-- Fuer Continous-Integration et al.: Auschecken von Subversion mittels
228256
Maven. http://maven.apache.org/scm/ -->
229257
<plugin>
@@ -383,6 +411,7 @@
383411
</build>
384412

385413
<profiles>
414+
386415
<profile>
387416
<id>default</id>
388417
<activation>
@@ -402,6 +431,7 @@
402431
</plugins>
403432
</build>
404433
</profile>
434+
405435
<profile>
406436
<id>testing</id>
407437
<build>
@@ -420,6 +450,26 @@
420450
</plugins>
421451
</build>
422452
</profile>
453+
454+
<profile>
455+
<id>travis</id>
456+
<build>
457+
<plugins>
458+
459+
<plugin>
460+
<groupId>org.apache.maven.plugins</groupId>
461+
<artifactId>maven-surefire-plugin</artifactId>
462+
<configuration>
463+
<systemPropertyVariables>
464+
<spring.profiles.active>travis</spring.profiles.active>
465+
</systemPropertyVariables>
466+
</configuration>
467+
</plugin>
468+
469+
</plugins>
470+
</build>
471+
</profile>
472+
423473
</profiles>
424474

425475

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

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@Component
1616
public class ScheduledTasks {
1717

18-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS)
18+
@Scheduled(initialDelay= TEN_SECONDS, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS)
1919
public void fetchTweetsFromTwitterSearch() {
2020
String msg = "fetch Tweets From TwitterSearch ";
2121
if(schedulerProperties.getAllowUpdateTweets() && !schedulerProperties.getSkipFortesting()) {
@@ -24,25 +24,25 @@ public void fetchTweetsFromTwitterSearch() {
2424
}
2525
}
2626

27-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_TWEETS)
28-
public void updateTweets() {
29-
String msg = "update Tweets ";
30-
if(schedulerProperties.getAllowUpdateTweets() && !schedulerProperties.getSkipFortesting()){
31-
Task task = asyncStartTask.updateTweets();
27+
@Scheduled(initialDelay= TEN_SECONDS *2, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_USER_LIST)
28+
public void fetchUsersFromDefinedUserList(){
29+
String msg = "fetch Users from Defined User List ";
30+
if(schedulerProperties.getFetchUserListAllow() && !schedulerProperties.getSkipFortesting()) {
31+
Task task = asyncStartTask.fetchUsersFromList();
3232
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
3333
}
3434
}
3535

36-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER)
37-
public void updateUserProfiles() {
38-
String msg = "update User Profiles ";
39-
if(schedulerProperties.getAllowUpdateUserProfiles() && !schedulerProperties.getSkipFortesting()) {
40-
Task task = asyncStartTask.updateUsers();
36+
@Scheduled(initialDelay= TEN_SECONDS *3, fixedRate = FIXED_RATE_FOR_SCHEDULAR_REMOVE_OLD_DATA_FROM_STORAGE)
37+
public void removeOldDataFromStorage(){
38+
String msg = "remove Old Data From Storage: ";
39+
if(schedulerProperties.getRemoveOldDataFromStorageAllow() && !schedulerProperties.getSkipFortesting()) {
40+
Task task = asyncStartTask.removeOldDataFromStorage();
4141
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
4242
}
4343
}
4444

45-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION)
45+
@Scheduled(initialDelay= TEN_SECONDS *4, fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION)
4646
public void updateUserProfilesFromMentions(){
4747
String msg = "update User Profiles From Mentions";
4848
if(schedulerProperties.getAllowUpdateUserProfilesFromMention() && !schedulerProperties.getSkipFortesting()) {
@@ -51,11 +51,20 @@ public void updateUserProfilesFromMentions(){
5151
}
5252
}
5353

54-
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_USER_LIST)
55-
public void fetchUsersFromDefinedUserList(){
56-
String msg = "fetch Users from Defined User List ";
57-
if(schedulerProperties.getFetchUserListAllow() && !schedulerProperties.getSkipFortesting()) {
58-
Task task = asyncStartTask.fetchUsersFromList();
54+
@Scheduled(initialDelay= TEN_SECONDS *5, fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_TWEETS)
55+
public void updateTweets() {
56+
String msg = "update Tweets ";
57+
if(schedulerProperties.getAllowUpdateTweets() && !schedulerProperties.getSkipFortesting()){
58+
Task task = asyncStartTask.updateTweets();
59+
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
60+
}
61+
}
62+
63+
@Scheduled(initialDelay= TEN_SECONDS *6, fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER)
64+
public void updateUserProfiles() {
65+
String msg = "update User Profiles ";
66+
if(schedulerProperties.getAllowUpdateUserProfiles() && !schedulerProperties.getSkipFortesting()) {
67+
Task task = asyncStartTask.updateUsers();
5968
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
6069
}
6170
}
@@ -66,21 +75,25 @@ public ScheduledTasks(SchedulerProperties schedulerProperties, AsyncStartTask mq
6675
this.asyncStartTask = mqAsyncStartTask;
6776
}
6877

69-
public final static long EINE_MINUTE = 60 * 1000;
78+
public final static long TEN_SECONDS = 10 * 1000;
79+
80+
public final static long ONE_MINUTE = 60 * 1000;
81+
82+
public final static long ONE_HOUR = 60 * ONE_MINUTE;
7083

71-
public final static long EINE_STUNDE = 60 * EINE_MINUTE;
84+
public final static long TWELVE_HOURS = 12 * ONE_HOUR;
7285

73-
public final static long ZWOELF_STUNDEN = 12 * EINE_STUNDE;
86+
private final static long FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS = ONE_HOUR;
7487

75-
private final static long FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS = EINE_STUNDE;
88+
private final static long FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER = TWELVE_HOURS;
7689

77-
private final static long FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER = ZWOELF_STUNDEN;
90+
private final static long FIXED_RATE_FOR_SCHEDULAR_UPDATE_TWEETS = TWELVE_HOURS;
7891

79-
private final static long FIXED_RATE_FOR_SCHEDULAR_UPDATE_TWEETS = ZWOELF_STUNDEN;
92+
private final static long FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION = ONE_HOUR;
8093

81-
private final static long FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION = EINE_STUNDE;
94+
private final static long FIXED_RATE_FOR_SCHEDULAR_FETCH_USER_LIST = TWELVE_HOURS;
8295

83-
private final static long FIXED_RATE_FOR_SCHEDULAR_FETCH_USER_LIST = ZWOELF_STUNDEN;
96+
private final static long FIXED_RATE_FOR_SCHEDULAR_REMOVE_OLD_DATA_FROM_STORAGE = ONE_HOUR;
8497

8598
private static final Logger log = LoggerFactory.getLogger(ScheduledTasks.class);
8699

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public class SchedulerProperties {
3636
@NotNull
3737
private String fetchUserListName;
3838

39+
@NotNull
40+
private Boolean removeOldDataFromStorageAllow;
41+
3942
public Boolean getAllowFetchTweetsFromTwitterSearch() {
4043
return allowFetchTweetsFromTwitterSearch;
4144
}
@@ -99,4 +102,12 @@ public String getFetchUserListName() {
99102
public void setFetchUserListName(String fetchUserListName) {
100103
this.fetchUserListName = fetchUserListName;
101104
}
105+
106+
public Boolean getRemoveOldDataFromStorageAllow() {
107+
return removeOldDataFromStorageAllow;
108+
}
109+
110+
public void setRemoveOldDataFromStorageAllow(Boolean removeOldDataFromStorageAllow) {
111+
this.removeOldDataFromStorageAllow = removeOldDataFromStorageAllow;
112+
}
102113
}

0 commit comments

Comments
 (0)