Class 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.
    • Field Detail

      • logger

        protected static final Logger logger
        a Logger
    • Constructor Detail

      • UpdatePluginDataContainer

        public UpdatePluginDataContainer()
    • 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 by extensionPoint with the value given by pluginData in the plug in data container given by pluginContainer. A value of null for pluginData 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 template
        pluginContainer - the plug in container object where the method is performed on
        extensionPointID - the extension point ID where the plug in data should be updated (added/removed) name
        pluginDataID - the ID of the plug in data
        pluginData - 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 by extensionPoint with the value given by pluginData in the plug in data container given by pluginContainer. A value of null for pluginData 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 template
        pluginContainer - the plug in container object where the method is performed on
        extensionPointID - the extension point ID where the plug in data should be updated (added/removed) name
        pluginDataID - the ID of the plug in data
        pluginData - the object which holds the pluginData or null to remove from the extension point
        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 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 by extensionPoint with the value given by pluginData in the plug in data container given by pluginContainer. A value of null for pluginData 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 instance
        pluginContainer - the plug in container object where the method is performed on
        extensionPointID - the extension point ID where the plug in data should be updated (added/removed) name
        pluginDataID - the ID of the plug in data
        pluginData - 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 by extensionPoint with the value given by pluginData in the plug in data container given by pluginContainer. A value of null for pluginData 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 instance
        pluginContainer - the plug in container object where the method is performed on
        extensionPointID - the extension point ID where the plug in data should be updated (added/removed) name
        pluginDataID - the ID of the plug in data
        pluginData - the object which holds the pluginData or null to remove from the extension point
        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 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 for pluginData 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 template
        pluginContainer - the plug in container object where the method is performed on
        extensionPointID - the extension point ID where the plug in data should be updated (added/removed) name
        pluginDataID - the ID of the plug in data
        pluginData - 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 for pluginData 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 template
        pluginContainer - the plug in container object where the method is performed on
        extensionPointID - the extension point ID where the plug in data should be updated (added/removed) name
        pluginDataID - the ID of the plug in data
        pluginData - 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 for pluginData 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 instance
        pluginContainer - the plug in container object where the method is performed on
        extensionPointID - the extension point ID where the plug in data should be updated (added/removed) name
        pluginDataID - the ID of the plug in data
        pluginData - 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 for pluginData 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 instance
        pluginContainer - the plug in container object where the method is performed on
        extensionPointID - the extension point ID where the plug in data should be updated (added/removed) name
        pluginDataID - the ID of the plug in data
        pluginData - 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 ChangeableInstance
        pluginContainer - the plug in container object where the method is performed on
        extensionPointID - the extension point ID where the plug in data should be updated (added/removed) name
        pluginDataID - the ID of the plug in data
        pluginData - the object which holds the pluginData or null to remove from the extension point.
        updateManager - The UpdateManager where modifications are logged, may be null