Class UpdatePluginDataContainer
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.UpdatePluginDataContainer
-
public class UpdatePluginDataContainer extends Object
Change Operation to update a plug in data container. This operation allows to update, add and to remove plug in data for a plug in data container. Call isPossible first to check if the update is valid, than call perform operation to execute the change. TODO Refactor; use a common interface for change operations.
-
-
Constructor Summary
Constructors Constructor Description UpdatePluginDataContainer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(ChangeableInstance instance, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData)
Checks if it is valid (concerning structural correctness and state-based correctness) to update (add / remove) the plug in data for the Extension-Point given byextensionPoint
with the value given bypluginData
in the plug in data container given bypluginContainer
.static boolean
isPossible(ChangeableInstance instance, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, CheckReport checkReport)
Checks if it is valid (concerning structural correctness and state-based correctness) to update (add / remove) the plug in data for the Extension-Point given byextensionPoint
with the value given bypluginData
in the plug in data container given bypluginContainer
.static boolean
isPossible(Template template, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData)
Checks if it is valid (concerning structural correctness) to update (add / remove) the plug in data for the Extension-Point given byextensionPoint
with the value given bypluginData
in the plug in data container given bypluginContainer
.static boolean
isPossible(Template template, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, CheckReport checkReport)
Checks if it is valid (concerning structural correctness) to update (add / remove) the plug in data for the Extension-Point given byextensionPoint
with the value given bypluginData
in the plug in data container given bypluginContainer
.static void
performOperation(ChangeableInstance instance, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData)
Updates the plug in data for the extension point in the given plug in data container.static void
performOperation(ChangeableInstance instance, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, UpdateManager updateManager)
Updates the plug in data for the extension point in the given plug in data container.static void
performOperation(ChangeableTemplate template, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData)
Updates the plug in data for the extension point in the given plug in data container.static void
performOperation(ChangeableTemplate template, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, UpdateManager updateManager)
Updates the plug in data for the extension point in the given plug in data container.protected static void
performOperation(ChangePrimitives processGraph, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, 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, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData)
Checks if it is valid (concerning structural correctness) to update (add / remove) the plug in data for the Extension-Point given byextensionPoint
with the value given bypluginData
in the plug in data container given bypluginContainer
. A value of null forpluginData
signals that the plug in with the given plug in ID should be removed (remove). If the container already contains the given plug in for the given extension point, the already existent pluginData is replaced with the given pluginData (update). If it does not exist the pluginData is added to the given extension point (add).- Parameters:
template
- the related templatepluginContainer
- the plug in container object where the method is performed onextensionPointID
- the extension point ID where the plug in data should be updated (added/removed)name
pluginDataID
- the ID of the plug in datapluginData
- the object which holds the pluginData or null to remove from the extension point- Returns:
- true if the update is valid
-
isPossible
public static boolean isPossible(Template template, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, CheckReport checkReport)
Checks if it is valid (concerning structural correctness) to update (add / remove) the plug in data for the Extension-Point given byextensionPoint
with the value given bypluginData
in the plug in data container given bypluginContainer
. A value of null forpluginData
signals that the plug in with the given plug in ID should be removed (remove). If the container already contains the given plug in for the given extension point, the already existent pluginData is replaced with the given pluginData (update). If it does not exist the pluginData is added to the given extension point (add). If it is not possible the reasons are stored in the checkReport.- Parameters:
template
- the related templatepluginContainer
- the plug in container object where the method is performed onextensionPointID
- the extension point ID where the plug in data should be updated (added/removed)name
pluginDataID
- the ID of the plug in datapluginData
- the object which holds the pluginData or null to remove from the extension pointcheckReport
- 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 the update is valid
-
isPossible
public static boolean isPossible(ChangeableInstance instance, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData)
Checks if it is valid (concerning structural correctness and state-based correctness) to update (add / remove) the plug in data for the Extension-Point given byextensionPoint
with the value given bypluginData
in the plug in data container given bypluginContainer
. A value of null forpluginData
signals that the plug in with the given plug in ID should be removed (remove). If the container already contains the given plug in for the given extension point, the already existent pluginData is replaced with the given pluginData (update). If it does not exist the pluginData is added to the given extension point (add).- Parameters:
instance
- the related instancepluginContainer
- the plug in container object where the method is performed onextensionPointID
- the extension point ID where the plug in data should be updated (added/removed)name
pluginDataID
- the ID of the plug in datapluginData
- the object which holds the pluginData or null to remove from the extension point- Returns:
- true if the update is valid
-
isPossible
public static boolean isPossible(ChangeableInstance instance, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, CheckReport checkReport)
Checks if it is valid (concerning structural correctness and state-based correctness) to update (add / remove) the plug in data for the Extension-Point given byextensionPoint
with the value given bypluginData
in the plug in data container given bypluginContainer
. A value of null forpluginData
signals that the plug in with the given plug in ID should be removed (remove). If the container already contains the given plug in for the given extension point, the already existent pluginData is replaced with the given pluginData (update). If it does not exist the pluginData is added to the given extension point (add). If it is not possible the reasons are stored in the checkReport.- Parameters:
instance
- the related instancepluginContainer
- the plug in container object where the method is performed onextensionPointID
- the extension point ID where the plug in data should be updated (added/removed)name
pluginDataID
- the ID of the plug in datapluginData
- the object which holds the pluginData or null to remove from the extension pointcheckReport
- 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 the update is valid
-
performOperation
public static void performOperation(ChangeableTemplate template, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData)
Updates the plug in data for the extension point in the given plug in data container. A value of null forpluginData
signals that the plug in with the given plug in ID should be removed (remove). If the container already contains the given plug in for the given extension point, the already existent pluginData is replaced with the given pluginData (update). If it does not exist the pluginData is added to the given extension point (add). Plug in data containers are e.g. Node, ...- Parameters:
template
- the related changeable templatepluginContainer
- the plug in container object where the method is performed onextensionPointID
- the extension point ID where the plug in data should be updated (added/removed)name
pluginDataID
- the ID of the plug in datapluginData
- the object which holds the pluginData or null to remove from the extension point.
-
performOperation
public static void performOperation(ChangeableTemplate template, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, UpdateManager updateManager)
Updates the plug in data for the extension point in the given plug in data container. A value of null forpluginData
signals that the plug in with the given plug in ID should be removed (remove). If the container already contains the given plug in for the given extension point, the already existent pluginData is replaced with the given pluginData (update). If it does not exist the pluginData is added to the given extension point (add). Plug in data containers are e.g. Node, ...- Parameters:
template
- the related changeable templatepluginContainer
- the plug in container object where the method is performed onextensionPointID
- the extension point ID where the plug in data should be updated (added/removed)name
pluginDataID
- the ID of the plug in datapluginData
- the object which holds the pluginData or null to remove from the extension point.updateManager
- The UpdateManager where modifications are logged, may be null
-
performOperation
public static void performOperation(ChangeableInstance instance, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData)
Updates the plug in data for the extension point in the given plug in data container. A value of null forpluginData
signals that the plug in with the given plug in ID should be removed (remove). If the container already contains the given plug in for the given extension point, the already existent pluginData is replaced with the given pluginData (update). If it does not exist the pluginData is added to the given extension point (add). Plug in data containers are e.g. Node, ...- Parameters:
instance
- the related changeable instancepluginContainer
- the plug in container object where the method is performed onextensionPointID
- the extension point ID where the plug in data should be updated (added/removed)name
pluginDataID
- the ID of the plug in datapluginData
- the object which holds the pluginData or null to remove from the extension point.
-
performOperation
public static void performOperation(ChangeableInstance instance, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, UpdateManager updateManager)
Updates the plug in data for the extension point in the given plug in data container. A value of null forpluginData
signals that the plug in with the given plug in ID should be removed (remove). If the container already contains the given plug in for the given extension point, the already existent pluginData is replaced with the given pluginData (update). If it does not exist the pluginData is added to the given extension point (add). Plug in data containers are e.g. Node, ...- Parameters:
instance
- the related changeable instancepluginContainer
- the plug in container object where the method is performed onextensionPointID
- the extension point ID where the plug in data should be updated (added/removed)name
pluginDataID
- the ID of the plug in datapluginData
- the object which holds the pluginData or null to remove from the extension point.updateManager
- The UpdateManager where modifications are logged, may be null
-
performOperation
protected static void performOperation(ChangePrimitives processGraph, PluginDataContainer pluginContainer, String extensionPointID, String pluginDataID, PluginData pluginData, UpdateManager updateManager)
Worker method to do the structural changes for both changeable templates and changeable instances.- Parameters:
processGraph
- an instance of type ChangeableTemplate or ChangeableInstancepluginContainer
- the plug in container object where the method is performed onextensionPointID
- the extension point ID where the plug in data should be updated (added/removed)name
pluginDataID
- the ID of the plug in datapluginData
- the object which holds the pluginData or null to remove from the extension point.updateManager
- The UpdateManager where modifications are logged, may be null
-
-