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