001    /**
002     * Do we want to use this space for anything?  Eg, revision history?
003     */
004    package edu.nrao.sss.model.proposal;
005    
006    import edu.nrao.sss.model.resource.Resource;
007    import edu.nrao.sss.model.source.Source;
008    import edu.nrao.sss.util.Identifiable;
009    
010    /** <i>Placeholder for time when we integrate proposal work.</i>
011     * A pairing of a {@link Source} and a {@link Resource}.
012     * <p>
013     * <b>CVS Info:</b>
014     * <table style="margin-left:2em">
015     *   <tr><td>$Revision: 1709 $</td>
016     *   <tr><td>$Date: 2008-11-14 11:22:37 -0700 (Fri, 14 Nov 2008) $</td>
017     *   <tr><td>$Author: dharland $</td>
018     * </table></p>
019     * 
020     * @since 2006-03-23
021     */
022    public class SessionPair
023      implements Identifiable//, XmlSerializable
024    {
025      //IDENTIFICATION
026      private Long id;  //A unique identifier for the persistence layer.
027    
028      //CONTAINED OBJECTS (Source & Resource)
029      private Source   source;
030      private Resource resource;
031      
032      /** Creates a new instance. */
033      public SessionPair()
034      {
035        initialize();
036      }
037      
038      /** Initializes the instance variables of this class.  */
039      private void initialize()
040      {
041        id = Identifiable.UNIDENTIFIED;
042      }
043      
044      /**
045       *  Resets this session pair to its initial state.
046       *  A reset session has the same state as a new session pair. 
047       */
048      public void reset()
049      {
050        initialize();
051      }
052    
053      //============================================================================
054      // IDENTIFICATION
055      //============================================================================
056    
057      /* (non-Javadoc)
058       * @see edu.nrao.sss.util.Identifiable#getId()
059       */
060      public Long getId()
061      {
062        return id;
063      }
064    
065      @SuppressWarnings("unused")
066      private void setId(Long id)
067      {
068        this.id = id;
069      }
070    
071      //============================================================================
072      // CONTAINED OBJECTS (Sources & Resources)
073      //============================================================================
074      
075      /**
076       * Sets this pair's source.
077       * @param newSource a new source for this session pair.
078       */
079      public void setSource(Source newSource)
080      {
081        source = newSource;
082      }
083      
084      /**
085       * Returns this pair's source.
086       * @return this pair's source, or <i>null</i> if this pair has no source.
087       */
088      public Source getSource()
089      {
090        return source;
091      }
092      
093      /**
094       * Sets this pair's resource.
095       * @param newResource a new resource for this session pair.
096       */
097      public void setResource(Resource newResource)
098      {
099        resource = newResource;
100      }
101      
102      /**
103       * Returns this pair's resource.
104       * @return this pair's resource, or <i>null</i> if this pair has no resource.
105       */
106      public Resource getResource()
107      {
108        return resource;
109      }
110    
111      //TODO toXml
112      //TODO clone
113      //TODO equals
114      //TODO hashCode
115    }