Class SeriesIndependentFactory<COMPONENT,DEFINITION extends AbstractDefinition<DEFINITION>,INFO extends AbstractInfo,SUMMARY extends SummaryInfo>
- java.lang.Object
-
- com.inet.taskplanner.server.api.common.AbstractFactory<COMPONENT,DEFINITION,INFO,SUMMARY>
-
- com.inet.taskplanner.server.api.common.SeriesIndependentFactory<COMPONENT,DEFINITION,INFO,SUMMARY>
-
- All Implemented Interfaces:
com.inet.plugin.NamedExtension
- Direct Known Subclasses:
SeriesFactory
,TriggerFactory
public abstract class SeriesIndependentFactory<COMPONENT,DEFINITION extends AbstractDefinition<DEFINITION>,INFO extends AbstractInfo,SUMMARY extends SummaryInfo> extends AbstractFactory<COMPONENT,DEFINITION,INFO,SUMMARY>
Base class for component factories whose properties does not depend on the properties of a possibly configured series. Those aretriggers
andseries
.- Since:
- taskplanner 3.0
-
-
Constructor Summary
Constructors Constructor Description SeriesIndependentFactory(java.lang.String extensionName)
Creates a new SeriesFactory instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description COMPONENT
createFrom(DEFINITION definition, com.inet.id.GUID taskID)
Creates a concrete object to be used byTaskPlanner
from given definition.java.util.Map<java.lang.String,java.lang.String>
updateValues(DEFINITION definition, com.inet.id.GUID taskID)
Update values according to the give definition.abstract void
validate(DEFINITION definition, com.inet.id.GUID taskID)
Validate the given definition.-
Methods inherited from class com.inet.taskplanner.server.api.common.AbstractFactory
checkDefinitionArgument, createInstanceFrom, createInstanceFrom, getExtensionName, getInformation, getSummary, isAvailable
-
-
-
-
Method Detail
-
validate
public abstract void validate(@Nonnull DEFINITION definition, com.inet.id.GUID taskID) throws ValidationException
Validate the given definition.The given definition is guaranteed to belong to this factory
- Specified by:
validate
in classAbstractFactory<COMPONENT,DEFINITION extends AbstractDefinition<DEFINITION>,INFO extends AbstractInfo,SUMMARY extends SummaryInfo>
- Parameters:
definition
- 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:
ValidationException
- if the component has some errors
-
createFrom
public final COMPONENT createFrom(DEFINITION definition, @Nullable com.inet.id.GUID taskID)
Creates a concrete object to be used byTaskPlanner
from given definition.- Parameters:
definition
- holds information about the component to createtaskID
- 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:
- the created component
- Throws:
java.lang.IllegalArgumentException
- if definition is null or the definition's extension name does not match this factory's extension name.- Since:
- taskplanner 3.0
-
updateValues
public java.util.Map<java.lang.String,java.lang.String> updateValues(@Nonnull DEFINITION definition, com.inet.id.GUID taskID)
Update values according to the give definition.The given definition is guaranteed to belong to this factory
- Parameters:
definition
- the definition with the current propertiestaskID
- the ID of the task the definition belongs or will belong to, for optional use- Returns:
- a map of property key with their values that have changed
- Since:
- taskplanner 3.0
-
-