TaskEntry.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* 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 legal-notices/CDDLv1_0.txt
* 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 legal-notices/CDDLv1_0.txt.
* 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
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* 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 {
private int hashCode;
// 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
}
}
}
}
}
}
/**
* Retrieves a hash code for this task entry.
*
* @return The hash code for this task entry.
*/
public int hashCode()
{
return hashCode;
}
/**
* {@inheritDoc}
*/
{
if (this == o)
{
return true;
}
if (o == null)
{
return false;
}
if (! (o instanceof TaskEntry))
{
return false;
}
}
/**
* 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 LocalizableMessage representing state
*/
public LocalizableMessage getState() {
m = ts.getDisplayName();
}
}
return m;
}
/**
* Gets the human-friendly scheduled time.
*
* @return String time
*/
public LocalizableMessage getScheduledStartTime() {
return formatTimeString(schedStart);
}
/**
* Gets the human-friendly start time.
*
* @return String time
*/
public LocalizableMessage getActualStartTime() {
return formatTimeString(actStart);
}
/**
* Gets the human-friendly completion time.
*
* @return String time
*/
public LocalizableMessage getCompletionTime() {
return formatTimeString(compTime);
}
/**
* Gets recurring schedule tab.
*
* @return LocalizableMessage tab string
*/
public LocalizableMessage getScheduleTab() {
}
/**
* 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 LocalizableMessage getFailedDependencyAction() {
LocalizableMessage m = null;
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 LocalizableMessage type
*/
public LocalizableMessage getType() {
}
}
// 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);
name= (LocalizableMessage)o;
}
} catch (Exception e) {
// ignore
}
}
}
}
return name;
}
/**
* 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;
}
}