com.ibm.pim.job
Interface Schedule


public interface Schedule

This is the interface for a job schedule. A job schedule is to define what is the job and when to start the job.

Since:
6.0.0

Nested Class Summary
static class Schedule.Type
          This is an enum type for schedule type.
 
Field Summary
static java.lang.String copyright
           
 
Method Summary
 void delete()
          Delete the job schedule.
 User getCreator()
          Gets the creator of the schedule.
 boolean getEnabled()
          Indicates if the schedule is enabled or not.
 java.util.List<ScheduleStatus> getHistory()
          Gets all statuses that the schedule went through, including the latest status.
 Job getJob()
          Get the job to be scheduled.
 ScheduleStatus getLatestCompletedStatus()
          Gets the completed status of last run schedule.
 int getLatestRunCompletionPercentage()
          Gets the completion percentage of the specified job schedule and return percent complete as integer number if the job is currently running, -1 otherwise.
 java.lang.String getName()
          Gets schedule name.
 java.util.Date getNextRunningTime()
          Gets the next running time of a job schedule.
 java.util.Collection<java.lang.String> getParameterNames()
          Gets the names of all parameters for the job schedule.
 java.lang.String getParameterValue(java.lang.String parameterName)
          Gets the value for the specific parameter.
 java.util.Date getStartTime()
          Gets the start time info of a job schedule.
 Schedule.Type getType()
          Gets schedule type.
 void save()
          Saves the job schedule.
 void setEnabled(boolean isEnabled)
          Enables or disables a schedule.
 void setNextRunningTime(java.util.Date nextRunningTime)
          Sets the next running time of a schedule.
 void setParameterValue(java.lang.String parameterName, java.lang.String parameterValue)
          Sets parameter for the job schedule.
 void stop()
          Stops the specified job schedule if it is currently running.
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Gets schedule name.

Returns:
the name
Throws:
PIMInternalException - If an internal error occurs.

getType

Schedule.Type getType()
Gets schedule type.

Returns:
one of the predefined job types in Schedule.Type
Throws:
PIMInternalException - If an internal error occurs.

getJob

Job getJob()
Get the job to be scheduled.

Returns:
the job object
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use.

getParameterNames

java.util.Collection<java.lang.String> getParameterNames()
Gets the names of all parameters for the job schedule.

Returns:
a list of parameter names
Throws:
PIMInternalException - If an internal error occurs.

getParameterValue

java.lang.String getParameterValue(java.lang.String parameterName)
Gets the value for the specific parameter.

Parameters:
parameterName - the parameter name
Returns:
the parameter value
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If parameterName is null or empty.

setParameterValue

void setParameterValue(java.lang.String parameterName,
                       java.lang.String parameterValue)
Sets parameter for the job schedule.

Parameters:
parameterName - the parameter name
parameterValue - the value String
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If parameterName or parameterValue is null or empty.

getLatestCompletedStatus

ScheduleStatus getLatestCompletedStatus()
Gets the completed status of last run schedule.

Returns:
one of the predefined job statuses in ScheduleStatus
Throws:
PIMInternalException - If an internal error occurs.

getHistory

java.util.List<ScheduleStatus> getHistory()
Gets all statuses that the schedule went through, including the latest status. The statuses are returned in the chronological order which is determined by the index.

Returns:
an array of the predefined job statuses in ScheduleStatus
Throws:
PIMInternalException - If an internal error occurs.

getLatestRunCompletionPercentage

int getLatestRunCompletionPercentage()
Gets the completion percentage of the specified job schedule and return percent complete as integer number if the job is currently running, -1 otherwise.

Returns:
the percentage of progress
Throws:
PIMInternalException - If an internal error occurs.

getNextRunningTime

java.util.Date getNextRunningTime()
Gets the next running time of a job schedule.

Returns:
the date for next run of a job schedule
Throws:
PIMInternalException - If an internal error occurs.

setNextRunningTime

void setNextRunningTime(java.util.Date nextRunningTime)
Sets the next running time of a schedule.

Parameters:
nextRunningTime - a date for next run of a job schedule
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If nextRunningTime is null.

getStartTime

java.util.Date getStartTime()
Gets the start time info of a job schedule.

Returns:
the date for time info of a job schedule
Throws:
PIMInternalException - If an internal error occurs.

getEnabled

boolean getEnabled()
Indicates if the schedule is enabled or not.

Returns:
true if it is enabled, or false if not
Throws:
PIMInternalException - If an internal error occurs.

setEnabled

void setEnabled(boolean isEnabled)
Enables or disables a schedule.

Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - If the user is not allowed to perform this operation

save

void save()
Saves the job schedule. This must be done for any changes to the schedule to take effect.

Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use.

delete

void delete()
Delete the job schedule.

Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use.

stop

void stop()
Stops the specified job schedule if it is currently running.

Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use.

getCreator

User getCreator()
Gets the creator of the schedule.

Returns:
the User object.
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use.