001/*
002 * Copyright 2018-2019 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2018-2019 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 request that
041 * the server should dynamically reload all key and trust manager providers
042 * associated with all HTTP connection handlers configured with support for
043 * HTTPS.  Note that this may cause problems with a client's ability to resume a
044 * TLS session that was created before the reload.
045 * <BR>
046 * <BLOCKQUOTE>
047 *   <B>NOTE:</B>  This class, and other classes within the
048 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
049 *   supported for use against Ping Identity, UnboundID, and
050 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
051 *   for proprietary functionality or for external specifications that are not
052 *   considered stable or mature enough to be guaranteed to work in an
053 *   interoperable way with other types of LDAP servers.
054 * </BLOCKQUOTE>
055 * <BR>
056 * The reload HTTP connection handler certificates task does not have any
057 * task-specific properties.
058 */
059@NotMutable()
060@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
061public final class ReloadHTTPConnectionHandlerCertificatesTask
062       extends Task
063{
064  /**
065   * The fully-qualified name of the Java class in the server that is used for
066   * the reload HTTP connection handler certificates task.
067   */
068  static final String RELOAD_HTTP_CONNECTION_HANDLER_CERTIFICATES_TASK_CLASS =
069       "com.unboundid.directory.server.tasks." +
070            "ReloadHTTPConnectionHandlerCertificatesTask";
071
072
073
074  /**
075   * The name of the object class used in reload HTTP connection handler
076   * certificates task entries.
077   */
078  private static final String
079       OC_RELOAD_HTTP_CONNECTION_HANDLER_CERTIFICATES_TASK =
080            "ds-task-reload-http-connection-handler-certificates";
081
082
083
084  /**
085   * The serial version UID for this serializable class.
086   */
087  private static final long serialVersionUID = 842594962305532389L;
088
089
090
091  /**
092   * Creates a new uninitialized reload HTTP connection handler certificates
093   * task instance that should only be used for obtaining general information
094   * about this task, including the task name, description, and supported
095   * properties.
096   */
097  public ReloadHTTPConnectionHandlerCertificatesTask()
098  {
099    this(null, null, null, null, null, null);
100  }
101
102
103
104  /**
105   * Creates a new reload HTTP connection handler certificates task with the
106   * provided information.
107   *
108   * @param  taskID         The task ID to use for this task.  If it is
109   *                        {@code null} then a UUID will be generated for use
110   *                        as the task ID.
111   */
112  public ReloadHTTPConnectionHandlerCertificatesTask(final String taskID)
113  {
114    this(taskID, null, null, null, null, null);
115  }
116
117
118
119  /**
120   * Creates a new reload HTTP connection handler certificates task with the
121   * provided information.
122   *
123   * @param  taskID                  The task ID to use for this task.  If it is
124   *                                 {@code null} then a UUID will be generated
125   *                                 for use as the task ID.
126   * @param  scheduledStartTime      The time that this task should start
127   *                                 running.
128   * @param  dependencyIDs           The list of task IDs that will be required
129   *                                 to complete before this task will be
130   *                                 eligible to start.
131   * @param  failedDependencyAction  Indicates what action should be taken if
132   *                                 any of the dependencies for this task do
133   *                                 not complete successfully.
134   * @param  notifyOnCompletion      The list of e-mail addresses of individuals
135   *                                 that should be notified when this task
136   *                                 completes.
137   * @param  notifyOnError           The list of e-mail addresses of individuals
138   *                                 that should be notified if this task does
139   *                                 not complete successfully.
140   */
141  public ReloadHTTPConnectionHandlerCertificatesTask(final String taskID,
142              final Date scheduledStartTime, final List<String> dependencyIDs,
143              final FailedDependencyAction failedDependencyAction,
144              final List<String> notifyOnCompletion,
145              final List<String> notifyOnError)
146  {
147    this(taskID, scheduledStartTime, dependencyIDs, failedDependencyAction,
148         null, notifyOnCompletion, null, notifyOnError, null, null, null);
149  }
150
151
152
153  /**
154   * Creates a new reload HTTP connection handler certificates task with the
155   * provided information.
156   *
157   * @param  taskID                  The task ID to use for this task.  If it is
158   *                                 {@code null} then a UUID will be generated
159   *                                 for use as the task ID.
160   * @param  scheduledStartTime      The time that this task should start
161   *                                 running.
162   * @param  dependencyIDs           The list of task IDs that will be required
163   *                                 to complete before this task will be
164   *                                 eligible to start.
165   * @param  failedDependencyAction  Indicates what action should be taken if
166   *                                 any of the dependencies for this task do
167   *                                 not complete successfully.
168   * @param  notifyOnStart           The list of e-mail addresses of individuals
169   *                                 that should be notified when this task
170   *                                 starts running.
171   * @param  notifyOnCompletion      The list of e-mail addresses of individuals
172   *                                 that should be notified when this task
173   *                                 completes.
174   * @param  notifyOnSuccess         The list of e-mail addresses of individuals
175   *                                 that should be notified if this task
176   *                                 completes successfully.
177   * @param  notifyOnError           The list of e-mail addresses of individuals
178   *                                 that should be notified if this task does
179   *                                 not complete successfully.
180   * @param  alertOnStart            Indicates whether the server should send an
181   *                                 alert notification when this task starts.
182   * @param  alertOnSuccess          Indicates whether the server should send an
183   *                                 alert notification if this task completes
184   *                                 successfully.
185   * @param  alertOnError            Indicates whether the server should send an
186   *                                 alert notification if this task fails to
187   *                                 complete successfully.
188   */
189  public ReloadHTTPConnectionHandlerCertificatesTask(final String taskID,
190              final Date scheduledStartTime, final List<String> dependencyIDs,
191              final FailedDependencyAction failedDependencyAction,
192              final List<String> notifyOnStart,
193              final List<String> notifyOnCompletion,
194              final List<String> notifyOnSuccess,
195              final List<String> notifyOnError, final Boolean alertOnStart,
196              final Boolean alertOnSuccess, final Boolean alertOnError)
197  {
198    super(taskID, RELOAD_HTTP_CONNECTION_HANDLER_CERTIFICATES_TASK_CLASS,
199         scheduledStartTime, dependencyIDs, failedDependencyAction,
200         notifyOnStart, notifyOnCompletion, notifyOnSuccess, notifyOnError,
201         alertOnStart, alertOnSuccess, alertOnError);
202  }
203
204
205
206  /**
207   * Creates a new reload HTTP connection handler certificates task from the
208   * provided entry.
209   *
210   * @param  entry  The entry to use to create this reload HTTP connection
211   *                handler certificates task.
212   *
213   * @throws  TaskException  If the provided entry cannot be parsed as a reload
214   *                         HTTP connection handler certificates task entry.
215   */
216  public ReloadHTTPConnectionHandlerCertificatesTask(final Entry entry)
217         throws TaskException
218  {
219    super(entry);
220  }
221
222
223
224  /**
225   * Creates a new reload HTTP connection handler certificates task from the
226   * provided set of task properties.
227   *
228   * @param  properties  The set of task properties and their corresponding
229   *                     values to use for the task.  It must not be
230   *                     {@code null}.
231   *
232   * @throws  TaskException  If the provided set of properties cannot be used to
233   *                         create a valid reload HTTP connection handler
234   *                         certificates task.
235   */
236  public ReloadHTTPConnectionHandlerCertificatesTask(
237              final Map<TaskProperty,List<Object>> properties)
238         throws TaskException
239  {
240    super(RELOAD_HTTP_CONNECTION_HANDLER_CERTIFICATES_TASK_CLASS, properties);
241  }
242
243
244
245  /**
246   * {@inheritDoc}
247   */
248  @Override()
249  public String getTaskName()
250  {
251    return INFO_TASK_NAME_RELOAD_HTTP_CONNECTION_HANDLER_CERTIFICATES.get();
252  }
253
254
255
256  /**
257   * {@inheritDoc}
258   */
259  @Override()
260  public String getTaskDescription()
261  {
262    return INFO_TASK_DESCRIPTION_RELOAD_HTTP_CONNECTION_HANDLER_CERTIFICATES.
263         get();
264  }
265
266
267
268  /**
269   * {@inheritDoc}
270   */
271  @Override()
272  protected List<String> getAdditionalObjectClasses()
273  {
274    return Collections.singletonList(
275         OC_RELOAD_HTTP_CONNECTION_HANDLER_CERTIFICATES_TASK);
276  }
277}