|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.model.project.SchedulingBlock
public class SchedulingBlock
The shortest allowable contiguous block of observing time on a telescope. This is the atomic unit of observing.
A SchedulingBlock
is contained in a ProgramBlock
. The program
block defines the configuration of the telescope. A program block may
need to be broken into several scheduling blocks if, for example,
20 hours of observing time was needed for the program block, but the
target source was not available for 20 consecutive hours of observing.
Version Info:
$Revision: 2277 $ |
$Date: 2009-04-29 11:19:38 -0600 (Wed, 29 Apr 2009) $ |
$Author: dharland $ |
Field Summary | |
---|---|
static String |
DEFAULT_NAME
|
Fields inherited from interface edu.nrao.sss.model.project.scheduling.Schedulable |
---|
NAME_SEPARATOR, OBSERVE_SCRIPT_NOT_FOUND |
Fields inherited from interface edu.nrao.sss.util.Identifiable |
---|
UNIDENTIFIED |
Fields inherited from interface edu.nrao.sss.model.UserAccountable |
---|
NULL_USER_ID |
Constructor Summary | |
---|---|
SchedulingBlock()
Creates a new instance. |
Method Summary | |
---|---|
boolean |
addPrerequisite(SchedulingBlock newPrereq)
Adds newPrereq to this scheduling block's set of direct
prerequisites. |
void |
appendComments(String additionalComments)
Adds additional comments to those already associated with this scheduling block. |
void |
appendCommentsToOperator(String additionalComments)
Adds additional comments to those already associated with this scheduling block. |
TimeDuration |
calculateTimePerExecution()
Returns the amount of time allocated for one execution of this scheduling block. |
boolean |
canBeScheduled()
Returns true if this scheduling block can be scheduled for observation in the face of the given conditions. |
void |
clearId()
Resets this sb's id to UNIDENTIFIED and calls it's scan sequence's and execution block's clearId() methods. |
SchedulingBlock |
clone()
Returns a scheduling block that is almost a copy of this one. |
SchedulingBlock |
cloneWithoutPrerequisites()
Returns a scheduling block that is almost a copy of this one. |
boolean |
contains(ScanLoopElement scanOrScanLoop,
EqualityMethod equalityMethod)
Returns true if this scheduling block contains scanOrScanLoop . |
Scan |
createScan(ScanMode scanMode)
Creates and returns a new scan that is suitable for use with this scheduling block. |
boolean |
equals(Object o)
Returns true if o is equal to this scheduling block. |
SchedulingConstraint |
evaluateSchedulability()
Returns SchedulingConstraint.NONE if this scheduling block
may be scheduled for observation in the face of the given conditions. |
static SchedulingBlock |
fromXml(Reader reader)
Creates a new scheduling block based on the XML data read from reader . |
static SchedulingBlock |
fromXml(String xmlFile)
Creates a new scheduling block from the XML data in the given file. |
int |
getAbortedCount()
Returns the number of times an execution of this scheduling block has been aborted. |
Set<SchedulingBlock> |
getAllPrerequisites()
Returns a set containing all direct and indirect prerequisites of this scheduling block. |
AlterationStatus |
getAlterationStatus()
Returns information about the manner in which this scheduling block was created and altered. |
EvlaPointingPosition |
getAssumedTelescopePointing()
Returns the position at which the telescope is assumed to be pointing just prior to the start of this scheduling block. |
int |
getAuthorizedCount()
Returns the number of executions authorized for this block. |
String |
getComments()
Returns comments about this scheduling block. |
String |
getCommentsToOperator()
Returns comments intended for use by an operator. |
int |
getCompletedCount()
Returns the number of successful executions of this block. |
String |
getCompleteName()
|
List<Constraint> |
getConstraints()
Deprecated. Returns an empty list. |
Long |
getCreatedBy()
Returns the ID of the user who created this object. |
Date |
getCreatedOn()
Returns the date on which this object was created. |
Set<SchedulingBlock> |
getDirectPrerequisites()
Returns this scheduling block's set of direct prerequisites. |
EnvironmentalConstraints |
getEnvironmentalConstraints()
Returns the environmental scheduling constraints of this block. |
List<ExecutionBlock> |
getExecutionBlocks()
Returns a complete collection of this scheduling block's execution blocks. |
EventSetStatus |
getExecutionStatus()
Returns this scheduling block's execution status. |
Date |
getFixedStartTime()
Returns either the time this block must be executed or null, if this block may be dynamically scheduled. |
Long |
getId()
|
Long |
getLastUpdatedBy()
Returns the ID of the user who most recently updated this object. |
Date |
getLastUpdatedOn()
Returns the most recent date on which this object was updated. |
String |
getLongName()
Deprecated. |
TimeOfDayInterval |
getLstStartRange()
Returns the range of allowable execution start times for this scheduling block, expressed in local sidereal time. |
TimeDuration |
getMonitoringInterval()
Returns the amount of time between successive executions of this block. |
String |
getName()
Returns the name of this scheduling block. |
SchedulingBlock |
getParentBlock()
Returns this block's parent, or null if it has no parent. |
TimeInterval |
getPreferredDateRange()
Returns the preferred date range for execution of this scheduling block. |
static Comparator<SchedulingBlock> |
getPrequisiteComparator()
Returns a comparator that places all prerequisites before the blocks that depend upon them. |
List<Priority> |
getPriorities()
Returns the set of priorities for this scheduling block. |
ProgramBlock |
getProgramBlock()
Returns the program block to which this scheduling block belongs, if any. |
String |
getProgramName()
|
Project |
getProject()
Returns the project to which this scheduling block belongs. |
String |
getProjectName()
|
String |
getProposalName()
|
Collection<ScheduleEntry> |
getReadyToScheduleEntries(Collection<ScheduleEntry> destination)
Returns the schedule entries of this block that are ready for scheduling. |
Set<Scan> |
getScans()
Returns the scans that belong to this scheduling block. |
ScanLoop |
getScanSequence()
Returns this scheduling block's sequence of scans. |
Collection<ScheduleEntry> |
getScheduleEntries(EventStatus execStatus,
Collection<ScheduleEntry> destination)
Returns the schedule entries of this block that have an execution status of execStatus . |
List<ServiceCalibration> |
getServiceCalibrations()
Returns a list of the service calibrations required by this scheduling block. |
String |
getShortName()
Deprecated. |
Set<Source> |
getSources()
Returns the sources to be observed by this scheduling block at the current time. |
Set<Source> |
getSources(Date dateTime)
Returns the sources to be observed by this scheduling block at dateTime . |
TimeDuration |
getTotalTime()
Returns the total time allocated to this scheduling block. |
SchedulingType |
getType()
Returns the scheduling type to use for this scheduling block. |
boolean |
hasFixedStartTime()
Returns true if this block must be executed at an exact point in time. |
int |
hashCode()
|
boolean |
hasParentBlock()
Returns true if this block has a parent block. |
boolean |
hasPrerequisites()
Returns true if this block has one or more prequisite blocks. |
boolean |
hasProgramBlock()
Returns true if this scheduling block has a non-null program block. |
boolean |
isDirectPrerequisiteOf(SchedulingBlock schedBlock)
Returns true if this scheduling block is a direct prerequisite of schedBlock . |
boolean |
isPrerequisiteOf(SchedulingBlock schedBlock)
Returns true if this scheduling block is either a direct or indirect prerequisite of schedBlock . |
boolean |
isTest()
Returns true if this block is part of a test program . |
boolean |
mayBeScheduledDynamically()
Returns true if this block may be scheduled dynamically. |
void |
removeAllPrerequisites()
Clears this scheduling block's set of prerequisites. |
boolean |
removePrerequisite(SchedulingBlock oldPrereq)
Removes oldPrereq from this scheduling block's set of
direct prerequisites. |
void |
removeScan(Scan scan,
EqualityMethod equalityMethod)
Removes all occurrences of the given scan from this scheduling block. |
void |
reset()
Resets this scheduling block to its initial state. |
void |
setAssumedTelescopePointing(EvlaPointingPosition newPosition)
Sets the position at which the telescope is assumed to be pointing just prior to the start of this scheduling block. |
void |
setAuthorizedCount(int newCount)
Sets the number of executions authorized for this block. |
void |
setComments(String replacementComments)
Sets comments about this scheduling block. |
void |
setCommentsToOperator(String replacementComments)
Stores comments intended for use by an operator. |
void |
setConstraints(List<Constraint> replacementList)
Deprecated. Does nothing. |
void |
setCreatedBy(Long userId)
Sets the ID of the user who created this object. |
void |
setCreatedOn(Date d)
Sets the date on which this object was created. |
void |
setFixedStartTime(Date startTime)
Changes the type of this block to SchedulingType.FIXED_DATE and
sets the start time. |
void |
setLastUpdatedBy(Long userId)
Sets the ID of the user who most recently updated this object. |
void |
setLastUpdatedOn(Date d)
Sets the date on which this object was most recently updated. |
void |
setLongName(String newName)
Deprecated. |
void |
setLstStartRange(TimeOfDayInterval range)
Sets the range of allowable execution start times for this scheduling block, expressed in local sidereal time. |
void |
setMonitoringInterval(TimeDuration interval)
Sets the amount of time between successive executions of this block. |
void |
setName(String newName)
Sets the name of this scheduling block. |
void |
setPreferredDateRange(TimeInterval range)
Sets the preferred date range for execution of this scheduling block. |
void |
setPriorities(List<Priority> replacementList)
Sets the set of priorities of this scheduling block. |
void |
setProgramBlock(ProgramBlock newProgBlock)
Sets the program block to which this scheduling block belongs. |
void |
setServiceCalibrations(List<ServiceCalibration> replacementList)
Replaces this block's list of service calibrations with replacementList . |
void |
setShortName(String newName)
Deprecated. |
void |
setType(SchedulingType newType)
Sets the scheduling type to use for this scheduling block. |
void |
submit()
Prepares this scheduling block for scheduling. |
String |
toObserveScript()
Returns an observation script that is used to control a telescope. |
String |
toObserveScript(Date startingDate)
Returns an observation script that is used to control a telescope. |
String |
toString()
Returns a text representation of this scheduling block. |
String |
toSummaryString()
Returns a short textual description of this scheduling block. |
String |
toXml()
Returns an XML representation of this scheduling block. |
SchedulingBlock |
unsubmit()
Puts an end to the life cycle of this block and potentially creates a replacement block. |
boolean |
useDefaultAssumedTelescopePointing()
Returns true if the position provided by getAssumedTelescopePointing() is a default position. |
void |
writeAsXmlTo(Writer writer)
Writes an XML representation of this scheduling block to writer . |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_NAME
Constructor Detail |
---|
public SchedulingBlock()
Method Detail |
---|
public void reset()
public Long getId()
getId
in interface Identifiable
public void clearId()
public void setName(String newName)
If newName
is null or the empty string
(""), the request to change the name will be
denied and the current name will remain in place.
setName
in interface Schedulable
newName
- the new name of this scheduling block.public String getName()
getName
in interface Schedulable
@Deprecated public String getLongName()
@Deprecated public void setLongName(String newName)
@Deprecated public String getShortName()
@Deprecated public void setShortName(String newName)
public String getProgramName()
getProgramName
in interface Schedulable
public String getProjectName()
getProjectName
in interface Schedulable
public String getProposalName()
getProposalName
in interface Schedulable
public String getCompleteName()
getCompleteName
in interface Schedulable
public Project getProject()
public void setProgramBlock(ProgramBlock newProgBlock)
If this scheduling block is currently contained in a program block
that is not the same as the newProgBlock
parameter,
the current program block will be told to remove this scheduling block
from its collection of scheduling blocks. If newProgBlock
is not null, it will be told to add this scheduling block
to its collection. Finally, this scheduling block's program block
will be set to newProgBlock
, even if it is null.
Passing this method a newProgBlock
of null has the
effect of disconnecting this scheduling block from any program block.
newProgBlock
- the program block to which this scheduling block belongs.public ProgramBlock getProgramBlock()
This scheduling block may be one of several that belong to the same program block. If this scheduling block belongs to no program block, the value returned is null.
getProgramBlock
in interface Schedulable
hasProgramBlock()
public boolean hasProgramBlock()
Scheduling blocks should normally be contained within, and therefore have a non-null, program block. However, there are some situations where this method will return false:
getProgramBlock()
and know that
it will return a non-null object.public Scan createScan(ScanMode scanMode)
public void removeScan(Scan scan, EqualityMethod equalityMethod)
In order for element
to be removed from this block, it must
be contained by this block.
Containment is determined by the equalityMethod
provided.
If this parameter is null, EqualityMethod.VALUE
will
be used.
scan
- the scan to be removed.equalityMethod
- determines whether containment is based on reference
or value equality. A value of null will be
interpreted as a signal to use value equality.public Set<Scan> getScans()
The returned Set
is not held directly by this
scheduling block, so changes made to it will not be reflected
in this object. The scans in the returned set, though, are
those held by this scheduling block, so changes to those
will be reflected in this object.
This is a convenience method that is equivalent to calling
getScanSequence().toScanSet()
.
public ScanLoop getScanSequence()
public boolean contains(ScanLoopElement scanOrScanLoop, EqualityMethod equalityMethod)
scanOrScanLoop
.
Containment is determined by the equalityMethod
provided.
If this parameter is null, EqualityMethod.VALUE
will
be used.
scanOrScanLoop
- the scan or scan loop to be tested for containment.equalityMethod
- determines whether containment is based on reference
or value equality. A value of null will be
interpreted as a signal to use value equality.
scanOrScanLoop
.public boolean addPrerequisite(SchedulingBlock newPrereq)
newPrereq
to this scheduling block's set of direct
prerequisites. If this scheduling block belongs to a program block, and if
newPrereq
becomes a prerequisite of this one, then
newPrereq
is added to this program block, because a scheduling
block that is part of a program block may have as prerequisites only those
scheduling blocks that belong to the same program block.
In order to prevent a circular chain of dependencies, newPrereq
will not be added to this scheduling block's set if this block is
a prerequisite of newPrereq
.
Direct vs. Indirect Prerequisites
The prerequisite methods of this class often
refer to direct or indirect prerequisites. This section
explains the meanings of those terms. Consider this set of dependencies:
A)--+---------------+ |-->E)--+ | B)--+ | |-->G)-->H C |-->F)--+ D)----------+where the notation
X)-->Y
means that Y
is dependent on the
completion of X
or, alternatively, X
is a prerequisite of
Y
.
Scheduling block E
has two prerequisites, A
and B
,
each of which is direct.
Scheduling block F
has two direct prerequisites, D
and
E
, and two indirect prerequisites, A
and B
.
Scheduling block G
is interesting because A
serves as both
a direct and an indirect (via F
and E
) prerequisite.
Methods that refer only to prerequisite without the direct or indirect adjective mean a prerequisite of any type.
newPrereq
- a new direct prerequisite for this scheduling block.
newPrereq
was added to this scheduling
block's set of direct prerequisites.newPrereq
is nullnewPrereq
is already an direct prerequisite
of this scheduling blocknewPrereq
.
public boolean removePrerequisite(SchedulingBlock oldPrereq)
oldPrereq
from this scheduling block's set of
direct prerequisites.
(For an explanation of direct versus indirect
prequisites, see the note in the
addPrerequisite(SchedulingBlock)
method.)
oldPrereq
- the prerequisite to be removed from this scheduling
block's set of direct prerequisites.
oldPrereq
was successfully removed.
Note that a return value of false might mean that
oldPrereq
was not an direct prerequisite of
this scheduling block.public void removeAllPrerequisites()
public boolean isPrerequisiteOf(SchedulingBlock schedBlock)
schedBlock
.
(For an explanation of direct versus indirect
prerequisites, see the note in the
addPrerequisite(SchedulingBlock)
method.)
schedBlock
- the scheduling block to test.
schedBlock
.isDirectPrerequisiteOf(SchedulingBlock)
public boolean isDirectPrerequisiteOf(SchedulingBlock schedBlock)
schedBlock
.
(For an explanation of direct versus indirect
prequisites, see the note in the
addPrerequisite(SchedulingBlock)
method.)
schedBlock
- the scheduling block to test.
schedBlock
.isPrerequisiteOf(SchedulingBlock)
public boolean hasPrerequisites()
public Set<SchedulingBlock> getDirectPrerequisites()
The returned Set
is an unmodifiable set
that will not permit additions of new elements or
deletions of existing elements. Attempts to modify
the set will result in UnsupportedOperationException
s.
public Set<SchedulingBlock> getAllPrerequisites()
addPrerequisite(SchedulingBlock)
method.)
public boolean hasParentBlock()
unsubmit
operation on the parent.
getParentBlock()
public SchedulingBlock getParentBlock()
hasParentBlock()
public void setType(SchedulingType newType)
newType
is null, it will be interpreted as the
default type
.
setType
in interface Schedulable
newType
- the new scheduling type for this block.public SchedulingType getType()
getType
in interface Schedulable
public boolean mayBeScheduledDynamically()
type
is SchedulingType.FIXED_DATE
.
public AlterationStatus getAlterationStatus()
public boolean isTest()
test program
.
public EventSetStatus getExecutionStatus()
getExecutionStatus
in interface Schedulable
public void submit()
This method is intended to be used no more than once on this scheduling block. It will not have any effect unless this scheduling block is in its initial status of not-ready-to-be-scheduled. Note that this method no longer checks this block for warnings and errors. It is now the responsibility of clients to decide if this block is fit for scheduling.
When called on a block in its initial status, this method will result in
the creation of a number of execution blocks equal to the
authorized count
of this block and will
result in a new status of not-yet-scheduled.
RuntimeException
- if this block has not yet been scheduled but already has execution blocks.
Only an internal programmer error should lead to this situation
(or perhaps bad data coming from a persistent store, such as XML or a
database).public SchedulingBlock unsubmit()
Modifications of This Block
The authorization count of this block is set to the number of successful
iterations. This means that after the call this block is no longer
authorized for more iterations, and that it has a status of complete
or canceled.
Creation of a Replacement Block
If at the time this block was unsubmitted it had more authorized iterations,
those iterations will be transfered to a replacement block. It is this
replacement block that is returned. The replacement block will have an
authorized count equal to the unrun iterations of this block. The
replacement block will have this block as a parent
.
The replacement block will be in a not-ready-to-be-scheduled state with
no execution blocks, meaning that it may be later submitted. Finally,
if this block was a prerequisite of any other blocks, those blocks will
now depend on the replacement and not on this one.
If this block had no more authorized iterations at the time of the unsubmit, there will be no replacement and the return value will be null.
public int getAuthorizedCount()
getAuthorizedCount
in interface Schedulable
public void setAuthorizedCount(int newCount)
The authorized count may never be set to a value less than that of the number of successful executions already completed. An attempt to set the value below this minimum will be silently reinterpreted as a request to set it to this minimum. This means that a convenient way to prevent future runs of this block is to use a value less than one.
If the request to increase or decrease the number of authorized iterations is made prior to submitting this block for scheduling, then the authorized count is simply updated to the requested value (subject to the paragraph above). If, though, the request is made after this block has already been submitted, this method will attempt to add or remove execution blocks.
setAuthorizedCount
in interface Schedulable
newCount
- the new number of executions authorized for this block.public int getCompletedCount()
getCompletedCount
in interface Schedulable
public int getAbortedCount()
public Collection<ScheduleEntry> getScheduleEntries(EventStatus execStatus, Collection<ScheduleEntry> destination)
execStatus
. Only the status of the
entries is considered. This method does not look, for example, at the
isTest()
property.
execStatus
- the execution status of the schedule entries to be added
to destination
.destination
- the collection to which the schedule entries should be
added. If this collection is null, a new one
will be created. This collection is returned.
destination
or a new collection, if destination
is
null.getReadyToScheduleEntries(Collection)
public Collection<ScheduleEntry> getReadyToScheduleEntries(Collection<ScheduleEntry> destination)
destination
- the collection to which the ready-to-be-scheduled
entries should be added. If this collection is
null, a new one will be created. This
collection is returned.
destination
or a new collection, if destination
is
null.getScheduleEntries(EventStatus, Collection)
public List<ExecutionBlock> getExecutionBlocks()
public boolean hasFixedStartTime()
public Date getFixedStartTime()
public void setFixedStartTime(Date startTime)
SchedulingType.FIXED_DATE
and
sets the start time.
startTime
- the time at which this block must be executed. If this value is
null this method does nothing.public TimeDuration calculateTimePerExecution()
calculateTimePerExecution
in interface Schedulable
ValidationException
- if this method is unable to calculate the SB's
length due to a lack of information in the SB.public TimeDuration getTotalTime()
public void setPreferredDateRange(TimeInterval range)
Note that this scheduling block will not hold a reference to
range
, but will instead keep a copy of it.
setPreferredDateRange
in interface Schedulable
range
- the preferred date range for execution of this scheduling
block.public TimeInterval getPreferredDateRange()
getPreferredDateRange
in interface Schedulable
public void setLstStartRange(TimeOfDayInterval range)
Note that this scheduling block will hold a reference to range
(unless it is null); it will not store a copy. This means
that any changes a client makes to range
after
calling this method will be reflected in this object.
setLstStartRange
in interface Schedulable
range
- public TimeOfDayInterval getLstStartRange()
The returned range, which is guaranteed to be non-null, is the actual range held by this block, so changes made to it will be reflected in this object.
getLstStartRange
in interface Schedulable
public void setMonitoringInterval(TimeDuration interval)
Note that this scheduling block will hold a reference to interval
(unless it is null); it will not store a copy. This means
that any changes a client makes to interval
after
calling this method will be reflected in this object.
interval
- the amount of time between successive executions of this
block.public TimeDuration getMonitoringInterval()
The returned amount, which is guaranteed to be non-null, is the actual amount held by this block, so changes made to it will be reflected in this object.
@Deprecated public void setConstraints(List<Constraint> replacementList)
Schedulable
setConstraints
in interface Schedulable
replacementList
- a set of environmental and telescopes constraints such as
recent calibration accuracies that can be used to determine the success
of this scheduling block under current conditions.@Deprecated public List<Constraint> getConstraints()
Schedulable
getConstraints
in interface Schedulable
public EnvironmentalConstraints getEnvironmentalConstraints()
The returned object, which is guaranteed to be non-null, is the actual instance held by this block, so changes made to it will be reflected in this scheduling block.
public void setAssumedTelescopePointing(EvlaPointingPosition newPosition)
A value of null is permitted and will result in the
corresponding getter
returning
a default position. Note that when newPosition
is not null
this method does not hold a reference to it, but holds a copy.
newPosition
- the new assumed telescope pointing position.public EvlaPointingPosition getAssumedTelescopePointing()
corresponding setter
or, if that value was null, is a default
position.
The returned object is not held internally by this scheduling block, so changes made to it will not be reflected herein.
public boolean useDefaultAssumedTelescopePointing()
getAssumedTelescopePointing()
is a default position.
public void setPriorities(List<Priority> replacementList)
setPriorities
in interface Schedulable
replacementList
- a set of priorities representing the importance of
this scheduling block with regard to a variety of criteria such
as scientific rating, etc.
If replacementList
is null, it will be interpreted
as an empty list.public List<Priority> getPriorities()
getPriorities
in interface Schedulable
public Set<Source> getSources()
SourceLookupTable
s held
by this scheduling block.
public Set<Source> getSources(Date dateTime)
dateTime
. The dateTime
parameter is used to evaluate
any SourceLookupTable
s held
by this scheduling block.
dateTime
- the time for which sources are requested.
public void setServiceCalibrations(List<ServiceCalibration> replacementList)
replacementList
.
replacementList
- a replacement list of service calibrations for this
scheduling block. If replacementList
is
null, it will be interpreted as an empty
list.public List<ServiceCalibration> getServiceCalibrations()
The return value is guaranteed to be non-null. It is also the list that is held internally by this scheduling block, so any changes made to the returned list will be reflected in this object.
public boolean canBeScheduled()
This scheduling block compares the given conditions to its constraints and decides whether or not it may be submitted for scheduling. This method is biased toward returning a value of true so that the scheduler can be presented with as many scheduling blocks as possible. This method returns false only when the conditions are so negative (for example, if the source is not in the sky at the time of condition XXX) that scheduling makes no sense at all.
canBeScheduled
in interface Schedulable
evaluateSchedulability()
public SchedulingConstraint evaluateSchedulability()
SchedulingConstraint.NONE
if this scheduling block
may be scheduled for observation in the face of the given conditions.
If the given conditions are outside the contraints of this scheduling block, this method will return a value that indicates which constraint thwarted the scheduling. If multiple conditions are outside this block's constraints...TODO.
SchedulingConstraint.NONE
if this scheduling block
may be scheduled for observation.public void setCreatedBy(Long userId)
UserAccountable
If userId
is null, this object will be updated
not with null but with UserAccountable.NULL_USER_ID
instead.
setCreatedBy
in interface UserAccountable
userId
- the ID of the user who most recently updated this object.public void setCreatedOn(Date d)
UserAccountable
If d
is null it will be ignored and this method
will do nothing.
setCreatedOn
in interface UserAccountable
d
- the date on which this object was created.public void setLastUpdatedBy(Long userId)
UserAccountable
If userId
is null, this object will be updated
not with null but with UserAccountable.NULL_USER_ID
instead.
setLastUpdatedBy
in interface UserAccountable
userId
- the ID of the user who most recently updated this object.public void setLastUpdatedOn(Date d)
UserAccountable
If d
is null it will be ignored and this method
will do nothing.
setLastUpdatedOn
in interface UserAccountable
d
- the date on which this object was most recently updated.public Long getCreatedBy()
UserAccountable
If this object does not know the identity of the user who created
it, the returned ID will be UserAccountable.NULL_USER_ID
.
getCreatedBy
in interface UserAccountable
public Date getCreatedOn()
UserAccountable
getCreatedOn
in interface UserAccountable
public Long getLastUpdatedBy()
UserAccountable
If this object does not know the identity of the user who lasted
updated it, the returned ID will be UserAccountable.NULL_USER_ID
.
getLastUpdatedBy
in interface UserAccountable
public Date getLastUpdatedOn()
UserAccountable
getLastUpdatedOn
in interface UserAccountable
public String toObserveScript() throws ValidationException
ValidationException
public String toObserveScript(Date startingDate) throws ValidationException
toObserveScript
in interface Schedulable
startingDate
- the start date and time of the script, overrides SB
properties. Can be null (values in this SB will not be overridden
in this case).
ValidationException
- if this SB fails validation checks.public void setComments(String replacementComments)
replacementComments
- free-form text about this scheduling block.
These comments replace all previously set comments.
A null value will be replaced by the empty string ("").setCommentsToOperator(String)
,
appendComments(String)
public void appendComments(String additionalComments)
additionalComments
- new, additional, comments about this scheduling block.appendCommentsToOperator(String)
,
setComments(String)
public String getComments()
getComments()
,
appendComments(String)
,
setComments(String)
public void setCommentsToOperator(String replacementComments)
replacementComments
- comments intended for use by an operator.
These comments replace all previously set comments.
A null value will be replaced by the empty string (""}).setComments(String)
,
appendCommentsToOperator(String)
public void appendCommentsToOperator(String additionalComments)
additionalComments
- new, additional, comments to an operator for this scheduling block.appendComments(String)
,
setCommentsToOperator(String)
public String getCommentsToOperator()
getComments()
,
appendCommentsToOperator(String)
,
setCommentsToOperator(String)
public String toString()
toString
in class Object
toSummaryString()
public String toSummaryString()
public String toXml() throws JAXBException
JAXBException
- if anything goes wrong during the conversion to XML.writeAsXmlTo(Writer)
public void writeAsXmlTo(Writer writer) throws JAXBException
writer
.
writer
- the device to which XML is written.
JAXBException
- if anything goes wrong during the conversion to XML.public static SchedulingBlock fromXml(String xmlFile) throws JAXBException, XMLStreamException, FileNotFoundException
xmlFile
- the name of an XML file. This method will attempt to locate
the file by using Class.getResource(String)
.
FileNotFoundException
- if the XML file cannot be found.
JAXBException
- if the schema file used (if any) is malformed, if
the XML file cannot be read, or if the XML file is not
schema-valid.
XMLStreamException
- if there is a problem opening the XML file,
if the XML is not well-formed, or for some other
"unexpected processing conditions".public static SchedulingBlock fromXml(Reader reader) throws JAXBException, XMLStreamException
reader
.
reader
- the source of the XML data.
If this value is null, null is returned.
reader
.
XMLStreamException
- if the XML is not well-formed,
or for some other "unexpected processing conditions".
JAXBException
- if anything else goes wrong during the
transformation.public SchedulingBlock clone()
The returned element is, for the most part, a deep copy of this one. However, there are a few exceptions:
Identifiable.UNIDENTIFIED
.
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
clone
in class Object
public SchedulingBlock cloneWithoutPrerequisites()
The returned element is, for the most part, a deep copy of this one. However, there are a few exceptions:
Identifiable.UNIDENTIFIED
.
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
public boolean equals(Object o)
o
is equal to this scheduling block.
In order to be equal to this scheduling block, o
must be non-null
and of the same class as this block. Equality is determined by examining
the equality of corresponding attributes, with the following exceptions,
which are ignored when assessing equality:
equals
in class Object
public int hashCode()
hashCode
in class Object
public static Comparator<SchedulingBlock> getPrequisiteComparator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |