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