edu.nrao.sss.model.proposal
Class Session

java.lang.Object
  extended by edu.nrao.sss.model.proposal.Session
All Implemented Interfaces:
Identifiable

public class Session
extends Object
implements Identifiable

Placeholder for time when we integrate proposal work. A proposed observation session.

A session consists of one or more session pairs, each of which brings together a source and a resource. A session is a close cousin of a scheduling block, which is used during the observation preparation and scheduling phases.

CVS Info:

$Revision: 1709 $
$Date: 2008-11-14 11:22:37 -0700 (Fri, 14 Nov 2008) $
$Author: dharland $

Since:
2006-03-23

Field Summary
 
Fields inherited from interface edu.nrao.sss.util.Identifiable
UNIDENTIFIED
 
Constructor Summary
Session()
          Creates a new instance.
 
Method Summary
 void addSessionPair(SessionPair newPair)
          Add a new session pair to this session.
 String getComments()
          Returns the proposer's comments for this observation session.
 Long getId()
           
 String getMaximumLst()
          Returns the latest local sidereal time for this observation session.
 double getMinimumElevation()
          Returns the minimum acceptable elevation (of which source?) for this session.
 String getMinimumLst()
          Returns the earliest local sidereal time for this observation session.
 String getName()
          Returns the name of this session.
 int getRepeatCount()
          Returns the number of times to repeat this session.
 String getSchedulingConstraint()
          Returns the scheduling constraints for this session.
 TimeDuration getSeparation()
          Returns the separation in time between successive repeats of this session.
 Set<SessionPair> getSessionPairs()
          Returns this session's set of session pairs.
 TimeDuration getSessionTime()
          Returns the amount of time needed for one execution of this session.
 TimeDuration getTotalTime()
          Returns the total time needed for this session after accounting for the desired number of executions.
 void removeSessionPair(SessionPair oldPair)
          Removes the given session pair from this session.
 void reset()
          Resets this session to its initial state.
 void setComments(String comments)
          Sets the proposer's comments for this observation session.
 void setMaximumLst(String lstMax)
          Sets the latest local sidereal time for this observation session.
 void setMinimumElevation(double degrees)
          Sets the minimum acceptable elevation (of which source?) for this session.
 void setMinimumLst(String lstMin)
          Sets the earliest local sidereal time for this observation session.
 void setName(String newName)
          Sets the name of this session to newName.
 void setRepeatCount(int repeats)
          Sets the number of times to repeat this session.
 void setSchedulingConstraint(String constraint)
          Sets the scheduling constraints specified by a proposal's author for this session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session()
Creates a new instance.

Method Detail

reset

public void reset()
Resets this session to its initial state. A reset session has the same state as a new session.


getId

public Long getId()
Specified by:
getId in interface Identifiable

setName

public void setName(String newName)
Sets the name of this session to 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.

Parameters:
newName - the name of this session.

getName

public String getName()
Returns the name of this session.

Returns:
the name of this session.

addSessionPair

public void addSessionPair(SessionPair newPair)
Add a new session pair to this session.

Parameters:
newPair - the new session pair to be added to this session. If newPair is null this method does nothing.

removeSessionPair

public void removeSessionPair(SessionPair oldPair)
Removes the given session pair from this session.

Parameters:
oldPair - the session pair to be removed from this session.

getSessionPairs

public Set<SessionPair> getSessionPairs()
Returns this session's set of session pairs.

Note that this session's actual collection of pairs is returned, not a clone thereof. This means that any changes a client makes to the collection will be reflected in this session.

This method is guaranteed to return a non-null value, though the set it returns may be empty.

Returns:
this session's set of session pairs.

setMinimumLst

public void setMinimumLst(String lstMin)
Sets the earliest local sidereal time for this observation session.

The general form of the string is hh:mm:ss.sss. Leading zeroes are not required, though all three parts (hours, minutes, seconds) are required. Fractional seconds are not required. Examples of valid text strings:

Valid ranges for each part:

If the parameter string is not well formed, or if the values are not in the ranges given above, an IllegalArgumentException is thrown.

See the note in getMinimumLst() about the relationship between the minimum and maximum LST values.

Parameters:
lstMin - the earliest local sidereal time for this observation session.
Throws:
IllegalArgumentException - if lstMin does not follow the conventions set forth in the method comments.

getMinimumLst

public String getMinimumLst()
Returns the earliest local sidereal time for this observation session.

Note that, using a 24-hour clock that resets to zero at LST midnight, the "minimum" might be a greater number than the maximum. In this situation, it will be understood that the interval crosses midnight and into the next day.

Returns:
the earliest local sidereal time for this observation session.

setMaximumLst

public void setMaximumLst(String lstMax)
Sets the latest local sidereal time for this observation session.

See setMinimumLst(String) for information about the form of the parameter string. See also the note in getMinimumLst() about the relationship between the minimum and maximum LST values.

Parameters:
lstMax - the latest local sidereal time for this observation session.
Throws:
IllegalArgumentException - if lstMax does not follow the conventions set forth in the method comments of setLstMinimum.

getMaximumLst

public String getMaximumLst()
Returns the latest local sidereal time for this observation session. See note in getMinimumLst().

Returns:
the latest local sidereal time for this observation session.

setMinimumElevation

public void setMinimumElevation(double degrees)
Sets the minimum acceptable elevation (of which source?) for this session.

Parameters:
degrees - the minimum acceptable elevation, measured in degrees above the horizon. This value must be between 0.0 and 90.0, inclusive.
Throws:
IllegalArgumentException - if degrees is not within the range stated above.

getMinimumElevation

public double getMinimumElevation()
Returns the minimum acceptable elevation (of which source?) for this session.

Returns:
the minimum acceptable elevation (of which source?) for this session, in degrees above the horizon.

setSchedulingConstraint

public void setSchedulingConstraint(String constraint)
Sets the scheduling constraints specified by a proposal's author for this session. These constraints are for human consumption; there is no required format for this text.

Parameters:
constraint - the scheduling constraints for this session.

getSchedulingConstraint

public String getSchedulingConstraint()
Returns the scheduling constraints for this session. If there are no constraints, the empty string is returned. This method will never return null.

Returns:
this session's scheduling restraints.

setRepeatCount

public void setRepeatCount(int repeats)
Sets the number of times to repeat this session.

Parameters:
repeats - the number of times to repeat this session. If repeats is less than zero, it will be treated as zero.

getRepeatCount

public int getRepeatCount()
Returns the number of times to repeat this session.

Returns:
the number of times to repeat this session.

getSeparation

public TimeDuration getSeparation()
Returns the separation in time between successive repeats of this session.

Returns:
the separation in time between successive repeats of this session.

getSessionTime

public TimeDuration getSessionTime()
Returns the amount of time needed for one execution of this session.

Returns:
the amount of time needed for one execution of this session.

getTotalTime

public TimeDuration getTotalTime()
Returns the total time needed for this session after accounting for the desired number of executions.

Returns:
total time needed for this session.

setComments

public void setComments(String comments)
Sets the proposer's comments for this observation session.

Parameters:
comments - the proposer's comments for this observation session. If comments is null, it will be treated as the empty string.

getComments

public String getComments()
Returns the proposer's comments for this observation session.

Returns:
the proposer's comments for this observation session.


Copyright © 2009. All Rights Reserved.