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