Skip to content

Commit fa91795

Browse files
MLenglholgerhagen
authored andcommitted
TSK-134: Updated to Java 8 Time-API. Removed valid_from/valid_until from
classification.
1 parent e396adf commit fa91795

File tree

69 files changed

+652
-792
lines changed

Some content is hidden

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

69 files changed

+652
-792
lines changed

lib/taskana-cdi/src/test/java/pro/taskana/TaskanaProducersTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ public void testCommit() throws SQLException, ClassNotFoundException, NamingExce
6464
resultCount++;
6565
}
6666
}
67-
68-
Assert.assertEquals(1, resultCount);
67+
Assert.assertEquals(0, resultCount);
6968
}
7069

7170
@Test

lib/taskana-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<dependency>
122122
<groupId>org.mybatis</groupId>
123123
<artifactId>mybatis</artifactId>
124-
<version>3.4.4</version>
124+
<version>3.4.5</version>
125125
</dependency>
126126
<dependency>
127127
<groupId>org.slf4j</groupId>

lib/taskana-core/src/main/java/pro/taskana/Attachment.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package pro.taskana;
22

3-
import java.sql.Timestamp;
3+
import java.time.Instant;
44
import java.util.Map;
55

66
import pro.taskana.model.ObjectReference;
@@ -27,16 +27,16 @@ public interface Attachment {
2727
/**
2828
* Returns the time when the attachment was created.
2929
*
30-
* @return the created time as {@link Timestamp}
30+
* @return the created time as {@link Instant}
3131
*/
32-
Timestamp getCreated();
32+
Instant getCreated();
3333

3434
/**
3535
* Returns the time when the attachment was last modified.
3636
*
37-
* @return modified {@link Timestamp} of the attachment
37+
* @return modified {@link Instant} of the attachment
3838
*/
39-
Timestamp getModified();
39+
Instant getModified();
4040

4141
/**
4242
* Returns the classification summary of the attachment.
@@ -86,17 +86,17 @@ public interface Attachment {
8686
/**
8787
* Returns the time when this attachment was received.
8888
*
89-
* @return received time as exact {@link Timestamp}
89+
* @return received time as exact {@link Instant}
9090
*/
91-
Timestamp getReceived();
91+
Instant getReceived();
9292

9393
/**
9494
* Sets the time when the attachment was received.
9595
*
9696
* @param received
97-
* the time as {@link Timestamp} when the attachment was received
97+
* the time as {@link Instant} when the attachment was received
9898
**/
99-
void setReceived(Timestamp received);
99+
void setReceived(Instant received);
100100

101101
/**
102102
* Returns the custom attributes of this attachment.

lib/taskana-core/src/main/java/pro/taskana/AttachmentSummary.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package pro.taskana;
22

3-
import java.sql.Timestamp;
3+
import java.time.Instant;
44

55
/**
66
* Interface for AttachmentSummaries. This is a specific short model-object which only contains the most important
@@ -25,16 +25,16 @@ public interface AttachmentSummary {
2525
/**
2626
* Gets the time when the attachment was created.
2727
*
28-
* @return the created timestamp
28+
* @return the created Instant
2929
*/
30-
Timestamp getCreated();
30+
Instant getCreated();
3131

3232
/**
3333
* Gets the time when the attachment was last modified.
3434
*
35-
* @return the last modified timestamp
35+
* @return the last modified Instant
3636
*/
37-
Timestamp getModified();
37+
Instant getModified();
3838

3939
/**
4040
* Gets the classificationSummary of the attachment.
@@ -46,8 +46,7 @@ public interface AttachmentSummary {
4646
/**
4747
* Gets the time when the attachment was received.
4848
*
49-
* @return received timestamp
49+
* @return received Instant
5050
*/
51-
Timestamp getReceived();
52-
51+
Instant getReceived();
5352
}

lib/taskana-core/src/main/java/pro/taskana/Classification.java

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package pro.taskana;
22

3-
import java.sql.Date;
3+
import java.time.Instant;
44

