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