Class GenerateServerProfileTask
- java.lang.Object
-
- com.unboundid.ldap.sdk.unboundidds.tasks.Task
-
- com.unboundid.ldap.sdk.unboundidds.tasks.GenerateServerProfileTask
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class GenerateServerProfileTask extends Task
This class defines a Directory Server task that can be used to cause it to generate a server profile in a specified location on the server filesystem. The profile may be created in a directory structure or packaged in a zip file. \ *
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.
The properties that are available for use with this type of task include:- The path on the server filesystem to the location in which the generated server profile should be written. If the profile is to be packaged into a zip file, then this may either be the path to the zip file to create (which must not yet exist, although its parent directory must exist) or the path to the directory (which must already exist) in which the zip file will be created with a server-generated name. If the profile is not to be packaged into a zip file, then this must be the path to the directory in which the profile will be written, and either that directory must exist and be empty or it must not exist but its parent directory must exist. In either case, the path provided may be an absolute path, or it may be a relative path that is interpreted as relative to the instance root. If this property is not provided, then the zip file or profile directory will be created in the instance root with a server-generated name.
- An optional set of additional paths to files or directories within the instance root that should be included in the server profile. These may be specified as either absolute paths or relative paths that will be interpreted as relative to the instance root, but the paths must refer to files or directories that exist beneath the instance root. If this is omitted, then no additional include paths will be used.
- A flag indicating whether the generated server profile should be packaged into a zip file. If this is omitted, then the server will determine whether to package the profile into a zip file.
- Optional properties indicating the number and/or age of previous profile zip files to retain. These options may only be used if the profile is to be packaged into a zip file, and if the name of the zip file will be generated by the server.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenerateServerProfileTask()
Creates a new uninitialized generate server profile task instance that should only be used for obtaining general information about this task, including the task name, description, and supported properties.GenerateServerProfileTask(Entry entry)
Creates a new generate server profile task from the provided entry.GenerateServerProfileTask(java.lang.String taskID, java.lang.String profileRoot, java.util.List<java.lang.String> includePaths, java.lang.Boolean zipProfile, java.lang.Integer retainCount, java.lang.Long retainAgeMillis)
Creates a new generate server profile task with the provided information.GenerateServerProfileTask(java.lang.String taskID, java.lang.String profileRoot, java.util.List<java.lang.String> includePaths, java.lang.Boolean zipProfile, java.lang.Integer retainCount, java.lang.Long retainAgeMillis, java.util.Date scheduledStartTime, java.util.List<java.lang.String> dependencyIDs, FailedDependencyAction failedDependencyAction, java.util.List<java.lang.String> notifyOnStart, java.util.List<java.lang.String> notifyOnCompletion, java.util.List<java.lang.String> notifyOnSuccess, java.util.List<java.lang.String> notifyOnError, java.lang.Boolean alertOnStart, java.lang.Boolean alertOnSuccess, java.lang.Boolean alertOnError)
Creates a new generate server profile task with the provided information.GenerateServerProfileTask(java.util.Map<TaskProperty,java.util.List<java.lang.Object>> properties)
Creates a generate server profile task from the provided set of task properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<Attribute>
getAdditionalAttributes()
Retrieves a list of the additional attributes (other than attributes common to all task types) that should be included when creating new task entries of this type.protected java.util.List<java.lang.String>
getAdditionalObjectClasses()
Retrieves a list of the additional object classes (other than the base "top" and "ds-task" classes) that should be included when creating new task entries of this type.java.util.List<java.lang.String>
getIncludePaths()
Retrieves a list of additional paths to files or directories within the instance root that should be included in the generated server profile.java.lang.String
getProfileRoot()
Retrieves the path on the server filesystem to the zip file or directory to which the generated server profile will be written.java.lang.String
getRetainAge()
Retrieves the maximum age of preexisting server profile zip files to retain after a new profile is successfully generated, if defined.java.lang.Long
getRetainAgeMillis()
Retrieves the maximum age in milliseconds of preexisting server profile zip files to retain after a new profile is successfully generated, if defined.java.lang.Integer
getRetainCount()
Retrieves the maximum number of preexisting server profile zip files to retain after a new profile is successfully generated, if defined.java.lang.String
getTaskDescription()
Retrieves a human-readable description for this task.java.lang.String
getTaskName()
Retrieves a human-readable name for this task.java.util.Map<TaskProperty,java.util.List<java.lang.Object>>
getTaskPropertyValues()
Retrieves the values of the task properties for this task.java.util.List<TaskProperty>
getTaskSpecificProperties()
Retrieves a list of task-specific properties that may be provided when scheduling a task of this type.java.lang.Boolean
getZipProfile()
Retrieves a flag that indicates whether the server should package the generated server profile into a zip file.-
Methods inherited from class com.unboundid.ldap.sdk.unboundidds.tasks.Task
createTaskEntry, decodeTask, getActualStartTime, getAlertOnError, getAlertOnStart, getAlertOnSuccess, getAvailableTaskTypes, getCommonTaskProperties, getCompletionTime, getDependencyIDs, getFailedDependencyAction, getLogMessages, getNotifyOnCompletionAddresses, getNotifyOnErrorAddresses, getNotifyOnStartAddresses, getNotifyOnSuccessAddresses, getScheduledStartTime, getState, getTaskClassName, getTaskEntry, getTaskEntryDN, getTaskID, isCompleted, isPending, isRunning, parseBoolean, parseBooleanValue, parseDate, parseLong, parseString, parseStringList, parseStrings, toString, toString
-
-
-
-
Constructor Detail
-
GenerateServerProfileTask
public GenerateServerProfileTask()
Creates a new uninitialized generate server profile task instance that should only be used for obtaining general information about this task, including the task name, description, and supported properties. Attempts to use a task created with this constructor for any other reason will likely fail.
-
GenerateServerProfileTask
public GenerateServerProfileTask(@Nullable java.lang.String taskID, @Nullable java.lang.String profileRoot, @Nullable java.util.List<java.lang.String> includePaths, @Nullable java.lang.Boolean zipProfile, @Nullable java.lang.Integer retainCount, @Nullable java.lang.Long retainAgeMillis)
Creates a new generate server profile task with the provided information.- Parameters:
taskID
- The task ID to use for this task. If it isnull
then a UUID will be generated for use as the task ID.profileRoot
- The path on the server filesystem to the zip file or directory to which the generated server profile will be written. This may be an absolute path or a relative path that will be interpreted as relative to the instance root. If the generated server profile will be packaged into a zip file, then this must either be the path to the zip file to be created (which must not yet exist, although its parent directory must exist) or the path to the directory (which must already exists) in which the zip file is to be created. If the server profile will not e zipped, then this must be the path to an empty or nonexistent directory in a parent directory that does exist. If this is not provided, the server will create the zip file or profile directory in the instance root with a name that it generates.includePaths
- An optional list of paths to additional files or directories that exist within the instance root that should be included in the generated server profile. Relative paths will be interpreted as relative to the instance root. This may benull
or empty if no additional include paths should be used.zipProfile
- Indicates whether the generated server profile should be packaged into a zip file. If this isBoolean.TRUE
, then the profile will be packaged into a zip file. If this isBoolean.FALSE
, then the profile will be written as a directory structure. It may benull
if the server should choose whether to package the profile into a zip file.retainCount
- The minimum number of preexisting server profile zip files to retain. This may only be provided if the profile is to be packaged into a zip file and the profile root is specified as a directory so that the server will generate the zip file name. This may benull
if only the retain age will be used to identify which files may be deleted (if a retain age is given), or if no preexisting profile zip files should be removed (if no retain age is given).retainAgeMillis
- The minimum age in milliseconds of preexisting server profile zip files to retain. This may only be provided if the profile is to be packaged into a zip file and the profile root is specified as a directory so that the server will generate the zip file name. This may benull
if only the retain count will be used to identify which files may be deleted (if a retain count is given), or if no preexisting profile zip files should be removed (if no retain count is given).
-
GenerateServerProfileTask
public GenerateServerProfileTask(@Nullable java.lang.String taskID, @Nullable java.lang.String profileRoot, @Nullable java.util.List<java.lang.String> includePaths, @Nullable java.lang.Boolean zipProfile, @Nullable java.lang.Integer retainCount, @Nullable java.lang.Long retainAgeMillis, @Nullable java.util.Date scheduledStartTime, @Nullable java.util.List<java.lang.String> dependencyIDs, @Nullable FailedDependencyAction failedDependencyAction, @Nullable java.util.List<java.lang.String> notifyOnStart, @Nullable java.util.List<java.lang.String> notifyOnCompletion, @Nullable java.util.List<java.lang.String> notifyOnSuccess, @Nullable java.util.List<java.lang.String> notifyOnError, @Nullable java.lang.Boolean alertOnStart, @Nullable java.lang.Boolean alertOnSuccess, @Nullable java.lang.Boolean alertOnError)
Creates a new generate server profile task with the provided information.- Parameters:
taskID
- The task ID to use for this task. If it isnull
then a UUID will be generated for use as the task ID.profileRoot
- The path on the server filesystem to the zip file or directory to which the generated server profile will be written. This may be an absolute path or a relative path that will be interpreted as relative to the instance root. If the generated server profile will be packaged into a zip file, then this must either be the path to the zip file to be created (which must not yet exist, although its parent directory must exist) or the path to the directory (which must already exists) in which the zip file is to be created. If the server profile will not e zipped, then this must be the path to an empty or nonexistent directory in a parent directory that does exist. If this is not provided, the server will create the zip file or profile directory in the instance root with a name that it generates.includePaths
- An optional list of paths to additional files or directories that exist within the instance root that should be included in the generated server profile. Relative paths will be interpreted as relative to the instance root. This may benull
or empty if no additional include paths should be used.zipProfile
- Indicates whether the generated server profile should be packaged into a zip file. If this isBoolean.TRUE
, then the profile will be packaged into a zip file. If this isBoolean.FALSE
, then the profile will be written as a directory structure. It may benull
if the server should choose whether to package the profile into a zip file.retainCount
- The minimum number of preexisting server profile zip files to retain. This may only be provided if the profile is to be packaged into a zip file and the profile root is specified as a directory so that the server will generate the zip file name. This may benull
if only the retain age will be used to identify which files may be deleted (if a retain age is given), or if no preexisting profile zip files should be removed (if no retain age is given).retainAgeMillis
- The minimum age in milliseconds of preexisting server profile zip files to retain. This may only be provided if the profile is to be packaged into a zip file and the profile root is specified as a directory so that the server will generate the zip file name. This may benull
if only the retain count will be used to identify which files may be deleted (if a retain count is given), or if no preexisting profile zip files should be removed (if no retain count is given).scheduledStartTime
- The time that this task should start running.dependencyIDs
- The list of task IDs that will be required to complete before this task will be eligible to start.failedDependencyAction
- Indicates what action should be taken if any of the dependencies for this task do not complete successfully.notifyOnStart
- The list of e-mail addresses of individuals that should be notified when this task starts running.notifyOnCompletion
- The list of e-mail addresses of individuals that should be notified when this task completes.notifyOnSuccess
- The list of e-mail addresses of individuals that should be notified if this task completes successfully.notifyOnError
- The list of e-mail addresses of individuals that should be notified if this task does not complete successfully.alertOnStart
- Indicates whether the server should send an alert notification when this task starts.alertOnSuccess
- Indicates whether the server should send an alert notification if this task completes successfully.alertOnError
- Indicates whether the server should send an alert notification if this task fails to complete successfully.
-
GenerateServerProfileTask
public GenerateServerProfileTask(@NotNull Entry entry) throws TaskException
Creates a new generate server profile task from the provided entry.- Parameters:
entry
- The entry to use to create this generate server profile task.- Throws:
TaskException
- If the provided entry cannot be parsed as a generate server profile task entry.
-
GenerateServerProfileTask
public GenerateServerProfileTask(@NotNull java.util.Map<TaskProperty,java.util.List<java.lang.Object>> properties) throws TaskException
Creates a generate server profile task from the provided set of task properties.- Parameters:
properties
- The set of task properties and their corresponding values to use for the task. It must not benull
.- Throws:
TaskException
- If the provided set of properties cannot be used to create a valid generate server profile task.
-
-
Method Detail
-
getTaskName
@NotNull public java.lang.String getTaskName()
Retrieves a human-readable name for this task.- Overrides:
getTaskName
in classTask
- Returns:
- A human-readable name for this task.
-
getTaskDescription
@NotNull public java.lang.String getTaskDescription()
Retrieves a human-readable description for this task.- Overrides:
getTaskDescription
in classTask
- Returns:
- A human-readable description for this task.
-
getProfileRoot
@Nullable public java.lang.String getProfileRoot()
Retrieves the path on the server filesystem to the zip file or directory to which the generated server profile will be written. It may be an absolute path or a relative path that will be interpreted as relative to the instance root.- Returns:
- The path on the server filesystem to the zip file or directory to
which the generated server profile will be written, or
null
if the server will create the zip file or profile directory in the instance root with a generated name.
-
getIncludePaths
@NotNull public java.util.List<java.lang.String> getIncludePaths()
Retrieves a list of additional paths to files or directories within the instance root that should be included in the generated server profile.- Returns:
- A list of additional paths to files or directories within the instance root that should be included in the generated server profile, or an empty list if no additional paths should be included.
-
getZipProfile
@Nullable public java.lang.Boolean getZipProfile()
Retrieves a flag that indicates whether the server should package the generated server profile into a zip file.- Returns:
Boolean.TRUE
if the generated server profile should be packaged into a zip file,Boolean.FALSE
if the server profile should be written as a directory structure, ornull
if this is not specified and the server will decide which behavior to exhibit.
-
getRetainCount
@Nullable public java.lang.Integer getRetainCount()
Retrieves the maximum number of preexisting server profile zip files to retain after a new profile is successfully generated, if defined.- Returns:
- The maximum number of preexisting server profile zip files to
retain after a new profile is successfully generated, or
null
if file retention processing should depend only on the retain age (if defined) or if no retention processing should be performed.
-
getRetainAge
@Nullable public java.lang.String getRetainAge()
Retrieves the maximum age of preexisting server profile zip files to retain after a new profile is successfully generated, if defined. The value will be formatted as a duration as used by theDurationArgument
class, which is an integer followed by a time unit (millisecond, second, minute, hour, day, or week, or one of their plurals).- Returns:
- The maximum age of preexisting server profile zip files to
retain after a new profile is successfully generated, or
null
if file retention processing should depend only on the retain count (if defined) or if no retention processing should be performed.
-
getRetainAgeMillis
@Nullable public java.lang.Long getRetainAgeMillis() throws TaskException
Retrieves the maximum age in milliseconds of preexisting server profile zip files to retain after a new profile is successfully generated, if defined.- Returns:
- The maximum age in milliseconds of preexisting server profile zip
files to retain after a new profile is successfully generated, or
null
if file retention processing should depend only on the retain count (if defined) or if no retention processing should be performed. - Throws:
TaskException
- If a problem is encountered while attempting to parse the retain age as a duration.
-
getAdditionalObjectClasses
@NotNull protected java.util.List<java.lang.String> getAdditionalObjectClasses()
Retrieves a list of the additional object classes (other than the base "top" and "ds-task" classes) that should be included when creating new task entries of this type.- Overrides:
getAdditionalObjectClasses
in classTask
- Returns:
- A list of the additional object classes that should be included in new task entries of this type, or an empty list if there do not need to be any additional classes.
-
getAdditionalAttributes
@NotNull protected java.util.List<Attribute> getAdditionalAttributes()
Retrieves a list of the additional attributes (other than attributes common to all task types) that should be included when creating new task entries of this type.- Overrides:
getAdditionalAttributes
in classTask
- Returns:
- A list of the additional attributes that should be included in new task entries of this type, or an empty list if there do not need to be any additional attributes.
-
getTaskSpecificProperties
@NotNull public java.util.List<TaskProperty> getTaskSpecificProperties()
Retrieves a list of task-specific properties that may be provided when scheduling a task of this type. This method should be overridden by subclasses in order to provide an appropriate set of properties.- Overrides:
getTaskSpecificProperties
in classTask
- Returns:
- A list of task-specific properties that may be provided when scheduling a task of this type.
-
getTaskPropertyValues
@NotNull public java.util.Map<TaskProperty,java.util.List<java.lang.Object>> getTaskPropertyValues()
Retrieves the values of the task properties for this task. The data type of the values will vary based on the data type of the corresponding task property and may be one of the following types:Boolean
,Date
,Long
, orString
. Task properties which do not have any values will be included in the map with an empty value list.
Note that subclasses which have additional task properties should override this method and return a map which contains both the property values from this class (obtained fromsuper.getTaskPropertyValues()
and the values of their own task-specific properties.- Overrides:
getTaskPropertyValues
in classTask
- Returns:
- A map of the task property values for this task.
-
-