Class AddSystemDataFlow

java.lang.Object
de.aristaflow.adept2.core.changeoperations.AddSystemDataFlow

public class AddSystemDataFlow extends Object
Change operation for adding a system data flow. Call isPossible first to check if the operation is valid, than call perform operation to execute the change TODO Refactor; use a common interface for change operations.
  • Field Details

    • logger

      protected static final Logger logger
      a Logger
  • Constructor Details

    • AddSystemDataFlow

      public AddSystemDataFlow()
  • Method Details

    • isPossible

      public static boolean isPossible(Template template, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, String inputParameterName)
      Check if it is possible (concerning structural correctness) to add a system data flow between the given nodes.
      Parameters:
      template - The corresponding template
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      inputParameterName - the name of the parameter which must exist in the the consumer node
      Returns:
      True, if possible.
    • isPossible

      public static boolean isPossible(Template template, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, String inputParameterName, CheckReport checkReport)
      Check if it is possible (concerning structural correctness) to add a system data flow of the given type between the given nodes. If it is not possible the reasons are stored in the checkReport.
      Parameters:
      template - The corresponding template
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      inputParameterName - the name of the parameter which must exist in the the consumer node
      checkReport - a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null
      Returns:
      True, if possible.
    • isPossible

      protected static boolean isPossible(Template template, int prodNodeId, SystemDataProducer systemDataType, int consNodeId, CheckReport checkReport)
      Check if it is possible (concerning structural correctness) to add a system data flow of the given type between the given nodes. Note: This method is for internal use only, because it ignores if the node already has a parameter where the data flow can be connected with. If it is not possible the reasons are stored in the checkReport.
      Parameters:
      template - The corresponding template
      prodNodeId - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consNodeId - the node which consumes the system parameter.
      checkReport - a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null
      Returns:
      True, if possible.
    • isPossible

      public static boolean isPossible(Instance instance, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, String inputParameterName)
      Check if it is possible (concerning structural correctness and state based correctness) to add a system data flow of the given type between the given nodes.
      Parameters:
      instance - The corresponding instance
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      inputParameterName - the name of the parameter which must exist in the the consumer node
      Returns:
      True, if possible.
    • isPossible

      public static boolean isPossible(Instance instance, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, String inputParameterName, CheckReport checkReport)
      Check if it is possible (concerning structural correctness and state based correctness) to add a system data flow of the given type between the given nodes. If it is not possible the reasons are stored in the checkReport.
      Parameters:
      instance - The corresponding changeable instance
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      inputParameterName - the name of the parameter which must exist in the the consumer node
      checkReport - a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null
      Returns:
      True, if possible.
    • isPossible

      protected static boolean isPossible(Instance instance, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, CheckReport checkReport)
      Check if it is possible (concerning structural correctness and state based correctness) to add a system data flow of the given type between the given nodes. Note: This method is for internal use only, because it ignores if the node already has a parameter where the data flow can be connected with.
      Parameters:
      instance - The corresponding changeable instance
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      checkReport - a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null
      Returns:
      True, if possible.
    • performOperation

      public static void performOperation(SessionToken session, ChangeableTemplate template, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, String inputParameterName)
      Adds a system data flow of the given type between the given nodes.
      Parameters:
      session - The session which is used to check for access rights on this method.
      template - The related changeable template.
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      inputParameterName - the name of the parameter which must exist in the the consumer node
    • performOperation

      public static void performOperation(SessionToken session, ChangeableTemplate template, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, String inputParameterName, UpdateManager updateManager)
      Adds a system data flow of the given type between the given nodes. (Operation with updateManager)
      Parameters:
      session - The session which is used to check for access rights on this method.
      template - The related changeable template.
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      inputParameterName - the name of the parameter which must exist in the the consumer node
      updateManager - The UpdateManager where modifications are logged, may be null
    • performOperation

      public static void performOperation(SessionToken session, ChangeableInstance instance, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, String inputParameterName)
      Adds a system data flow of the given type between the given nodes in the given instance.
      Parameters:
      session - The session which is used to check for access rights on this method.
      instance - The related changeable instance.
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      inputParameterName - the name of the parameter which must exist in the the consumer node
    • performOperation

      public static void performOperation(SessionToken session, ChangeableInstance instance, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, String inputParameterName, UpdateManager updateManager)
      Adds a system data flow of the given type between the given nodes in the given instance. (Operation with updateManager)
      Parameters:
      session - The session which is used to check for access rights on this method.
      instance - The related changeable instance.
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      inputParameterName - the name of the parameter which must exist in the the consumer node
      updateManager - the manager which is responsible for the graphical adaptation of the template (maybe null)
    • performOperation

      protected static void performOperation(SessionToken session, ChangePrimitives processGraph, int producerNodeID, SystemDataProducer systemDataType, int consumerNodeID, String inputParameterName, UpdateManager updateManager)
      Worker method to do the structural changes for both changeable templates and changeable instances.
      Parameters:
      session - The session which is used to check for access rights on this method.
      processGraph - an instance of type ChangeableTemplate or ChangeableInstance
      producerNodeID - the node which produces the system parameter.
      systemDataType - the type of the system data SystemDataProducer
      consumerNodeID - the node which consumes the system parameter.
      inputParameterName - the name of the parameter which must exist in the the consumer node
      updateManager - the manager which is responsible for the graphical adaptation of the template (maybe null)