TaskEntry.java revision 36bb690a409d9e6e3defd678f47acbbf02bd9167
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Portions Copyright 2007 Sun Microsystems, Inc.
*/
/**
* Processes information from a task entry from the directory and
* provides accessors for attribute information. In some cases the
* data is formatted into more human-friendly formats.
*/
public class TaskEntry {
// These attributes associated with the ds-task object
// class are all handled explicitly below in the constructor
static {
}
private String schedStart;
private String depFailAct;
/**
* Task of the same type that implements. Used for obtaining
* task name and attribute display information.
*/
/**
* Creates a parameterized instance.
*
* @param entry to wrap
*/
String p = "ds-task-";
// Build a map of non-superior attribute value pairs for display
// See if we've handled it already above
}
}
}
}
}
}
/**
* Gets the DN of the wrapped entry.
*
* @return DN of entry
*/
return dn;
}
/**
* Gets the ID of the task.
*
* @return String ID of the task
*/
return id;
}
/**
* Gets the name of the class implementing the task represented here.
*
* @return String name of class
*/
public String getClassName() {
return className;
}
/**
* Gets the state of the task.
*
* @return Message representing state
*/
m = ts.getDisplayName();
}
}
return m;
}
/**
* Gets the human-friendly scheduled time.
*
* @return String time
*/
public Message getScheduledStartTime() {
return formatTimeString(schedStart);
}
/**
* Gets the human-friendly start time.
*
* @return String time
*/
public Message getActualStartTime() {
return formatTimeString(actStart);
}
/**
* Gets the human-friendly completion time.
*
* @return String time
*/
public Message getCompletionTime() {
return formatTimeString(compTime);
}
/**
* Gets the IDs of tasks upon which this task depends.
*
* @return array of IDs
*/
}
/**
* Gets the action to take if this task fails.
*
* @return String action
*/
public Message getFailedDependencyAction() {
if (depFailAct != null) {
m = fda.getDisplayName();
}
}
return m;
}
/**
* Gets the logs associated with this task's execution.
*
* @return array of log messages
*/
}
}
/**
* Gets the email messages that will be used for notifications
* when the task completes.
*
* @return array of email addresses
*/
}
/**
* Gets the email messages that will be used for notifications
* when the task encounters an error.
*
* @return array of email addresses
*/
}
/**
* Gets a user presentable string indicating the type of this task.
*
* @return Message type
*/
try {
}
} catch (Exception e) {
// ignore; this is best effort
}
}
}
// If we still can't get the type just resort
// to the class displayName
}
}
return type;
}
/**
* Indicates whether or not this task supports a cancel operation.
*
* @return boolean where true means this task supports being canceled.
*/
public boolean isCancelable() {
boolean cancelable = false;
task.isInterruptable()));
}
return cancelable;
}
/**
* Gets a mapping of attributes that are specific to the implementing
* task as opposed to the superior, or base, task.
*
* @return mapping of atribute field labels to lists of string values for
* each field.
*/
return taskSpecificAttrValues;
}
/**
* Gets the task state.
*
* @return TaskState of task
*/
public TaskState getTaskState() {
}
return ts;
}
/**
* Indicates whether or not this task is done.
*
* @return boolean where true means this task is done
*/
public boolean isDone() {
}
}
}
return "";
}
}
}
}
}
return valuesList;
}
try {
"getAttributeDisplayName", String.class);
}
} catch (Exception e) {
// ignore
}
}
}
}
return name;
}
/**
* Formats a log message for appending to the table.
* @param msg to format
* @return formatted message
*/
// Use this to prepend to log messages. Since they
// are long and usually wrap, without this it is
// difficult to tell where one stops and another starts
}
/**
* Formats a time string into a human friendly format.
* @param timeString the is human hostile
* @return string of time that is human friendly
*/
try {
} else {
}
} catch (ParseException pe){
}
}
return ret;
}
try {
}
} catch (Exception e) {
// ignore; this is best effort
}
}
return task;
}
}