Class DefaultTriggerService
- java.lang.Object
-
- de.hybris.platform.servicelayer.cronjob.impl.DefaultTriggerService
-
- All Implemented Interfaces:
TriggerService
public class DefaultTriggerService extends java.lang.Object implements TriggerService
Default implementation of the trigger service.- Since:
- 4.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultTriggerService.Mode
-
Field Summary
Fields Modifier and Type Field Description static intIGNORE_VALUEignored value for time, interval, max acceptable waits
-
Constructor Summary
Constructors Constructor Description DefaultTriggerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(TriggerModel trigger)Executes the assignedJobModelusing the assignedCronJobModelif the next activation time ((@link TriggerModel#getActivationTime()} is less or equal than the current system time.booleanactivateForTest(TriggerModel trigger, long currentTime)java.util.List<TriggerModel>getActiveTriggers()Returns aListof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the current system time.java.util.List<TriggerModel>getActiveTriggers(java.util.Calendar calendar)Returns aListof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the specified calendar date.protected java.util.Map<java.lang.String,java.lang.String>getConfigAttributes()java.util.CalendargetNextTime(TriggerModel trigger, java.util.Calendar relativeTo)Returns the next activation time for theTriggerModelin relation to the specified calendar.intgetPulseSeconds()Returns a time interval at which trigger activation is fired.voidsetCronJobService(CronJobService cronJobService)voidsetI18NService(I18NService i18nService)voidsetModelService(ModelService modelService)voidsetPulseSeconds(int interval)Sets a time interval at which trigger activation is fired.voidsetSessionService(SessionService sessionService)voidsetTriggerDao(TriggerDao triggerDao)
-
-
-
Field Detail
-
IGNORE_VALUE
public static final int IGNORE_VALUE
ignored value for time, interval, max acceptable waits- See Also:
- Constant Field Values
-
-
Method Detail
-
setCronJobService
public void setCronJobService(CronJobService cronJobService)
-
setModelService
public void setModelService(ModelService modelService)
-
setTriggerDao
public void setTriggerDao(TriggerDao triggerDao)
-
setI18NService
public void setI18NService(I18NService i18nService)
-
setSessionService
public void setSessionService(SessionService sessionService)
-
activateForTest
public boolean activateForTest(TriggerModel trigger, long currentTime)
-
activate
public void activate(TriggerModel trigger)
Description copied from interface:TriggerServiceExecutes the assignedJobModelusing the assignedCronJobModelif the next activation time ((@link TriggerModel#getActivationTime()} is less or equal than the current system time.- Specified by:
activatein interfaceTriggerService- Parameters:
trigger- the trigger instance
-
getConfigAttributes
protected java.util.Map<java.lang.String,java.lang.String> getConfigAttributes()
-
getNextTime
public java.util.Calendar getNextTime(TriggerModel trigger, java.util.Calendar relativeTo)
Description copied from interface:TriggerServiceReturns the next activation time for theTriggerModelin relation to the specified calendar.Use this method e.g. for different first day of week modes.
- Specified by:
getNextTimein interfaceTriggerService- Parameters:
trigger- the trigger instancerelativeTo- the calendar which the next activation time should be calculated relatively for- Returns:
- the next activation time(
Calendar) for theTriggerModelin relation to the specified time
-
getActiveTriggers
public java.util.List<TriggerModel> getActiveTriggers()
Description copied from interface:TriggerServiceReturns aListof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the current system time.- Specified by:
getActiveTriggersin interfaceTriggerService- Returns:
- a
Listof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)is smaller than current system time
-
getActiveTriggers
public java.util.List<TriggerModel> getActiveTriggers(java.util.Calendar calendar)
Description copied from interface:TriggerServiceReturns aListof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the specified calendar date.- Specified by:
getActiveTriggersin interfaceTriggerService- Parameters:
calendar- the calendar- Returns:
- a
Listof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the specified calendar date
-
getPulseSeconds
public int getPulseSeconds()
Description copied from interface:TriggerServiceReturns a time interval at which trigger activation is fired. See cronjob.trigger.interval' property- Specified by:
getPulseSecondsin interfaceTriggerService
-
setPulseSeconds
public void setPulseSeconds(int interval)
Description copied from interface:TriggerServiceSets a time interval at which trigger activation is fired. See cronjob.trigger.interval' property .- Specified by:
setPulseSecondsin interfaceTriggerService
-
-