◆ addTrack()
Definition at line 65 of file TimeTrackerQueue.java.
66 if(type !=
null && type.isPreviousValid(
getLastType())) {
67 TimeTracker tt =
new TimeTracker();
68 tt.setEntityPath(entityPath);
69 tt.setTrackedPath(trackedPath);
70 tt.setTrackType(type);
71 tt.setTimeTrack(dateTrack);
73 tt = getDao().saveObject(tt);
74 if(!tt.getTrackType().isStarts()) {
76 tt = getDao().find(TimeTracker.class, TimeTrackerPK.from(tt));
TimeTrackerType getLastType()
◆ correctDate()
boolean org.turro.timetracker.TimeTrackerQueue.correctDate |
( |
CheckDate |
dateTrack | ) |
|
Definition at line 56 of file TimeTrackerQueue.java.
57 if(isEmpty())
return true;
58 TimeTracker tt = last();
60 return tt.getTimeTrack().before(dateTrack.getDate());
◆ deleteLastTrack()
void org.turro.timetracker.TimeTrackerQueue.deleteLastTrack |
( |
| ) |
|
◆ getActiveTracks()
List<TimeTracker> org.turro.timetracker.TimeTrackerQueue.getActiveTracks |
( |
| ) |
|
Definition at line 94 of file TimeTrackerQueue.java.
List< TimeTracker > getTracksByStatus(Set< TimeTrackerType > types)
◆ getInactiveTracks()
List<TimeTracker> org.turro.timetracker.TimeTrackerQueue.getInactiveTracks |
( |
| ) |
|
◆ getLastType()
Definition at line 84 of file TimeTrackerQueue.java.
85 TimeTracker last = isEmpty() ? null : last();
86 return last ==
null ? null : last.getTrackType();
◆ getNextValids()
Set<TimeTrackerType> org.turro.timetracker.TimeTrackerQueue.getNextValids |
( |
| ) |
|
Definition at line 89 of file TimeTrackerQueue.java.
90 TimeTracker last = isEmpty() ? null : last();
91 return last ==
null ? EnumSet.of(TimeTrackerType.TRACK_START) : TimeTrackerType.getValidNexts(last.getTrackType());
◆ getTracksByStatus()
Definition at line 102 of file TimeTrackerQueue.java.
103 WhereClause wc =
new WhereClause();
104 wc.addClause(
"select tt from TimeTracker tt");
105 wc.addClause(
"where tt.trackedPath = :trackedPath");
106 wc.addNamedValue(
"trackedPath", trackedPath);
107 wc.addClause(
"and tt.trackType in (:types)");
108 wc.addNamedValue(
"types", types);
109 wc.addClause(
"and tt.timeTrack = (");
110 wc.addClause(
"select max(t2.timeTrack) from TimeTracker t2");
111 wc.addClause(
"where tt.entityPath = t2.entityPath");
112 wc.addClause(
"and tt.trackedPath = t2.trackedPath");
114 return getDao().getResultList(TimeTracker.class, wc);
◆ hasFullIntegrity()
boolean org.turro.timetracker.TimeTrackerQueue.hasFullIntegrity |
( |
| ) |
|
Definition at line 148 of file TimeTrackerQueue.java.
149 WhereClause wc =
new WhereClause();
150 wc.addClause(
"select tt from TimeTracker tt");
151 wc.addClause(
"where tt.entityPath = :entityPath");
152 wc.addNamedValue(
"entityPath", entityPath);
153 wc.addClause(
"and tt.trackedPath = :trackedPath");
154 wc.addNamedValue(
"trackedPath", trackedPath);
155 wc.addClause(
"order by tt.timeTrack ASC");
156 TimeTrackerType[] previousType =
new TimeTrackerType[1];
157 try(Stream<TimeTracker> entries = getDao().stream(TimeTracker.class, wc)) {
158 return entries.noneMatch(e -> {
159 boolean match = !e.getTrackType().isPreviousValid(previousType[0]);
160 previousType[0] = e.getTrackType();
◆ hasIntegrity()
boolean org.turro.timetracker.TimeTrackerQueue.hasIntegrity |
( |
| ) |
|
Definition at line 47 of file TimeTrackerQueue.java.
48 TimeTrackerType[] previousType =
new TimeTrackerType[1];
49 return stream().noneMatch(e -> {
50 boolean match = !e.getTrackType().isPreviousValid(previousType[0]);
51 previousType[0] = e.getTrackType();
◆ load() [1/2]
static TimeTrackerQueue org.turro.timetracker.TimeTrackerQueue.load |
( |
String |
entityPath, |
|
|
String |
trackedPath |
|
) |
| |
|
static |
Definition at line 196 of file TimeTrackerQueue.java.
197 TimeTrackerQueue ttq =
new TimeTrackerQueue(entityPath, trackedPath);
198 ttq.loadLastActiveTrack();
◆ load() [2/2]
static TimeTrackerQueue org.turro.timetracker.TimeTrackerQueue.load |
( |
String |
entityPath, |
|
|
String |
trackedPath, |
|
|
int |
hours |
|
) |
| |
|
static |
Definition at line 202 of file TimeTrackerQueue.java.
203 TimeTrackerQueue ttq =
new TimeTrackerQueue(entityPath, trackedPath);
204 ttq.loadLastHoursEntries(hours);
◆ repairWith()
void org.turro.timetracker.TimeTrackerQueue.repairWith |
( |
Duration |
max | ) |
|
Definition at line 166 of file TimeTrackerQueue.java.
167 WhereClause wc =
new WhereClause();
168 wc.addClause(
"select tt from TimeTracker tt");
169 wc.addClause(
"where tt.entityPath = :entityPath");
170 wc.addNamedValue(
"entityPath", entityPath);
171 wc.addClause(
"and tt.trackedPath = :trackedPath");
172 wc.addNamedValue(
"trackedPath", trackedPath);
173 wc.addClause(
"order by tt.timeTrack ASC");
174 TimeTracker[] previous =
new TimeTracker[1];
175 try(Stream<TimeTracker> entries = getDao().stream(TimeTracker.class, wc)) {
176 entries.forEach(e -> {
177 if(!e.isPreviousValid(previous[0])) {
178 repair(max, previous[0], e);
The documentation for this class was generated from the following file: