Class ResultActionFactory<T extends ResultAction>
- java.lang.Object
-
- com.inet.taskplanner.server.api.common.AbstractFactory<COMPONENT,DEFINITION,INFO,SUMMARY>
-
- com.inet.taskplanner.server.api.common.SeriesDependentFactory<T,ResultActionDefinition,ResultActionInfo,SummaryInfo>
-
- com.inet.taskplanner.server.api.action.ResultActionFactory<T>
-
- Type Parameters:
T
- the concrete type of the Job implementation
- All Implemented Interfaces:
com.inet.plugin.NamedExtension
- Direct Known Subclasses:
EmailResultActionFactory
public abstract class ResultActionFactory<T extends ResultAction> extends SeriesDependentFactory<T,ResultActionDefinition,ResultActionInfo,SummaryInfo>
Base class for factories producingResultAction
components.ResultActionDefinition
----> ResultActionFactory ---->ResultAction
See documentation of
AbstractFactory
for more information about the life cycle.When a factory is implemented, use
ServerPluginManager.register(Class, Object)
withResultActionFactory
.class as first argument:spm.register(ResultActionFactory.class, new RabbitActionFactory());
Implementations sample: because the extensionName must be unique and must be used when a
ResultActionDefinition
is created by API, it is recommended to set up a public constant with the extensionName:
public class RabbitActionFactory extends RabbitActionFactory<RabbitAction> { public static final String EXTENSION_NAME = "resultAction.rabbit"; public RabbitActionFactory(){ super(EXTENSION_NAME); } @Override protected RabbitAction createInstanceFrom( ResultActionDefinition definition, GUID taskID ) { RabbitAction action = new RabbitAction(); //put values from definition to RabbitAction impl ... return action; } ... //somewhere using public API ResultActionDefinition rabbitAction = new ResultActionDefinition(RabbitActionFactory.EXTENSION_NAME); //configure it ...
- Since:
- taskplanner 3.0
-
-
Field Summary
-
Fields inherited from class com.inet.taskplanner.server.api.common.SeriesDependentFactory
PLACEHOLDER_END_CHARACTER, PLACEHOLDER_START_CHARACTER
-
-
Constructor Summary
Constructors Constructor Description ResultActionFactory(java.lang.String extensionName)
Creates a new ResultActionFactory instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.List<ResultFlavor>
getSupportedFlavors(ResultActionDefinition definition)
Returns the list of flavors, supported by this action for the given definition.boolean
hasPlaceholderSet(java.lang.String value, com.inet.id.GUID taskID)
Returns whether the given value contains at least one of the available placeholders of the task.boolean
isAutoResolvePlaceholders()
Defines whether placeholders will be automatically replaced before the handle method is called.-
Methods inherited from class com.inet.taskplanner.server.api.common.SeriesDependentFactory
createFrom, getFirstValueFromSeries, patchDefinitionProperties, updateValues, updateValues, validate
-
Methods inherited from class com.inet.taskplanner.server.api.common.AbstractFactory
checkDefinitionArgument, createInstanceFrom, createInstanceFrom, getExtensionName, getInformation, getSummary, isAvailable, validate
-
-
-
-
Constructor Detail
-
ResultActionFactory
public ResultActionFactory(java.lang.String extensionName)
Creates a new ResultActionFactory instance.- Parameters:
extensionName
- the unique name of the ResultAction this factory can produce.ResultActionDefinitions
for this kind of action must have the same extensionName.- Since:
- taskplanner 3.0
-
-
Method Detail
-
getSupportedFlavors
public abstract java.util.List<ResultFlavor> getSupportedFlavors(ResultActionDefinition definition)
Returns the list of flavors, supported by this action for the given definition.- Parameters:
definition
- the current definition settings- Returns:
- the list of result flalvors that are currently supported according to the given definition.
- Since:
- taskplanner 3.0
-
isAutoResolvePlaceholders
public boolean isAutoResolvePlaceholders()
Defines whether placeholders will be automatically replaced before the handle method is called. The default implementation returnstrue
.
The automatic replacement will ask all fields, defined by the factory, to resolve all placeholders that match a field key and supports placeholders.
For manual replacement, thePlaceholderResolver
can be used.- Returns:
true
if the placeholders shall be resolve automatically,false
if the implementation needs to manage this by themself.- Since:
- taskplanner 3.0
-
hasPlaceholderSet
public boolean hasPlaceholderSet(java.lang.String value, com.inet.id.GUID taskID)
Returns whether the given value contains at least one of the available placeholders of the task.- Parameters:
value
- the value to be checked for placeholderstaskID
- the unique ID of the task containing the current action- Returns:
- true if the value contains at least one placeholder, false otherwise
- Since:
- taskplanner 3.0
-
-