55
/**
66
* Interface used to specify the Classification-Model.
@@ -79,9 +79,9 @@ public interface Classification {
7979
/**
8080
* Get the Date when this classification was as created.
8181
*
82-
* @return created as date
82+
* @return created as instant
8383
*/
84-
Date getCreated();
84+
Instant getCreated();
8585

8686
/**
8787
* Get the classification name.
@@ -279,25 +279,10 @@ public interface Classification {
279279
*/
280280
void setCustom8(String custom8);
281281

282-
/**
283-
* Get the sql-date since/when the classification is valid from.
284-
*
285-
* @return validFrom
286-
*/
287-
Date getValidFrom();
288-
289-
/**
290-
* Get the sql-date until the classification is valid.
291-
*
292-
* @return validUntil
293-
*/
294-
Date getValidUntil();
295-
296282
/**
297283
* Return a summary of the current Classification.
298284
*
299285
* @return the ClassificationSummary object for the current classification
300286
*/
301287
ClassificationSummary asSummary();
302-
303288
}

lib/taskana-core/src/main/java/pro/taskana/ClassificationQuery.java

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package pro.taskana;
22

3-
import java.util.Date;
3+
import java.time.Instant;
44

55
/**
66
* ClassificationQuery for generating dynamic sql.
@@ -65,10 +65,10 @@ public interface ClassificationQuery extends BaseQuery<ClassificationSummary> {
6565
* Add your created-Dates to your query.
6666
*
6767
* @param created
68-
* date of classification creation.
68+
* date (as instant) of classification creation.
6969
* @return the query
7070
*/
71-
ClassificationQuery created(Date... created);
71+
ClassificationQuery created(Instant... created);
7272

7373
/**
7474
* Add your name to your query.
@@ -124,22 +124,4 @@ public interface ClassificationQuery extends BaseQuery<ClassificationSummary> {
124124
* @return the query
125125
*/
126126
ClassificationQuery customFields(String... customFields);
127-
128-
/**
129-
* Define after which date the classifications should be valid.
130-
*
131-
* @param validFrom
132-
* date when the classification was valid from
133-
* @return the query
134-
*/
135-
ClassificationQuery validFrom(Date... validFrom);
136-
137-
/**
138-
* Define until which date the classifications should be valid.
139-
*
140-
* @param validUntil
141-
* date until the classification will be or was valid
142-
* @return the query
143-
*/
144-
ClassificationQuery validUntil(Date... validUntil);
145127
}

lib/taskana-core/src/main/java/pro/taskana/ClassificationSummary.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package pro.taskana;
22

3-
import java.sql.Timestamp;
4-
53
/**
64
* Interface for ClassificationSummaries. This is a specific short model-object which only requieres the most important
75
* informations. Specific ones can be load afterwards via ID.
@@ -49,11 +47,4 @@ public interface ClassificationSummary {
4947
* @return classificationName
5048
*/
5149
String getName();
52-
53-
/**
54-
* Gets the timestamp until the classification is/was valid.
55-
*
56-
* @return validUntil as timestamp
57-
*/
58-
Timestamp getValidUntil();
5950
}

lib/taskana-core/src/main/java/pro/taskana/Task.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package pro.taskana;
22

3-
import java.sql.Timestamp;
3+
import java.time.Instant;
44
import java.util.List;
55
import java.util.Map;
66

