|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.trigger.Trigger
This class is an association between a time and an action to trigger.
Trigger are stored by an implementor of ITriggerList
.
The Comparable
interface is implemented to order triggers by
their earliest date in the date list.
Inner Class Summary | |
class |
Trigger.ActionThread
This class is a thread that invokes the action for this event. |
Constructor Summary | |
Trigger()
Constructor. |
|
Trigger(java.util.Date date,
java.util.Collection actions)
Constructs a trigger with specified date when the trigger executes, and the specified actions to process. |
|
Trigger(java.util.Date date,
java.util.Collection actions,
java.util.Collection progresses)
Constructs a trigger with specified date when the trigger executes, specified actions to process, and specified progresses. |
|
Trigger(java.util.Date date,
java.util.Collection actions,
java.util.Collection progresses,
ITimeoutAlgorithm timeout,
long lExpiration)
Constructs a trigger with a specified date when the trigger executes, specified actions to process, specified progresses, timeout algorithm for retries, and an expiration. |
|
Trigger(java.util.Date eventDate,
DateRecurrence recurrence,
int iRemindBeforeHand,
java.util.Collection actions)
Constructs a trigger with specified event date, specified number of minutes to remind before event, and the specified action to process. |
|
Trigger(java.util.Date eventDate,
DateRecurrence recurrence,
int iRemindBeforeHand,
ITriggerAction action)
Constructs a trigger with specified event date, specified number of minutes to remind before event, and the specified action to process. |
|
Trigger(java.util.Date eventDate,
DateRecurrence recurrence,
long lRemindBeforeHand,
java.util.Collection actions)
Constructs a trigger with specified event date, specified number of minutes to remind before event, and the specified action to process. |
|
Trigger(java.util.Date eventDate,
DateRecurrence recurrence,
long lRemindBeforeHand,
ITriggerAction action)
Constructs a trigger with specified event date, specified number of minutes to remind before event, and the specified action to process. |
|
Trigger(java.util.Date date,
ITriggerAction action)
Constructs a trigger with specified date when the trigger executes, and the specified action to process. |
|
Trigger(java.util.Date date,
ITriggerAction action,
ITriggerProgress progress)
Constructs a trigger with specified date when the trigger executes, a specified action to process, and a specified progress. |
|
Trigger(java.util.Date date,
ITriggerAction action,
ITriggerProgress progress,
ITimeoutAlgorithm timeout,
long lExpiration)
Constructs a trigger with a specified date when the trigger executes, specified actions to process, specified progresses, timeout algorithm for retries, and an expiration. |
|
Trigger(IDateList dates,
java.util.Collection actions)
Constructs a trigger with specified date list of when the trigger executes, and specified actions to process. |
|
Trigger(IDateList dates,
java.util.Collection actions,
java.util.Collection progresses)
Constructs a trigger with specified date list of when the trigger executes, specified actions to process, and specified progresses. |
|
Trigger(IDateList dates,
java.util.Collection actions,
java.util.Collection progresses,
ITimeoutAlgorithm timeout,
long lExpiration)
Constructs a trigger with a specified date list of when the trigger executes, specified actions to process, specified progresses, timeout algorithm for retries, and an expiration. |
|
Trigger(IDateList dates,
ITriggerAction action)
Constructs a trigger with specified date list of when the trigger executes, and the specified action to process. |
|
Trigger(IDateList dates,
ITriggerAction action,
ITriggerProgress progress)
Constructs a trigger with specified date list of when the trigger executes, specified action to process, and specified progress. |
|
Trigger(IDateList dates,
ITriggerAction action,
ITriggerProgress progress,
ITimeoutAlgorithm timeout,
long lExpiration)
Constructs a trigger with a specified date list of when the trigger executes, specified action to process, specified progress, timeout algorithm for retries, and an expiration. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this to the passed in trigger event. |
boolean |
execute()
Waits for the next date to occur, then trigger the action in a new thread. |
IDateList |
getDates()
Gets the list of trigger dates. |
long |
getEventID()
Gets the associated event ID. |
long |
getExpiration()
Gets the number of milliseconds after each action starts that it expires, or will not be executed if it fails. |
long |
getID()
Gets the trigger ID. |
long |
getRemindBeforeHand()
Gets the amount of time (in millis) to remind before an event. |
ITimeoutAlgorithm |
getTimeoutAlgorithm()
Gets the timeout alogithm. |
java.util.Collection |
getTriggerActions()
Gets a collection of trigger actions. |
long |
getTriggerPK()
Gets the trigger ID. |
java.util.Collection |
getTriggerProgresses()
Gets a colleciton of trigger progresses. |
void |
setDate(java.util.Date date)
Sets the date to execute the trigger. |
void |
setDates(IDateList dates)
Sets the list of dates to execute the trigger. |
void |
setEventID(long lEventID)
|
void |
setExpiration(long lExpiration)
Sets the number of milliseconds after each action starts that it expires, or will not be executed if it fails. |
void |
setOffset(long lOffset)
Sets the time offset between the client and the server. |
void |
setRemindBeforeHand(long lRemindBeforeHand)
Sets the amount of time (in millis) to remind before a trigger. |
void |
setTimeoutAlgorithm(ITimeoutAlgorithm timeout)
Sets the timeout algorithm. |
void |
setTriggerAction(ITriggerAction action)
Sets action to trigger to the specified action. |
void |
setTriggerActions(java.util.Collection actions)
Sets the trigger actions. |
void |
setTriggerProgresses(java.util.Collection progresses)
Sets the progress indicators to be notified as the trigger is processes. |
java.lang.String |
toString()
Returns the string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Trigger()
public Trigger(java.util.Date eventDate, DateRecurrence recurrence, int iRemindBeforeHand, ITriggerAction action)
eventDate
- the date the event is to occurrecurrence
- the recurrence for the eventiRemindBeforeHand
- the number of minutes to remind before eventaction
- the action to process (ITriggerAction
)public Trigger(java.util.Date eventDate, DateRecurrence recurrence, int iRemindBeforeHand, java.util.Collection actions)
eventDate
- the date the event is to occurrecurrence
- the recurrence for the eventiRemindBeforeHand
- the number of minutes to remind before eventactions
- the collection of actions to process (ITriggerAction
)public Trigger(java.util.Date eventDate, DateRecurrence recurrence, long lRemindBeforeHand, ITriggerAction action)
eventDate
- the date the event is to occurrecurrence
- the recurrence for the eventlRemindBeforeHand
- the number of minutes(in millis) to remind before eventaction
- the action to process (ITriggerAction
)public Trigger(java.util.Date eventDate, DateRecurrence recurrence, long lRemindBeforeHand, java.util.Collection actions)
eventDate
- the date the event is to occurrecurrence
- the recurrence for the eventlRemindBeforeHand
- the number of minutes(in millis) to remind before eventactions
- the collection of actions to process (ITriggerAction
)public Trigger(java.util.Date date, ITriggerAction action)
date
- the date to trigger actionaction
- the trigger action interface to notifypublic Trigger(java.util.Date date, java.util.Collection actions)
dates
- the dates to trigger the actionaction
- the trigger action interface to notifypublic Trigger(IDateList dates, ITriggerAction action)
dates
- the dates to trigger the actionaction
- the trigger action interface to notifypublic Trigger(IDateList dates, java.util.Collection actions)
dates
- the dates to trigger the actionactions
- the trigger action interface to notifypublic Trigger(java.util.Date date, ITriggerAction action, ITriggerProgress progress)
date
- the date to trigger the actionaction
- the trigger action interface to notifyprogress
- the trigger progress interface to notifypublic Trigger(java.util.Date date, java.util.Collection actions, java.util.Collection progresses)
date
- the date to trigger the actionactions
- the trigger action interfaces to notifyprogresses
- the trigger progress interfaces to notifypublic Trigger(IDateList dates, ITriggerAction action, ITriggerProgress progress)
dates
- the dates to trigger the actionaction
- the trigger action interface to notifyprogress
- the trigger progress interface to notifypublic Trigger(IDateList dates, java.util.Collection actions, java.util.Collection progresses)
dates
- the dates to trigger the actionactions
- the trigger action interfaces to notifyprogresses
- the trigger progress interfaces to notifypublic Trigger(java.util.Date date, ITriggerAction action, ITriggerProgress progress, ITimeoutAlgorithm timeout, long lExpiration)
date
- the date to trigger the actionaction
- the trigger action interface to notifyprogress
- the trigger progress interface to notifytimeout
- the timeout alogortihm for retrieslExpiration
- the time after which if actions does not
succeed they are considered a failure (0 for indefinite) in millisecondspublic Trigger(java.util.Date date, java.util.Collection actions, java.util.Collection progresses, ITimeoutAlgorithm timeout, long lExpiration)
date
- the date to trigger the actionactions
- the trigger action interfaces to notifyprogresses
- the trigger progress interfaces to notifytimeout
- the timeout alogortihm for retrieslExpiration
- the time after which if actions do not
succeed they are considered a failure (0 for indefinite) in millisecondspublic Trigger(IDateList dates, ITriggerAction action, ITriggerProgress progress, ITimeoutAlgorithm timeout, long lExpiration)
dates
- the dates to trigger the actionaction
- the trigger action interface to notifyprogress
- the trigger progress interface to notifytimeout
- the timeout alogortihm for retrieslExpiration
- the time after which if actions do not
succeed they are considered a failure (0 for indefinite) in millisecondspublic Trigger(IDateList dates, java.util.Collection actions, java.util.Collection progresses, ITimeoutAlgorithm timeout, long lExpiration)
dates
- the dates to trigger the actionactions
- the trigger action interfaces to notifyprogresses
- the trigger progress interfaces to notifytimeout
- the timeout alogortihm for retrieslExpiration
- the time after which if actions do not
succeed they are considered a failure (0 for indefinite) in millisecondsMethod Detail |
public long getTriggerPK()
getID()
.getID()
public long getID()
getTriggerPK()
.getTriggerPK()
public void setEventID(long lEventID)
public long getEventID()
public long getRemindBeforeHand()
public void setRemindBeforeHand(long lRemindBeforeHand)
lRemindBeforeHand
- the amount of time (in millis)public IDateList getDates()
public void setDates(IDateList dates)
dateList
- a list of dates to execute the trigger (may not be null
)public void setDate(java.util.Date date)
date
- the date of triggerpublic java.util.Collection getTriggerActions()
ITriggerAction
objectspublic void setTriggerActions(java.util.Collection actions)
actions
- a collection of ITriggerAction
objects (may not be null
)public void setTriggerAction(ITriggerAction action)
action
- the action to set (may not be null
)public java.util.Collection getTriggerProgresses()
ITriggerProgress
objects (unmodifiable)public void setTriggerProgresses(java.util.Collection progresses)
progresses
- a collection of ITriggerProgress
objects (may not be null
)public long getExpiration()
public void setExpiration(long lExpiration)
lExpiration
- the number of milliseconds between starting a trigger and expiring (0 if not set)public ITimeoutAlgorithm getTimeoutAlgorithm()
public void setTimeoutAlgorithm(ITimeoutAlgorithm timeout)
timeout
- the timeout algorithm (may not be null
)public void setOffset(long lOffset)
lOffset
- the offset in millisecondspublic boolean execute() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the sleep before the trigger was interruptedTrigger.ActionThread
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- the object to compare topublic java.lang.String toString()
toString
in class java.lang.Object
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |