001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008-2010 Sun Microsystems, Inc.
025 */
026
027package org.opends.server.tools.tasks;
028
029import org.opends.server.types.RawAttribute;
030import org.opends.server.backends.task.FailedDependencyAction;
031
032import java.util.List;
033import java.util.Date;
034
035/**
036 * Interface for tools that are capable of scheduling a task remotely
037 * through the task backend.
038 *
039 * @see TaskClient
040 */
041public interface TaskScheduleInformation {
042
043
044  /**
045   * Adds utility specific attributes to <code>attributes</code> for
046   * population of the entry that is added to the task backend.
047   *
048   * @param attributes that will be added to the task backend
049   */
050  void addTaskAttributes(List<RawAttribute> attributes);
051
052
053  /**
054   * Gets the objectclass used to represent scheduled instances of this
055   * utility in the task backend.
056   *
057   * @return String representation of this utilities objectclass
058   */
059  String getTaskObjectclass();
060
061
062  /**
063   * Gets the Class that implements the utility to execute.
064   *
065   * @return class of the tasks implementation
066   */
067  Class<?> getTaskClass();
068
069
070  /**
071   * Gets the date at which this task should be scheduled to start.
072   *
073   * @return date/time at which the task should be scheduled
074   */
075  Date getStartDateTime();
076
077
078  /**
079   * Gets an arbitrary task id assigned to this task.
080   *
081   * @return assigned task id if any or <CODE>null</CODE> otherwise.
082   */
083  String getTaskId();
084
085
086  /**
087   * Gets the date/time pattern for recurring task schedule.
088   *
089   * @return recurring date/time pattern at which the task
090   *         should be scheduled.
091   */
092  String getRecurringDateTime();
093
094
095  /**
096   * Gets a list of task IDs upon which this task is dependent.
097   *
098   * @return list of task IDs
099   */
100  List<String> getDependencyIds();
101
102
103  /**
104   * Gets the action to take should one of the dependent task fail.
105   *
106   * @return action to take
107   */
108  FailedDependencyAction getFailedDependencyAction();
109
110
111  /**
112   * Gets a list of email address to which an email will be sent when this
113   * task completes.
114   *
115   * @return list of email addresses
116   */
117  List<String> getNotifyUponCompletionEmailAddresses();
118
119
120  /**
121   * Gets a list of email address to which an email will be sent if this
122   * task encounters an error during execution.
123   *
124   * @return list of email addresses
125   */
126  List<String> getNotifyUponErrorEmailAddresses();
127
128
129}