001/*
002 * Copyright 2015-2024 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2015-2024 Ping Identity Corporation
007 *
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *    http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 */
020/*
021 * Copyright (C) 2015-2024 Ping Identity Corporation
022 *
023 * This program is free software; you can redistribute it and/or modify
024 * it under the terms of the GNU General Public License (GPLv2 only)
025 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
026 * as published by the Free Software Foundation.
027 *
028 * This program is distributed in the hope that it will be useful,
029 * but WITHOUT ANY WARRANTY; without even the implied warranty of
030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
031 * GNU General Public License for more details.
032 *
033 * You should have received a copy of the GNU General Public License
034 * along with this program; if not, see <http://www.gnu.org/licenses>.
035 */
036package com.unboundid.ldap.sdk.unboundidds.tasks;
037
038
039
040import java.util.Collections;
041import java.util.Date;
042import java.util.List;
043import java.util.Map;
044
045import com.unboundid.ldap.sdk.Entry;
046import com.unboundid.util.NotMutable;
047import com.unboundid.util.NotNull;
048import com.unboundid.util.Nullable;
049import com.unboundid.util.ThreadSafety;
050import com.unboundid.util.ThreadSafetyLevel;
051
052import static com.unboundid.ldap.sdk.unboundidds.tasks.TaskMessages.*;
053
054
055
056/**
057 * This class defines a Directory Server task that can be used to synchronize
058 * the encryption settings definitions in one instance with one or more other
059 * servers in the topology.  This task does not have any task-specific
060 * properties.
061 * <BR>
062 * <BLOCKQUOTE>
063 *   <B>NOTE:</B>  This class, and other classes within the
064 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
065 *   supported for use against Ping Identity, UnboundID, and
066 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
067 *   for proprietary functionality or for external specifications that are not
068 *   considered stable or mature enough to be guaranteed to work in an
069 *   interoperable way with other types of LDAP servers.
070 * </BLOCKQUOTE>
071 */
072@NotMutable()
073@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
074public final class SynchronizeEncryptionSettingsTask
075       extends Task
076{
077  /**
078   * The fully-qualified name of the Java class that is used for the synchronize
079   * encryption settings task.
080   */
081  @NotNull static final String SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK_CLASS =
082       "com.unboundid.directory.server.crypto." +
083            "SynchronizeEncryptionSettingsTask";
084
085
086
087  /**
088   * The name of the object class used in synchronize encryption settings task
089   * entries.
090   */
091  @NotNull private static final String OC_SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK =
092       "ds-task-synchronize-encryption-settings";
093
094
095
096  /**
097   * The serial version UID for this serializable class.
098   */
099  private static final long serialVersionUID = 5176601759135180183L;
100
101
102
103  /**
104   * Creates a new uninitialized synchronize encryption settings task instance
105   * that should only be used for obtaining general information about this task,
106   * including the task name, description, and supported properties.
107   */
108  public SynchronizeEncryptionSettingsTask()
109  {
110    this(null, null, null, null, null, null);
111  }
112
113
114
115  /**
116   * Creates a new synchronize encryption settings task with the provided
117   * information.
118   *
119   * @param  taskID         The task ID to use for this task.  If it is
120   *                        {@code null} then a UUID will be generated for use
121   *                        as the task ID.
122   */
123  public SynchronizeEncryptionSettingsTask(@Nullable final String taskID)
124  {
125    this(taskID, null, null, null, null, null);
126  }
127
128
129
130  /**
131   * Creates a new synchronize encryption settings task with the provided
132   * information.
133   *
134   * @param  taskID                  The task ID to use for this task.  If it is
135   *                                 {@code null} then a UUID will be generated
136   *                                 for use as the task ID.
137   * @param  scheduledStartTime      The time that this task should start
138   *                                 running.
139   * @param  dependencyIDs           The list of task IDs that will be required
140   *                                 to complete before this task will be
141   *                                 eligible to start.
142   * @param  failedDependencyAction  Indicates what action should be taken if
143   *                                 any of the dependencies for this task do
144   *                                 not complete successfully.
145   * @param  notifyOnCompletion      The list of e-mail addresses of individuals
146   *                                 that should be notified when this task
147   *                                 completes.
148   * @param  notifyOnError           The list of e-mail addresses of individuals
149   *                                 that should be notified if this task does
150   *                                 not complete successfully.
151   */
152  public SynchronizeEncryptionSettingsTask(@Nullable final String taskID,
153              @Nullable final Date scheduledStartTime,
154              @Nullable final List<String> dependencyIDs,
155              @Nullable final FailedDependencyAction failedDependencyAction,
156              @Nullable final List<String> notifyOnCompletion,
157              @Nullable final List<String> notifyOnError)
158  {
159    this(taskID, scheduledStartTime, dependencyIDs, failedDependencyAction,
160         null, notifyOnCompletion, null, notifyOnError, null, null, null);
161  }
162
163
164
165  /**
166   * Creates a new synchronize encryption settings task with the provided
167   * information.
168   *
169   * @param  taskID                  The task ID to use for this task.  If it is
170   *                                 {@code null} then a UUID will be generated
171   *                                 for use as the task ID.
172   * @param  scheduledStartTime      The time that this task should start
173   *                                 running.
174   * @param  dependencyIDs           The list of task IDs that will be required
175   *                                 to complete before this task will be
176   *                                 eligible to start.
177   * @param  failedDependencyAction  Indicates what action should be taken if
178   *                                 any of the dependencies for this task do
179   *                                 not complete successfully.
180   * @param  notifyOnStart           The list of e-mail addresses of individuals
181   *                                 that should be notified when this task
182   *                                 starts running.
183   * @param  notifyOnCompletion      The list of e-mail addresses of individuals
184   *                                 that should be notified when this task
185   *                                 completes.
186   * @param  notifyOnSuccess         The list of e-mail addresses of individuals
187   *                                 that should be notified if this task
188   *                                 completes successfully.
189   * @param  notifyOnError           The list of e-mail addresses of individuals
190   *                                 that should be notified if this task does
191   *                                 not complete successfully.
192   * @param  alertOnStart            Indicates whether the server should send an
193   *                                 alert notification when this task starts.
194   * @param  alertOnSuccess          Indicates whether the server should send an
195   *                                 alert notification if this task completes
196   *                                 successfully.
197   * @param  alertOnError            Indicates whether the server should send an
198   *                                 alert notification if this task fails to
199   *                                 complete successfully.
200   */
201  public SynchronizeEncryptionSettingsTask(@Nullable final String taskID,
202              @Nullable final Date scheduledStartTime,
203              @Nullable final List<String> dependencyIDs,
204              @Nullable final FailedDependencyAction failedDependencyAction,
205              @Nullable final List<String> notifyOnStart,
206              @Nullable final List<String> notifyOnCompletion,
207              @Nullable final List<String> notifyOnSuccess,
208              @Nullable final List<String> notifyOnError,
209              @Nullable final Boolean alertOnStart,
210              @Nullable final Boolean alertOnSuccess,
211              @Nullable final Boolean alertOnError)
212  {
213    super(taskID, SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK_CLASS,
214         scheduledStartTime, dependencyIDs, failedDependencyAction,
215         notifyOnStart, notifyOnCompletion, notifyOnSuccess, notifyOnError,
216         alertOnStart, alertOnSuccess, alertOnError);
217  }
218
219
220
221  /**
222   * Creates a new synchronize encryption settings task from the provided entry.
223   *
224   * @param  entry  The entry to use to create this synchronize encryption
225   *                settings task.
226   *
227   * @throws  TaskException  If the provided entry cannot be parsed as a
228   *                         synchronize encryption settings task entry.
229   */
230  public SynchronizeEncryptionSettingsTask(@NotNull final Entry entry)
231         throws TaskException
232  {
233    super(entry);
234  }
235
236
237
238  /**
239   * Creates a new synchronize encryption settings task from the provided set of
240   * task properties.
241   *
242   * @param  properties  The set of task properties and their corresponding
243   *                     values to use for the task.  It must not be
244   *                     {@code null}.
245   *
246   * @throws  TaskException  If the provided set of properties cannot be used to
247   *                         create a valid synchronize encryption settings
248   *                         task.
249   */
250  public SynchronizeEncryptionSettingsTask(
251              @NotNull final Map<TaskProperty,List<Object>> properties)
252         throws TaskException
253  {
254    super(SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK_CLASS, properties);
255  }
256
257
258
259  /**
260   * {@inheritDoc}
261   */
262  @Override()
263  @NotNull()
264  public String getTaskName()
265  {
266    return INFO_TASK_NAME_SYNCHRONIZE_ENCRYPTION_SETTINGS.get();
267  }
268
269
270
271  /**
272   * {@inheritDoc}
273   */
274  @Override()
275  @NotNull()
276  public String getTaskDescription()
277  {
278    return INFO_TASK_DESCRIPTION_SYNCHRONIZE_ENCRYPTION_SETTINGS.get();
279  }
280
281
282
283  /**
284   * {@inheritDoc}
285   */
286  @Override()
287  @NotNull()
288  protected List<String> getAdditionalObjectClasses()
289  {
290    return Collections.singletonList(OC_SYNCHRONIZE_ENCRYPTION_SETTINGS_TASK);
291  }
292}