Class FileChangeTriggerFactory
- All Implemented Interfaces:
com.inet.plugin.NamedExtension
- Since:
- taskplanner 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringExtension name of the file change trigger to use intriggerDefinitions.static final StringKey of the property which holds the path to the file to observe.static final StringKey of the property which holds the path to the folder to observe.static final StringKey of the property that determines whether a file or a folder must be observed.static final StringObserve a file and trigger if that file is created, deleted or modified.static final StringObserves a folder and triggers if files in that folder change or the folder itself changes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.inet.taskplanner.server.api.trigger.filechange.FileChangeTriggercreateInstanceFrom(TriggerDefinition definition, com.inet.id.GUID taskID) Constructs a component (PRODUCT) from the given definition.getInformation(com.inet.id.GUID taskID) Returns an information object about components which can be produced with this factory.static @Nullable StringgetPathOutOfDef(TriggerDefinition definition) Gets path out of trigger definition.getSummary(TriggerDefinition definition) Constructs summary information for the component represented by the given definition.booleanWhether the (COMPONENT) is available or not.voidvalidate(TriggerDefinition triggerDefinition, com.inet.id.GUID taskID) Validate the given definition.Methods inherited from class TriggerFactory
getNextExecutionTimesMethods inherited from class SeriesIndependentFactory
createFrom, updateValuesMethods inherited from class AbstractFactory
checkDefinitionArgument, createInstanceFrom, getExtensionName, getInformation, getKeywords, isSupportedForSystemTasks
-
Field Details
-
EXTENSION_NAME
Extension name of the file change trigger to use intriggerDefinitions.- See Also:
-
PROPERTY_TYPE
Key of the property that determines whether a file or a folder must be observed. Values can beVALUE_FILEorVALUE_FOLDER- See Also:
-
VALUE_FILE
Observe a file and trigger if that file is created, deleted or modified.- See Also:
-
VALUE_FOLDER
Observes a folder and triggers if files in that folder change or the folder itself changes.- See Also:
-
PROPERTY_FILE_PATH
Key of the property which holds the path to the file to observe.- See Also:
-
PROPERTY_FOLDER_PATH
Key of the property which holds the path to the folder to observe.- See Also:
-
-
Constructor Details
-
FileChangeTriggerFactory
public FileChangeTriggerFactory()Creates a file-change trigger factory instance.- Since:
- taskplanner 3.0
-
-
Method Details
-
createInstanceFrom
protected com.inet.taskplanner.server.api.trigger.filechange.FileChangeTrigger createInstanceFrom(TriggerDefinition definition, com.inet.id.GUID taskID) Constructs a component (PRODUCT) from the given definition.- Overrides:
createInstanceFromin classAbstractFactory<com.inet.taskplanner.server.api.trigger.filechange.FileChangeTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
definition- the definition holding information for the PRODUCTtaskID- the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.- Returns:
- a new PRODUCT
-
getInformation
Returns an information object about components which can be produced with this factory.The returned info contains information about how such a component is to be presented in the Task Planner web GUI. This includes display information and available configuration options. The returned information contains
fieldsthat describe the values a user can specify in the web GUI. The fields are also responsible for replacing placeholders for the corresponding property in aserialtask. That means properties without a field definition will not get any series placeholder replaced.If you implement a factory for a component used only through the API, you can return null here.
- Specified by:
getInformationin classAbstractFactory<com.inet.taskplanner.server.api.trigger.filechange.FileChangeTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
taskID- the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.- Returns:
- an information object for components this factory can produce
-
validate
public void validate(TriggerDefinition triggerDefinition, com.inet.id.GUID taskID) throws ValidationException Validate the given definition.The given definition is guaranteed to belong to this factory
- Specified by:
validatein classSeriesIndependentFactory<com.inet.taskplanner.server.api.trigger.filechange.FileChangeTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
triggerDefinition- the definition to validatetaskID- the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.- Throws:
IllegalArgumentException- if given definition is null.ValidationException- if the component has some errors
-
getPathOutOfDef
Gets path out of trigger definition.- Parameters:
definition- definition of the trigger.- Returns:
- path from the trigger definition. May be null.
- Throws:
IllegalArgumentException- if the definition is null- Since:
- taskplanner 3.0
-
getSummary
Constructs summary information for the component represented by the given definition.The summary information is used when the web GUI displays the component.
When implementing a factory for a component to be used only through the API, you can return null here.
- Specified by:
getSummaryin classAbstractFactory<com.inet.taskplanner.server.api.trigger.filechange.FileChangeTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
definition- the definition with the settings made by a user- Returns:
- summary information containing text lines to be displayed in the web GUI for this component.
-
isAvailable
public boolean isAvailable()Whether the (COMPONENT) is available or not.- Overrides:
isAvailablein classAbstractFactory<com.inet.taskplanner.server.api.trigger.filechange.FileChangeTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Returns:
- whether the (COMPONENT) is available or not
-