stella
Interface Handable

All Superinterfaces:
TargetDefinition
All Known Subinterfaces:
Appointable, HistoryAware
All Known Implementing Classes:
GrbTarget, ParsedTarget

public interface Handable
extends TargetDefinition

An interface furhter specifying an astronomical target. A handable target is able to perform very basic selection processes. It may be enabled or disabled. Additionally, if picked, method exist to reflect the different states of the target handling.


Method Summary
 void errorDaughter(ErrorEvent error, ErrorFinalizing finish, ParameterClustering set)
          Signals the target that an error has occured during the execution of a daughter of this target.
 void errorMain(ErrorEvent error, ErrorFinalizing finish, ParameterClustering set)
          Signals the target that an error has occured during the execution of itself.
 void errorSuccessor(ErrorEvent error, ErrorFinalizing finish, ParameterClustering set)
          Signals the target that an error has occured during the execution of the successor of this target.
 boolean isEnabled()
          Queries the state of the target with respect to availablity in terms of queuing.
 boolean isFinished()
          Checks if the target has been finished within this chained observation.
 boolean isNotify(UserProfile.Notifies condition)
          Returns true if the argument should trigger some sort of notification.
 boolean isPicked()
          Returns true if this target is currently picked by the scheduler and either already observed or in the early stages of preparation.
 void setEnabled(boolean isaccessible)
          Disables or enables the target.
 void setFinished(boolean isfinished)
          Sets the finished flag of the target.
 void setPicked(boolean ispick)
          Signals the target that it has presently been picked for execution.
 
Methods inherited from interface stella.TargetDefinition
getDaughters, getDescription, getDescriptionID, getEmailAddresses, getImageType, getInstitution, getName, getPrecursor, getSuccessor, getTargetResource, getTargetSpecific, getTeam, getTitle, getType, getUser, setPrecursor
 

Method Detail

setEnabled

void setEnabled(boolean isaccessible)
Disables or enables the target. Disabled target must not be picked by a scheduler, i.e. they are removed from a selection queue.
This method is not intended for target aborts, but should act at an earlier stage, e.g. when some required resources cannot be allocated (which will probably be recognized by a master program rather than the target itself).


isEnabled

boolean isEnabled()
Queries the state of the target with respect to availablity in terms of queuing. Targets that are not enabled are not considered for scheduling, but remain in the scheduler's target list as they may be renabled at any time.
This method is intended for first-order querying of the accessibility state of the target.

Returns:
True if this target may be considered for scheduling.

setPicked

void setPicked(boolean ispick)
Signals the target that it has presently been picked for execution. Any updates on the target fields are within the responsibility of the implementing class, the scheduler only calls this method after a successful selection. Note that adding information about a target execution is transfered to HistoryAware.addExecution(stella.ParameterClustering, java.util.Date, long, java.lang.String, java.lang.String).

See Also:
errorMain(stella.ErrorEvent, stella.ErrorFinalizing, stella.ParameterClustering)

isPicked

boolean isPicked()
Returns true if this target is currently picked by the scheduler and either already observed or in the early stages of preparation.

Returns:
True as soon as the scheduler signals picking.
See Also:
setPicked(boolean)

setFinished

void setFinished(boolean isfinished)
Sets the finished flag of the target. This flag is used for target-chaining, see TargetDefinition. By default, a target is always unfinished after construction. This method is called during chaining to signal an execution of this target (regardless of success) to hinder re-executuion of the target.


isFinished

boolean isFinished()
Checks if the target has been finished within this chained observation. Necessarry to avoid multiple execution of the target during target chaining (see TargetDefinition).


errorMain

void errorMain(ErrorEvent error,
               ErrorFinalizing finish,
               ParameterClustering set)
Signals the target that an error has occured during the execution of itself. The argument decides if the execution was successful. It is the responibility of the target to record any implications from this error to the HistoryAware.addExecution(stella.ParameterClustering, java.util.Date, long, java.lang.String, java.lang.String) method call. This method should never implicatley call the setPicked(boolean) method with false as the argument as the error might not be a terminal one.

Parameters:
error - The error event occured during my execution
finish - An error finalizer linked to this error
set - The current conditions

errorDaughter

void errorDaughter(ErrorEvent error,
                   ErrorFinalizing finish,
                   ParameterClustering set)
Signals the target that an error has occured during the execution of a daughter of this target. The argument decides if the execution was successful. It is the responibility of the target to record any implications from this error to the HistoryAware.addExecution(stella.ParameterClustering, java.util.Date, long, java.lang.String, java.lang.String) method call. This method should never implicatley call the setPicked(boolean) method with false as the argument as the error might not be a terminal one.

Parameters:
error - The error event occured during daughter execution.
finish - An error finalizer linked to this error
set - The current conditions

errorSuccessor

void errorSuccessor(ErrorEvent error,
                    ErrorFinalizing finish,
                    ParameterClustering set)
Signals the target that an error has occured during the execution of the successor of this target. The argument decides if the execution was successful. It is the responibility of the target to record any implications from this error to the HistoryAware.addExecution(stella.ParameterClustering, java.util.Date, long, java.lang.String, java.lang.String) method call. This method should never implicatley call the setPicked(boolean) method with false as the argument as the error might not be a terminal one.

Parameters:
error - The error event occured during successor execution.
finish - An error finalizer linked to this error
set - The current conditions

isNotify

boolean isNotify(UserProfile.Notifies condition)
Returns true if the argument should trigger some sort of notification. Normally, this means e-mail notification of the user if the target is picked/unpicked/disabled.

Parameters:
condition - An object-specific identifier for user notifiaction.