Class ToggleSyncEdge


  • public class ToggleSyncEdge
    extends Object
    Change operation, which allows toggling sync-edges between nodes of parallel branches. Call isPossible first to check if the sync-edge-toggling is valid, than call perform operation to execute the change. TODO Refactor; use a common interface for change operations.
    • Field Detail

      • logger

        protected static final Logger logger
        a Logger
    • Constructor Detail

      • ToggleSyncEdge

        public ToggleSyncEdge()
    • Method Detail

      • isPossible

        public static boolean isPossible​(Template template,
                                         Node pred,
                                         Node succ)
        Check, if a sync edge between the given nodes is possible (concerning structural correctness). TODO use topological sorting!
        Parameters:
        template - where the sync-edge should be toggled
        pred - the source of the sync-edge
        succ - the target of the sync-edge
        Returns:
        True, if there can be a sync edge between the given nodes.
      • isPossible

        public static boolean isPossible​(Template template,
                                         Node pred,
                                         Node succ,
                                         CheckReport checkReport)
        Check, if a sync edge between the given nodes is possible (concerning structural correctness) in the template. TODO use topological sorting!
        Parameters:
        template - the template where the sync-edge should be toggled
        pred - the source of the sync-edge
        succ - the target of the sync-edge
        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 there can be a sync edge between the given nodes.
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         Node pred,
                                         Node succ)
        Check, if a sync edge between the given nodes is possible (concerning structural and state-based correctness) in the instance. TODO use topological sorting!
        Parameters:
        instance - the changeable instance where the sync-edge should be toggled
        pred - the source of the sync-edge
        succ - the target of the sync-edge
        Returns:
        True, if there can be a sync edge between the given nodes.
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         Node pred,
                                         Node succ,
                                         CheckReport checkReport)
        Check, if a sync edge between the given nodes is possible (concerning structural and state-based correctness)in the instance. If it is not possible the reasons are stored in the check report. TODO use topological sorting!
        Parameters:
        instance - the changeable instance where the sync-edge should be toggled
        pred - the source of the sync-edge
        succ - the target of the sync-edge
        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 there can be a sync edge between the given nodes.
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableTemplate template,
                                            Node pred,
                                            Node succ)
        Deletes the sync edge in the template if there already exists one. Otherwise a new sync edge is created. Perform the operation w/o an update manager.
        Parameters:
        session - The session which is used to check for access rights on this method.
        template - the template where the sync-edge is toggled
        pred - the source of the sync-edge
        succ - the target of the sync-edge
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableTemplate template,
                                            Node pred,
                                            Node succ,
                                            UpdateManager updateManager)
        Deletes the sync edge in the template if there already exists one. Otherwise a new sync edge is created
        Parameters:
        session - The session which is used to check for access rights on this method.
        template - the template where the sync-edge is toggled
        pred - the source of the sync-edge
        succ - the target of the sync-edge
        updateManager - The UpdateManager where modifications are logged, may be null
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableInstance instance,
                                            Node pred,
                                            Node succ)
        Deletes the sync edge in the instance if there already exists one. Otherwise a new sync edge is created. Perform the operation w/o an update manager.
        Parameters:
        session - The session which is used to check for access rights on this method.
        instance - the changeable instance where the sync-edge is toggled
        pred - the source of the sync-edge
        succ - the target of the sync-edge
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableInstance instance,
                                            Node pred,
                                            Node succ,
                                            UpdateManager updateManager)
        Deletes the sync edge in the instance if there already exists one. Otherwise a new sync edge is created
        Parameters:
        session - The session which is used to check for access rights on this method.
        instance - the instance where the sync-edge is toggled
        pred - the source of the sync-edge
        succ - the target of the sync-edge
        updateManager - The UpdateManager where modifications are logged, may be null
      • performOperation

        protected static void performOperation​(SessionToken session,
                                               ChangePrimitives processGraph,
                                               Node pred,
                                               Node succ,
                                               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
        pred - the source of the sync-edge
        succ - the target of the sync-edge
        updateManager - The UpdateManager where modifications are logged, may be null