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 are triggers and series.
Since:
taskplanner 3.0
  • Constructor Details

    • SeriesIndependentFactory

      public SeriesIndependentFactory(String extensionName)
      Creates a new SeriesFactory instance.
      Parameters:
      extensionName - unique name for this kind of components
      Since:
      taskplanner 3.0
  • Method Details

    • 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 class AbstractFactory<COMPONENT,DEFINITION extends AbstractDefinition<DEFINITION>,INFO extends AbstractInfo,SUMMARY extends SummaryInfo>
      Parameters:
      definition - the definition to validate
      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.
      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 by TaskPlanner from given definition.
      Parameters:
      definition - holds information about the component to create
      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:
      the created component
      Throws:
      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 Map<String,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 properties
      taskID - 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