Class DefaultRunnable
java.lang.Object
org.ametys.plugins.core.impl.schedule.DefaultRunnable
- All Implemented Interfaces:
Runnable
Implementation of
Runnable
which can be created by the UI.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.schedule.Runnable
Runnable.FireProcess, Runnable.MisfirePolicy
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The CRON expressionprotected boolean
true if it can be deactivatedprotected I18nizableText
The descriptionprotected Runnable.FireProcess
The fire processprotected String
The idprotected I18nizableText
The labelprotected Runnable.MisfirePolicy
The misfire policyprotected boolean
true if it can be editedThe parameter valuesprotected boolean
true if it can be removedprotected String
The id of the linkedSchedulable
protected UserIdentity
UserIdentity should be used to launch the Runnableprotected boolean
true if volatile -
Constructor Summary
ConstructorDescriptionDefaultRunnable
(String id, I18nizableText label, I18nizableText description, Runnable.FireProcess fireProcess, String cron, String schedulableId, boolean removable, boolean modifiable, boolean deactivatable, Runnable.MisfirePolicy misfirePolicy, boolean isVolatile, UserIdentity userIdentity, Map<String, Object> parameters) Constructor -
Method Summary
Modifier and TypeMethodDescriptionReturns the cron expression to base the schedule on.Returns the descriptionGets the process of firing, i.e.getId()
Returns the idgetLabel()
Returns the labelGets the misfire policy, i.e.Gets the values of the parameters (from the linkedSchedulable
)Gets the identifier ofSchedulable
to executeGets the user which should be used to launch the runnable task.boolean
Determines if this runnable can be activate or deactivateboolean
Determines if this runnable can be modifiedboolean
Determines if this runnable can be removedboolean
Determines if the runnable must not survive to a server restart
-
Field Details
-
_id
The id -
_label
The label -
_description
The description -
_fireProcess
The fire process -
_cron
The CRON expression -
_schedulableId
The id of the linkedSchedulable
-
_removable
true if it can be removed -
_modifiable
true if it can be edited -
_deactivatable
true if it can be deactivated -
_parameterValues
The parameter values -
_misfirePolicy
The misfire policy -
_volatile
true if volatile -
_userIdentity
UserIdentity should be used to launch the Runnable
-
-
Constructor Details
-
DefaultRunnable
public DefaultRunnable(String id, I18nizableText label, I18nizableText description, Runnable.FireProcess fireProcess, String cron, String schedulableId, boolean removable, boolean modifiable, boolean deactivatable, Runnable.MisfirePolicy misfirePolicy, boolean isVolatile, UserIdentity userIdentity, Map<String, Object> parameters) Constructor- Parameters:
id
- the idlabel
- the labeldescription
- the descritpionfireProcess
- the fire processcron
- the cron expressionschedulableId
- the id of the linkedSchedulable
removable
- true if it can be removedmodifiable
- true if it can be editeddeactivatable
- true if it can be deactivatedmisfirePolicy
- The misfire policy. Can be null, the default value isRunnable.MisfirePolicy.DO_NOTHING
isVolatile
- true if it is volatile, i.e. if it must not survive to a server restartuserIdentity
- The user used to launch the runnable taskparameters
- the parameter values
-
-
Method Details
-
getId
Description copied from interface:Runnable
Returns the id -
getLabel
Description copied from interface:Runnable
Returns the label -
getDescription
Description copied from interface:Runnable
Returns the description- Specified by:
getDescription
in interfaceRunnable
- Returns:
- the i18n description
-
getFireProcess
Description copied from interface:Runnable
Gets the process of firing, i.e. the way the task will be scheduled (fire now, fire at next stratup, schedule it based on a cron expression...).- Specified by:
getFireProcess
in interfaceRunnable
- Returns:
- the fire process
-
getCronExpression
Description copied from interface:Runnable
Returns the cron expression to base the schedule on. Ignored ifRunnable.getFireProcess()
is different fromRunnable.FireProcess.CRON
.- Specified by:
getCronExpression
in interfaceRunnable
- Returns:
- the cron expression
-
getSchedulableId
Description copied from interface:Runnable
Gets the identifier ofSchedulable
to execute- Specified by:
getSchedulableId
in interfaceRunnable
- Returns:
- the identifier of
Schedulable
-
isRemovable
Description copied from interface:Runnable
Determines if this runnable can be removed- Specified by:
isRemovable
in interfaceRunnable
- Returns:
true
if this runnable is removable
-
isModifiable
Description copied from interface:Runnable
Determines if this runnable can be modified- Specified by:
isModifiable
in interfaceRunnable
- Returns:
true
if this runnable is modifiable
-
isDeactivatable
Description copied from interface:Runnable
Determines if this runnable can be activate or deactivate- Specified by:
isDeactivatable
in interfaceRunnable
- Returns:
true
if this runnable is deactivatable
-
getMisfirePolicy
Description copied from interface:Runnable
Gets the misfire policy, i.e. what the runnable must do if it missed a trigger. Ignored ifRunnable.getFireProcess()
is different fromRunnable.FireProcess.CRON
.- Specified by:
getMisfirePolicy
in interfaceRunnable
- Returns:
- The misfire policy
-
isVolatile
Description copied from interface:Runnable
Determines if the runnable must not survive to a server restart- Specified by:
isVolatile
in interfaceRunnable
- Returns:
- true if the runnable must not survive to a server restart
-
getParameterValues
Description copied from interface:Runnable
Gets the values of the parameters (from the linkedSchedulable
)- Specified by:
getParameterValues
in interfaceRunnable
- Returns:
- the parameter values
-
getUserIdentity
Description copied from interface:Runnable
Gets the user which should be used to launch the runnable task.- Specified by:
getUserIdentity
in interfaceRunnable
- Returns:
- the
UserIdentity
of the user
-