Class DeleteSchemaElementsTask
- java.lang.Object
-
- org.opends.guitools.controlpanel.task.Task
-
- org.opends.guitools.controlpanel.task.DeleteSchemaElementsTask
-
public class DeleteSchemaElementsTask extends Task
The task that is launched when a schema element must be deleted.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opends.guitools.controlpanel.task.Task
Task.State, Task.Type
-
-
Field Summary
-
Fields inherited from class org.opends.guitools.controlpanel.task.Task
errorPrintStream, lastException, outPrintStream, returnCode, state
-
-
Constructor Summary
Constructors Constructor Description DeleteSchemaElementsTask(ControlPanelInfo info, ProgressDialog dlg, Set<ObjectClass> ocsToDelete, Set<AttributeType> attrsToDelete)Constructor of the task.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanLaunch(Task taskToBeLaunched, Collection<org.forgerock.i18n.LocalizableMessage> incompatibilityReasons)Informs of whether the task to be launched can be launched or not.static Map<String,List<String>>cloneExtraProperties(SchemaElement element)Clones the extra properties of the provided schema element.Set<String>getBackends()Returns the names of the backends that are affected by the task.protected List<String>getCommandLineArguments()Returns the list of command-line arguments.protected StringgetCommandLinePath()Returns the full path of the command-line associated with this task ornullif there is not a command-line (or a single command-line) associated with the task.static LinkedHashSet<AttributeType>getOrderedAttributesToDelete(Collection<AttributeType> attrsToDelete, Schema schema)Returns an ordered set of the attributes that must be deleted.static LinkedHashSet<ObjectClass>getOrderedObjectClassesToDelete(Collection<ObjectClass> ocsToDelete, Schema schema)Returns an ordered list of the object classes that must be deleted.static LinkedHashSet<ObjectClass>getOrderedObjectClassesToDeleteFromAttrs(Collection<AttributeType> attrsToDelete, Schema schema)Returns an ordered list of the object classes that must be deleted when deleting a list of attributes that must be deleted.org.forgerock.i18n.LocalizableMessagegetTaskDescription()The description of the task.Task.TypegetType()Returns the type of the task.voidrunTask()Execute the task.-
Methods inherited from class org.opends.guitools.controlpanel.task.Task
addConfigurationElementCreatedListener, executeCommandLine, getCommandLinePath, getCommandLineToDisplay, getConfigCommandLineArguments, getConnectionCommandLineArguments, getConnectionCommandLineArguments, getEquivalentCommandLine, getErrorLogs, getErrorPrintStream, getIncompatibilityMessage, getInfo, getLastException, getLogs, getNoPropertiesFileArgument, getObfuscatedCommandLineArguments, getOutPrintStream, getOutputLogs, getProcess, getProgressDialog, getReturnCode, getServer, getState, isServerRunning, notifyConfigurationElementCreated, obfuscateLDIFLine, postOperation, printEquivalentCommandLine, printEquivalentCommandToModify, printEquivalentRenameCommand, regenerateDescriptor, removeConfigurationElementCreatedListener, runningOnSameServer, startPoolingAndInitializeConfiguration, stopPoolingAndInitializeConfiguration
-
-
-
-
Constructor Detail
-
DeleteSchemaElementsTask
public DeleteSchemaElementsTask(ControlPanelInfo info, ProgressDialog dlg, Set<ObjectClass> ocsToDelete, Set<AttributeType> attrsToDelete)
Constructor of the task.- Parameters:
info- the control panel information.dlg- the progress dialog where the task progress will be displayed.ocsToDelete- the object classes that must be deleted (ordered).attrsToDelete- the attributes that must be deleted (ordered).
-
-
Method Detail
-
getBackends
public Set<String> getBackends()
Description copied from class:TaskReturns the names of the backends that are affected by the task.- Specified by:
getBackendsin classTask- Returns:
- the names of the backends that are affected by the task.
-
canLaunch
public boolean canLaunch(Task taskToBeLaunched, Collection<org.forgerock.i18n.LocalizableMessage> incompatibilityReasons)
Description copied from class:TaskInforms 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 returntrue.- Specified by:
canLaunchin classTask- Parameters:
taskToBeLaunched- the Task that we are trying to launch.incompatibilityReasons- the list of incompatibility reasons that must be updated.- Returns:
trueif the task that we are trying to launch can be launched in parallel with this task andfalseotherwise.
-
getType
public Task.Type getType()
Description copied from class:TaskReturns the type of the task.
-
runTask
public void runTask()
Description copied from class:TaskExecute the task. This method is synchronous.
-
getCommandLinePath
protected String getCommandLinePath()
Description copied from class:TaskReturns the full path of the command-line associated with this task ornullif there is not a command-line (or a single command-line) associated with the task.- Specified by:
getCommandLinePathin classTask- Returns:
- the full path of the command-line associated with this task.
-
getCommandLineArguments
protected List<String> getCommandLineArguments()
Description copied from class:TaskReturns the list of command-line arguments.- Specified by:
getCommandLineArgumentsin classTask- Returns:
- the list of command-line arguments.
-
getTaskDescription
public org.forgerock.i18n.LocalizableMessage getTaskDescription()
Description copied from class:TaskThe 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:
getTaskDescriptionin classTask- Returns:
- the description of the task.
-
getOrderedAttributesToDelete
public static LinkedHashSet<AttributeType> getOrderedAttributesToDelete(Collection<AttributeType> attrsToDelete, Schema schema)
Returns an ordered set of the attributes that must be deleted.- Parameters:
attrsToDelete- the attributes to be deleted.schema- the server schema.- Returns:
- an ordered list of the attributes that must be deleted.
-
getOrderedObjectClassesToDelete
public static LinkedHashSet<ObjectClass> getOrderedObjectClassesToDelete(Collection<ObjectClass> ocsToDelete, Schema schema)
Returns an ordered list of the object classes that must be deleted.- Parameters:
ocsToDelete- the object classes to be deleted.schema- the server schema.- Returns:
- an ordered list of the object classes that must be deleted.
-
getOrderedObjectClassesToDeleteFromAttrs
public static LinkedHashSet<ObjectClass> getOrderedObjectClassesToDeleteFromAttrs(Collection<AttributeType> attrsToDelete, Schema schema)
Returns an ordered list of the object classes that must be deleted when deleting a list of attributes that must be deleted.- Parameters:
attrsToDelete- the attributes to be deleted.schema- the server schema.- Returns:
- an ordered list of the object classes that must be deleted when deleting a list of attributes that must be deleted.
-
cloneExtraProperties
public static Map<String,List<String>> cloneExtraProperties(SchemaElement element)
Clones the extra properties of the provided schema element. This can be used when copying schema elements.- Parameters:
element- the schema element.- Returns:
- the extra properties of the provided schema element.
-
-