Class ModifyEntryTask


  • public class ModifyEntryTask
    extends Task
    The task that is called when we must modify an entry.
    • Constructor Detail

      • ModifyEntryTask

        public ModifyEntryTask​(ControlPanelInfo info,
                               ProgressDialog dlg,
                               Entry newEntry,
                               Entry oldEntry,
                               BrowserController controller,
                               TreePath path)
        Constructor of the task.
        Parameters:
        info - the control panel information.
        dlg - the progress dialog where the task progress will be displayed.
        newEntry - the entry containing the new values.
        oldEntry - the old entry as we retrieved using LDAP.
        controller - the BrowserController.
        path - the TreePath corresponding to the node in the tree that we want to modify.
    • Method Detail

      • hasModifications

        public boolean hasModifications()
        Tells whether there actually modifications on the entry.
        Returns:
        true if there are modifications and false otherwise.
      • getType

        public Task.Type getType()
        Description copied from class: Task
        Returns the type of the task.
        Specified by:
        getType in class Task
        Returns:
        the type of the task.
      • getBackends

        public Set<String> getBackends()
        Description copied from class: Task
        Returns the names of the backends that are affected by the task.
        Specified by:
        getBackends in class Task
        Returns:
        the names of the backends that are affected by the task.
      • getTaskDescription

        public org.forgerock.i18n.LocalizableMessage getTaskDescription()
        Description copied from class: Task
        The description of the task. It is used in both the incompatibility messages and in the warning message displayed when the user wants to quit and there are tasks running.
        Specified by:
        getTaskDescription in class Task
        Returns:
        the description of the task.
      • getCommandLinePath

        protected String getCommandLinePath()
        Description copied from class: Task
        Returns the full path of the command-line associated with this task or null if there is not a command-line (or a single command-line) associated with the task.
        Specified by:
        getCommandLinePath in class Task
        Returns:
        the full path of the command-line associated with this task.
      • getCommandLineArguments

        protected ArrayList<String> getCommandLineArguments()
        Description copied from class: Task
        Returns the list of command-line arguments.
        Specified by:
        getCommandLineArguments in class Task
        Returns:
        the list of command-line arguments.
      • canLaunch

        public boolean canLaunch​(Task taskToBeLaunched,
                                 Collection<org.forgerock.i18n.LocalizableMessage> incompatibilityReasons)
        Description copied from class: Task
        Informs of whether the task to be launched can be launched or not. Every task must implement this method so that we avoid launching in paralel two tasks that are not compatible. Note that in general if the current task is not running this method will return true.
        Specified by:
        canLaunch in class Task
        Parameters:
        taskToBeLaunched - the Task that we are trying to launch.
        incompatibilityReasons - the list of incompatibility reasons that must be updated.
        Returns:
        true if the task that we are trying to launch can be launched in parallel with this task and false otherwise.
      • regenerateDescriptor

        public boolean regenerateDescriptor()
        Description copied from class: Task
        Tells whether a new server descriptor should be regenerated when the task is over. If the task has an influence in the configuration or state of the server (for instance the creation of a base DN) this method should return true so that the configuration will be re-read and all the ConfigChangeListeners will receive a notification with the new configuration.
        Overrides:
        regenerateDescriptor in class Task
        Returns:
        true if a new server descriptor must be regenerated when the task is over and false otherwise.
      • runTask

        public void runTask()
        Description copied from class: Task
        Execute the task. This method is synchronous.
        Specified by:
        runTask in class Task
      • postOperation

        public void postOperation()
        Description copied from class: Task
        Method that is called when everything is finished after updating the progress dialog. It is called from the event thread.
        Overrides:
        postOperation in class Task
      • getModifications

        public static List<Modification> getModifications​(Entry newEntry,
                                                          Entry oldEntry,
                                                          ControlPanelInfo info)
        Gets the modifications to apply between two entries.
        Parameters:
        newEntry - the new entry.
        oldEntry - the old entry.
        info - the ControlPanelInfo, used to retrieve the schema for instance.
        Returns:
        the modifications to apply between two entries.