001/*
002 * Copyright 2015-2018 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2015-2018 Ping Identity Corporation
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021package com.unboundid.ldap.sdk.unboundidds.tasks;
022
023
024
025import java.util.Collections;
026import java.util.Date;
027import java.util.List;
028import java.util.Map;
029
030import com.unboundid.ldap.sdk.Entry;
031import com.unboundid.util.NotMutable;
032import com.unboundid.util.ThreadSafety;
033import com.unboundid.util.ThreadSafetyLevel;
034
035import static com.unboundid.ldap.sdk.unboundidds.tasks.TaskMessages.*;
036
037
038
039/**
040 * This class defines a Directory Server task that can be used to synchronize
041 * the encryption settings definitions in one instance with one or more other
042 * servers in the topology.  This task does not have any task-specific
043 * properties.
044 * <BR>
045 * <BLOCKQUOTE>
046 *   <B>NOTE:</B>  This class, and other classes within the
047 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
048 *   supported for use against Ping Identity, UnboundID, and Alcatel-Lucent 8661
049 *   server products.  These classes provide support for proprietary
050 *   functionality or for external specifications that are not considered stable
051 *   or mature enough to be guaranteed to work in an interoperable way with
052 *   other types of LDAP servers.
053 * </BLOCKQUOTE>
054 */
055@NotMutable()
056@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
057public final class SynchronizeEncryptionSettingsTask
058       extends Task
059{
060  /**
061   * The fully-qualified name of the Java class that is used for the synchronize
062   * encryption settings task.
063   */
064  static final String SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK_CLASS =
065       "com.unboundid.directory.server.crypto." +
066            "SynchronizeEncryptionSettingsTask";
067
068
069
070  /**
071   * The name of the object class used in synchronize encryption settings task
072   * entries.
073   */
074  private static final String OC_SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK =
075       "ds-task-synchronize-encryption-settings";
076
077
078
079  /**
080   * The serial version UID for this serializable class.
081   */
082  private static final long serialVersionUID = 5176601759135180183L;
083
084
085
086  /**
087   * Creates a new uninitialized synchronize encryption settings task instance
088   * that should only be used for obtaining general information about this task,
089   * including the task name, description, and supported properties.
090   */
091  public SynchronizeEncryptionSettingsTask()
092  {
093    this(null, null, null, null, null, null);
094  }
095
096
097
098  /**
099   * Creates a new synchronize encryption settings task with the provided
100   * information.
101   *
102   * @param  taskID         The task ID to use for this task.  If it is
103   *                        {@code null} then a UUID will be generated for use
104   *                        as the task ID.
105   */
106  public SynchronizeEncryptionSettingsTask(final String taskID)
107  {
108    this(taskID, null, null, null, null, null);
109  }
110
111
112
113  /**
114   * Creates a new synchronize encryption settings task with the provided
115   * information.
116   *
117   * @param  taskID                  The task ID to use for this task.  If it is
118   *                                 {@code null} then a UUID will be generated
119   *                                 for use as the task ID.
120   * @param  scheduledStartTime      The time that this task should start
121   *                                 running.
122   * @param  dependencyIDs           The list of task IDs that will be required
123   *                                 to complete before this task will be
124   *                                 eligible to start.
125   * @param  failedDependencyAction  Indicates what action should be taken if
126   *                                 any of the dependencies for this task do
127   *                                 not complete successfully.
128   * @param  notifyOnCompletion      The list of e-mail addresses of individuals
129   *                                 that should be notified when this task
130   *                                 completes.
131   * @param  notifyOnError           The list of e-mail addresses of individuals
132   *                                 that should be notified if this task does
133   *                                 not complete successfully.
134   */
135  public SynchronizeEncryptionSettingsTask(final String taskID,
136              final Date scheduledStartTime, final List<String> dependencyIDs,
137              final FailedDependencyAction failedDependencyAction,
138              final List<String> notifyOnCompletion,
139              final List<String> notifyOnError)
140  {
141    super(taskID, SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK_CLASS,
142         scheduledStartTime, dependencyIDs, failedDependencyAction,
143         notifyOnCompletion, notifyOnError);
144  }
145
146
147
148  /**
149   * Creates a new synchronize encryption settings task from the provided entry.
150   *
151   * @param  entry  The entry to use to create this synchronize encryption
152   *                settings task.
153   *
154   * @throws  TaskException  If the provided entry cannot be parsed as a
155   *                         synchronize encryption settings task entry.
156   */
157  public SynchronizeEncryptionSettingsTask(final Entry entry)
158         throws TaskException
159  {
160    super(entry);
161  }
162
163
164
165  /**
166   * Creates a new synchronize encryption settings task from the provided set of
167   * task properties.
168   *
169   * @param  properties  The set of task properties and their corresponding
170   *                     values to use for the task.  It must not be
171   *                     {@code null}.
172   *
173   * @throws  TaskException  If the provided set of properties cannot be used to
174   *                         create a valid synchronize encryption settings
175   *                         task.
176   */
177  public SynchronizeEncryptionSettingsTask(
178              final Map<TaskProperty,List<Object>> properties)
179         throws TaskException
180  {
181    super(SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK_CLASS, properties);
182  }
183
184
185
186  /**
187   * {@inheritDoc}
188   */
189  @Override()
190  public String getTaskName()
191  {
192    return INFO_TASK_NAME_SYNCHRONIZE_ENCRYPTION_SETTINGS.get();
193  }
194
195
196
197  /**
198   * {@inheritDoc}
199   */
200  @Override()
201  public String getTaskDescription()
202  {
203    return INFO_TASK_DESCRIPTION_SYNCHRONIZE_ENCRYPTION_SETTINGS.get();
204  }
205
206
207
208  /**
209   * {@inheritDoc}
210   */
211  @Override()
212  protected List<String> getAdditionalObjectClasses()
213  {
214    return Collections.singletonList(OC_SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK);
215  }
216}