Class ToggleSyncEdge
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.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.
-
-
Constructor Summary
Constructors Constructor Description ToggleSyncEdge()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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.static boolean
isPossible(Template template, Node pred, Node succ)
Check, if a sync edge between the given nodes is possible (concerning structural correctness).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.static void
performOperation(SessionToken session, ChangeableInstance instance, Node pred, Node succ)
Deletes the sync edge in the instance if there already exists one.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.static void
performOperation(SessionToken session, ChangeableTemplate template, Node pred, Node succ)
Deletes the sync edge in the template if there already exists one.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.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.
-
-
-
Field Detail
-
logger
protected static final Logger logger
a Logger
-
-
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 toggledpred
- the source of the sync-edgesucc
- 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 toggledpred
- the source of the sync-edgesucc
- the target of the sync-edgecheckReport
- 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 toggledpred
- the source of the sync-edgesucc
- 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 toggledpred
- the source of the sync-edgesucc
- the target of the sync-edgecheckReport
- 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 toggledpred
- the source of the sync-edgesucc
- 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 toggledpred
- the source of the sync-edgesucc
- the target of the sync-edgeupdateManager
- 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 toggledpred
- the source of the sync-edgesucc
- 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 toggledpred
- the source of the sync-edgesucc
- the target of the sync-edgeupdateManager
- 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 ChangeableInstancepred
- the source of the sync-edgesucc
- the target of the sync-edgeupdateManager
- The UpdateManager where modifications are logged, may be null
-
-