edu.nrao.sss.model.project
Interface ScheduleEntry

All Known Implementing Classes:
ExecutionBlock

public interface ScheduleEntry

A single schedulable entry of a scheduling block. Each iteration is considered to be a separately schedulable event and is represented by an instance of this class.

Version Info:

$Revision$
$Date$
$Author$ (last person to modify)

Since:
2007-08-17
Author:
David M. Harland

Method Summary
 EventStatus getExecutionStatus()
          Returns information about where this entry is in its life cycle.
 Date getExecutionStatusChangeDate()
          Returns the point in time when this entry's status changed to its current value.
 SchedulingBlock getSchedulingBlock()
          The scheduling block from which this entry was created.
 String toXml()
          Returns an XML representation of this entry.
 void updateStatusCancel()
          Cancels this entry so that it will never be executed or rescheduled.
 void updateStatusComplete()
          Brings this entry to a successful completion.
 void updateStatusExecute()
          Executes this entry.
 void updateStatusFail()
          Indicates that an execution in progress failed to complete.
 void updateStatusHold()
          Removes this entry from the schedule, with the intention of doing so temporarily.
 void updateStatusRelease()
          Releases this entry from the on-hold state so that it may be rescheduled.
 void updateStatusReschedule()
          Puts this entry back in the not-yet-scheduled state, thereby making it available for rescheduling.
 void updateStatusSchedule()
          Schedules this entry to be executed at the given time.
 void updateStatusSubmit()
          Submits this entry for scheduling.
 void writeAsXmlTo(Writer writer)
          Writes an XML representation of this entry to writer.
 

Method Detail

getSchedulingBlock

SchedulingBlock getSchedulingBlock()
The scheduling block from which this entry was created.

Returns:
this entry's containing scheduling block.

getExecutionStatus

EventStatus getExecutionStatus()
Returns information about where this entry is in its life cycle.

Returns:
the execution status of this entry.

getExecutionStatusChangeDate

Date getExecutionStatusChangeDate()
Returns the point in time when this entry's status changed to its current value.

Returns:
the point in time when this entry's status changed to its current value.

updateStatusSubmit

void updateStatusSubmit()
                        throws IllegalTransitionException
Submits this entry for scheduling.

This method is called on an entry that has just been made ready for scheduling. Typically such an entry has a status of not-ready-for-scheduling. This method will change the entry's status to not-yet-scheduled.

(The reason for the new updateStatus prefix is two fold. First, it is meant to indicate that we're not truly performing the action that the final verb indicates; only a controller of this model can really do that. The model does, though, ensure the transition is legal and may update more things than just a status property. The second reason is that using a common prefix puts all status-altering methods next to each other in an alphabetical listing. We could have collapsed these into one method with a parameter, but the EventStatus and EventSetStatus enumeration elements do not map one-to-one with these methods.)

Throws:
IllegalTransitionException - if this entry is not in a state where it may be submitted for scheduling. For example, it would be illegal to schedule an entry that has already been canceled.

updateStatusSchedule

void updateStatusSchedule()
                          throws IllegalTransitionException
Schedules this entry to be executed at the given time.

This method may be called on an entry that has already been scheduled if the client wishes to change the time at which it should be executed.

See updateStatusSubmit() for an explanation of the new updateStatus prefix.

Parameters:
futureTime - the time at which the entry should be executed.
Throws:
IllegalTransitionException - if this entry is not in a state where it may be scheduled. For example, it would be illegal to schedule an entry that has already been executed.
See Also:
#reschedule()

updateStatusExecute

void updateStatusExecute()
                         throws IllegalTransitionException
Executes this entry.

This method is called on an entry that has been scheduled but has not yet been executed.

See updateStatusSubmit() for an explanation of the new updateStatus prefix.

Throws:
IllegalTransitionException - if this entry is not in the scheduled-but-not-started state.

updateStatusComplete

void updateStatusComplete()
                          throws IllegalTransitionException
Brings this entry to a successful completion.

This method is called on an entry that has was most recently in the in-progress state.

See updateStatusSubmit() for an explanation of the new updateStatus prefix.

Throws:
IllegalTransitionException - if this entry is not currently in-progress.

updateStatusFail

void updateStatusFail()
                      throws IllegalTransitionException
Indicates that an execution in progress failed to complete.

This method is called on an entry that has was most recently in the in-progress state. If a human wishes to stop an in-progress entry, the cancel method should be used. This method should be called by the execution process, or its proxy, to indicate that execution failed.

Throws:
IllegalTransitionException - if this entry is not in-progress.

updateStatusCancel

void updateStatusCancel()
                        throws IllegalTransitionException
Cancels this entry so that it will never be executed or rescheduled.

See updateStatusSubmit() for an explanation of the new updateStatus prefix.

Throws:
IllegalTransitionException - if this entry is not in a state where it may be canceled. For example, it would be illegal to cancel an entry that has already been completed successfully.

updateStatusReschedule

void updateStatusReschedule()
                            throws IllegalTransitionException
Puts this entry back in the not-yet-scheduled state, thereby making it available for rescheduling.

See updateStatusSubmit() for an explanation of the new updateStatus prefix.

Throws:
IllegalTransitionException - if this entry is not in a state where it may be rescheduled. Only entries that have been scheduled but not yet started may be rescheduled.

updateStatusHold

void updateStatusHold()
                      throws IllegalTransitionException
Removes this entry from the schedule, with the intention of doing so temporarily. Once on hold, only the #release() and #cancel() methods can take it out of the on-hold state.

See updateStatusSubmit() for an explanation of the new updateStatus prefix.

Throws:
IllegalTransitionException - if this entry is not in a state where it may be held. An entry may be placed on hold only if it has not yet been scheduled, or if it has been scheduled but not yet started.

updateStatusRelease

void updateStatusRelease()
                         throws IllegalTransitionException
Releases this entry from the on-hold state so that it may be rescheduled. Once released, this entry's status will be not-yet-scheduled and it will be ready for reconsideration.

See updateStatusSubmit() for an explanation of the new updateStatus prefix.

Throws:
IllegalTransitionException - if this entry is not in a state where it may be released. Only entries that are on hold may be released.

toXml

String toXml()
             throws JAXBException
Returns an XML representation of this entry.

Returns:
an XML representation of this entry.
Throws:
JAXBException - if anything goes wrong during the conversion to XML.
See Also:
writeAsXmlTo(Writer)

writeAsXmlTo

void writeAsXmlTo(Writer writer)
                  throws JAXBException
Writes an XML representation of this entry to writer.

Parameters:
writer - the device to which XML is written.
Throws:
JAXBException - if anything goes wrong during the conversion to XML.


Copyright © 2009. All Rights Reserved.