001/*
002 * Copyright 2008-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.Arrays;
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 request that
041 * the server refresh the encryption settings database from disk.  It does not
042 * have any custom configuration properties.
043 * <BR>
044 * <BLOCKQUOTE>
045 *   <B>NOTE:</B>  This class, and other classes within the
046 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
047 *   supported for use against Ping Identity, UnboundID, and Alcatel-Lucent 8661
048 *   server products.  These classes provide support for proprietary
049 *   functionality or for external specifications that are not considered stable
050 *   or mature enough to be guaranteed to work in an interoperable way with
051 *   other types of LDAP servers.
052 * </BLOCKQUOTE>
053 */
054@NotMutable()
055@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
056public final class RefreshEncryptionSettingsTask
057       extends Task
058{
059  /**
060   * The fully-qualified name of the Java class that is used for the refresh
061   * encryption settings task in the Directory Server.
062   */
063  static final String REFRESH_ENCRYPTION_SETTINGS_TASK_CLASS =
064       "com.unboundid.directory.server.tasks.RefreshEncryptionSettingsTask";
065
066
067
068  /**
069   * The name of the object class used in refresh encryption settings task
070   * entries.
071   */
072  private static final String OC_REFRESH_ENCRYPTION_SETTINGS_TASK =
073       "ds-task-refresh-encryption-settings";
074
075
076  /**
077   * The serial version UID for this serializable class.
078   */
079  private static final long serialVersionUID = -2469450547006114721L;
080
081
082
083  /**
084   * Creates a new uninitialized refresh encryption settings task instance which
085   * should only be used for obtaining general information about this task,
086   * including the task name, description, and supported properties.
087   */
088  public RefreshEncryptionSettingsTask()
089  {
090    this(null, null, null, null, null, null);
091  }
092
093
094
095
096  /**
097   * Creates a new refresh encryption settings task with the provided
098   * information.
099   *
100   * @param  taskID         The task ID to use for this task.  If it is
101   *                        {@code null} then a UUID will be generated for use
102   *                        as the task ID.
103   */
104  public RefreshEncryptionSettingsTask(final String taskID)
105  {
106    this(taskID, null, null, null, null, null);
107  }
108
109
110
111  /**
112   * Creates a new refresh encryption settings task with the provided
113   * information.
114   *
115   * @param  taskID                  The task ID to use for this task.  If it is
116   *                                 {@code null} then a UUID will be generated
117   *                                 for use as the task ID.
118   * @param  scheduledStartTime      The time that this task should start
119   *                                 running.
120   * @param  dependencyIDs           The list of task IDs that will be required
121   *                                 to complete before this task will be
122   *                                 eligible to start.
123   * @param  failedDependencyAction  Indicates what action should be taken if
124   *                                 any of the dependencies for this task do
125   *                                 not complete successfully.
126   * @param  notifyOnCompletion      The list of e-mail addresses of individuals
127   *                                 that should be notified when this task
128   *                                 completes.
129   * @param  notifyOnError           The list of e-mail addresses of individuals
130   *                                 that should be notified if this task does
131   *                                 not complete successfully.
132   */
133  public RefreshEncryptionSettingsTask(final String taskID,
134              final Date scheduledStartTime, final List<String> dependencyIDs,
135              final FailedDependencyAction failedDependencyAction,
136              final List<String> notifyOnCompletion,
137              final List<String> notifyOnError)
138  {
139    super(taskID, REFRESH_ENCRYPTION_SETTINGS_TASK_CLASS, scheduledStartTime,
140          dependencyIDs, failedDependencyAction, notifyOnCompletion,
141          notifyOnError);
142  }
143
144
145
146  /**
147   * Creates a new refresh encryption settings task from the provided entry.
148   *
149   * @param  entry  The entry to use to create this refresh encryption settings
150   *                task.
151   *
152   * @throws  TaskException  If the provided entry cannot be parsed as a refresh
153   *                         encryption settings task entry.
154   */
155  public RefreshEncryptionSettingsTask(final Entry entry)
156         throws TaskException
157  {
158    super(entry);
159  }
160
161
162
163  /**
164   * Creates a new refresh encryption settings task from the provided set of
165   * task properties.
166   *
167   * @param  properties  The set of task properties and their corresponding
168   *                     values to use for the task.  It must not be
169   *                     {@code null}.
170   *
171   * @throws  TaskException  If the provided set of properties cannot be used to
172   *                         create a valid refresh encryption settings task.
173   */
174  public RefreshEncryptionSettingsTask(
175              final Map<TaskProperty,List<Object>> properties)
176         throws TaskException
177  {
178    super(REFRESH_ENCRYPTION_SETTINGS_TASK_CLASS, properties);
179  }
180
181
182
183  /**
184   * {@inheritDoc}
185   */
186  @Override()
187  public String getTaskName()
188  {
189    return INFO_TASK_NAME_REFRESH_ENCRYPTION_SETTINGS.get();
190  }
191
192
193
194  /**
195   * {@inheritDoc}
196   */
197  @Override()
198  public String getTaskDescription()
199  {
200    return INFO_TASK_DESCRIPTION_REFRESH_ENCRYPTION_SETTINGS.get();
201  }
202
203
204
205  /**
206   * {@inheritDoc}
207   */
208  @Override()
209  protected List<String> getAdditionalObjectClasses()
210  {
211    return Arrays.asList(OC_REFRESH_ENCRYPTION_SETTINGS_TASK);
212  }
213}