@@ -22,52 +22,52 @@ public interface Task {
2222
/**
2323
* Returns the time when the task was {@link TaskState#READY}.
2424
*
25-
* @return created as exact {@link Timestamp}
25+
* @return created as exact {@link Instant}
2626
*/
27-
Timestamp getCreated();
27+
Instant getCreated();
2828

2929
/**
3030
* Returns the time when the task was set to {@link TaskState#CLAIMED} by/to a user.
3131
*
32-
* @return claimed as exact {@link Timestamp}
32+
* @return claimed as exact {@link Instant}
3333
*/
34-
Timestamp getClaimed();
34+
Instant getClaimed();
3535

3636
/**
3737
* Returns the time when the task was set into {@link TaskState#COMPLETED}.
3838
*
39-
* @return completed as exact {@link Timestamp}
39+
* @return completed as exact {@link Instant}
4040
*/
41-
Timestamp getCompleted();
41+
Instant getCompleted();
4242

4343
/**
4444
* Returns the time when the task was modified the last time.
4545
*
46-
* @return modified as exact {@link Timestamp}
46+
* @return modified as exact {@link Instant}
4747
*/
48-
Timestamp getModified();
48+
Instant getModified();
4949

5050
/**
5151
* Returns the time when the work on this task was planned to be started.
5252
*
53-
* @return planned as exact {@link Timestamp}
53+
* @return planned as exact {@link Instant}
5454
*/
55-
Timestamp getPlanned();
55+
Instant getPlanned();
5656

5757
/**
5858
* Sets the time when the work on this task should be started.
5959
*
6060
* @param planned
61-
* as exact {@link Timestamp}
61+
* as exact {@link Instant}
6262
*/
63-
void setPlanned(Timestamp planned);
63+
void setPlanned(Instant planned);
6464

6565
/**
6666
* Returns the time when this task should be finished.
6767
*
68-
* @return due as exact {@link Timestamp}
68+
* @return due as exact {@link Instant}
6969
*/
70-
Timestamp getDue();
70+
Instant getDue();
7171

7272
/**
7373
* Return the name of the current task.

lib/taskana-core/src/main/java/pro/taskana/TaskMonitorService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,4 @@ public interface TaskMonitorService {
6060
* @return a {@link Report} object
6161
*/
6262
Report getWorkbasketLevelReport(List<Workbasket> workbaskets, List<TaskState> states);
63-
6463
}

lib/taskana-core/src/main/java/pro/taskana/TaskQuery.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,4 @@ public interface TaskQuery extends BaseQuery<TaskSummary> {
221221
* @return a {@link ObjectReferenceQuery}
222222
*/
223223
ObjectReferenceQuery createObjectReferenceQuery();
224-
225224
}

lib/taskana-core/src/main/java/pro/taskana/TaskSummary.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package pro.taskana;
22

3-
import java.sql.Timestamp;
3+
import java.time.Instant;
44

55
import pro.taskana.model.ObjectReference;
66
import pro.taskana.model.TaskState;
@@ -20,44 +20,44 @@ public interface TaskSummary {
2020
/**
2121
* Gets the time when the task was created.
2222
*
23-
* @return the created timestamp
23+
* @return the created Instant
2424
*/
25-
Timestamp getCreated();
25+
Instant getCreated();
2626

2727
/**
2828
* Gets the time when the task was claimed.
2929
*
30-
* @return the claimed timestamp
30+
* @return the claimed Instant
3131
*/
32-
Timestamp getClaimed();
32+
Instant getClaimed();
3333

3434
/**
3535
* Gets the time when the task was completed.
3636
*
37-
* @return the completed timestamp
37+
* @return the completed Instant
3838
*/
39-
Timestamp getCompleted();
39+
Instant getCompleted();
4040

4141
/**
4242
* Gets the time when the task was last modified.
4343
*
44-
* @return the last modified timestamp
44+
* @return the last modified Instant
4545
*/
46-
Timestamp getModified();
46+
Instant getModified();
4747

4848
/**
4949
* Gets the time when the task is planned to be executed.
5050
*
51-
* @return the planned timestamp
51+
* @return the planned Instant
5252
*/
53-
Timestamp getPlanned();
53+
Instant getPlanned();
5454

5555
/**
5656
* Gets the time when the task is due.
5757
*
58-
* @return the due timestamp
58+
* @return the due Instant
5959
*/
60-
Timestamp getDue();
60+
Instant getDue();
6161

6262
/**
6363
* Gets the name of the task.
@@ -219,5 +219,4 @@ public interface TaskSummary {
219219
* @return the task's custom10 property
220220
*/
221221
String getCustom10();
222-
223222
}

lib/taskana-core/src/main/java/pro/taskana/TaskanaEngine.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,4 @@ enum ConnectionManagementMode {
8080
AUTOCOMMIT,
8181
EXPLICIT
8282
}
83-
8483
}

0 commit comments

Comments
 (0)