org.qi4j.library.scheduler.timeline
Class TimelineSchedulerServiceMixin

java.lang.Object
  extended by org.qi4j.library.scheduler.timeline.TimelineSchedulerServiceMixin
All Implemented Interfaces:
Composite, Identity, ServiceComposite, Timeline

public abstract class TimelineSchedulerServiceMixin
extends java.lang.Object
implements Timeline, ServiceComposite

WARN TimelineService Mixin use SortedSets to keep records ordered and repeatedly search for the next run. Could be greedy with large intervals


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.qi4j.api.entity.Identity
Identity.IdentityMixin
 
Constructor Summary
TimelineSchedulerServiceMixin()
           
 
Method Summary
 java.lang.Iterable<TimelineRecord> getLastRecords(int maxResults)
           
 java.lang.Iterable<TimelineRecord> getNextRecords(int maxResults)
           
 java.lang.Iterable<TimelineRecord> getRecords(org.joda.time.DateTime from, org.joda.time.DateTime to)
           
 java.lang.Iterable<TimelineRecord> getRecords(long from, long to)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.qi4j.api.entity.Identity
identity
 

Constructor Detail

TimelineSchedulerServiceMixin

public TimelineSchedulerServiceMixin()
Method Detail

getLastRecords

public java.lang.Iterable<TimelineRecord> getLastRecords(int maxResults)
Specified by:
getLastRecords in interface Timeline
Parameters:
maxResults - Maximum number of TimelineRecord to compute
Returns:
Last past records

getNextRecords

public java.lang.Iterable<TimelineRecord> getNextRecords(int maxResults)
Specified by:
getNextRecords in interface Timeline
Parameters:
maxResults - Maximum number of TimelineRecord to compute
Returns:
Next running or future records

getRecords

public java.lang.Iterable<TimelineRecord> getRecords(org.joda.time.DateTime from,
                                                     org.joda.time.DateTime to)
Specified by:
getRecords in interface Timeline
Parameters:
from - Lower limit
to - Upper limit
Returns:
Records between the given dates

getRecords

public java.lang.Iterable<TimelineRecord> getRecords(long from,
                                                     long to)
Specified by:
getRecords in interface Timeline
Parameters:
from - Lower limit
to - Upper limit
Returns:
Records between the given dates