Class TriggerDefinition
java.lang.Object
com.inet.taskplanner.server.api.common.AbstractDefinition<TriggerDefinition>
com.inet.taskplanner.server.api.trigger.TriggerDefinition
Defines a configured trigger for a task with its settings. A trigger is responsible for initiating execution of a
task, for example at a certain time or when an event occurs.
TriggerDefinition——extensionName—⟶TriggerFactory——createFrom()—⟶Trigger
To map from a TriggerDefinition to a TriggerFactory the method AbstractDefinition.getExtensionName() has to return a name
for which a TriggerFactory is registered in the ServerPluginManager.
This definition also includes settings for the trigger, i.e. the start date and cycle for a time trigger.
The extension name and the valid properties are usually defined and documented in the corresponding TriggerFactory.
It is recommended to use Builders to create TriggerDefinitions.
- Since:
- taskplanner 3.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTriggerDefinition(String extensionName) Creates a new TriggerDefinition instance.TriggerDefinition(String extensionName, Map<String, String> properties) Creates a new TriggerDefinition instance. -
Method Summary
Modifier and TypeMethodDescriptionMakes a deep copy of this definition.Gets summary information about this trigger.Methods inherited from class AbstractDefinition
copyDefinitions, equals, getExtensionName, getProperties, getProperty, getUid, hashCode, removeProperty, setProperty, setUid
-
Constructor Details
-
TriggerDefinition
Creates a new TriggerDefinition instance.- Parameters:
extensionName- the unique name for this kind of trigger. For example, you can pass one of the predefined triggerFileChangeTriggerFactory.EXTENSION_NAMEorTimeTriggerFactory.EXTENSION_NAME- Since:
- taskplanner 3.0
-
TriggerDefinition
Creates a new TriggerDefinition instance.- Parameters:
extensionName- the unique name for this kind of trigger. For example, you can pass one of the predefined triggerFileChangeTriggerFactory.EXTENSION_NAMEorTimeTriggerFactory.EXTENSION_NAMEproperties- the initial properties to be set,nullwill have no effect- Since:
- taskplanner 3.0
-
-
Method Details
-
copyDefinition
Makes a deep copy of this definition.- Specified by:
copyDefinitionin classAbstractDefinition<TriggerDefinition>- Returns:
- a deep copy of this definition.
-
getSummary
Gets summary information about this trigger.These summary lines are shown in the web GUI.
- Returns:
- summary information, or null if the
TriggerFactoryimplementation decides to return null - Throws:
IllegalStateException- if no correspondingTriggerFactoryis registered- Since:
- taskplanner 3.0
- See Also:
-