Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/clra/rowing/IRowingSession.java


1   /*
2    * Copyright (c) Carnegie Lake Rowing Association 2002. All rights reserved.
3    * Distributed under the GPL license. See doc/COPYING.
4    * $RCSfile: IRowingSession.java,v $
5    * $Date: 2003/02/26 03:38:45 $
6    * $Revision: 1.5 $
7    */
8   
9   package com.clra.rowing;
10  
11  import com.clra.util.ISerializableComparator;
12  import java.rmi.RemoteException;
13  import java.util.Date;
14  import javax.ejb.EJBObject;
15  import javax.ejb.RemoveException;
16  
17  /**
18   * Represents a rowing session.
19   *
20   * @version $Revision: 1.5 $ $Date: 2003/02/26 03:38:45 $
21   * @author <a href="mailto:rphall@pluto.njcc.com">Rick Hall</a>
22   */
23  public interface IRowingSession extends EJBObject {
24  
25    /**
26     * Returns the natural Comparator for rowing sessions, in which rowing
27     * sessions are compared by date, state, type, level, and id, with that
28     * respective weighting.
29     */
30    ISerializableComparator getNaturalComparator() throws RemoteException;
31  
32    /** Returns a snapshot of a rowing session */
33    RowingSessionSnapshot getData() throws RemoteException;
34  
35    /**
36     * Sets the date, level and type of a rowing session if the rowing
37     * session is TENATIVE. The id and state properties are not set.
38     */
39    void setData( RowingSessionSnapshot data )
40      throws RemoteException, RowingSessionStateException;
41  
42    /**
43     * Returns the primary key of a rowing session. The id is immutable
44     * after a rowing session is created.
45     */
46    Integer getId() throws RemoteException;
47  
48    /**
49     * Returns the state of a rowing session. The state of a rowing
50     * session can not be set directly. It is changed as a side-effect
51     * of other operations on a rowing session.
52     */
53    RowingSessionState getState() throws RemoteException;
54  
55    /**
56     * Publishes a rowing session. Only TENATIVE sessions may be published.
57     * The state of a published rowing session becomes OPEN.
58     * @exception RowingSessionStateException if a non-tenative rowing session is
59     * published.
60     */
61    void publish() throws RemoteException, RowingSessionStateException;
62  
63    /**
64     * Locks a rowing session. Only OPEN sessions may be locked.
65     * The state of a locked rowing session becomes LOCKED.
66     * @exception RowingSessionStateException if a non-open rowing session is
67     * locked.
68     */
69    void lock() throws RemoteException, RowingSessionStateException;
70  
71    /**
72     * Cancels a rowing session. A TENTATIVE session may not be cancelled
73     * (but a TENATIVE session may be deleted). The state of a cancelled
74     * state becomes CANCELLED.
75     * @exception RowingSessionStateException if a tenative rowing session is
76     * cancelled.
77     */
78    void cancel() throws RemoteException, RowingSessionStateException;
79  
80    /**
81     * Deletes a rowing session. Only a TENATIVE session may be deleted.
82     * A deleted session is removed from the database.<p>
83     *
84     * This is a safe version of the standard EJBObject.remove()
85     * operation. It checks that the session is tenative before removing it.
86     * <strong>Application code should always delete, rather than remove, rowing
87     * sessions.</strong> (The remove operation is required for testing.)<p>
88     *
89     * @exception RowingSessionStateException if a non-tenative rowing session is
90     * deleted.
91     * @see javax.ebj.EJBObject.remove()
92     */
93    void delete()
94      throws RemoteException, RemoveException, RowingSessionStateException;
95  
96    /** Returns the date (and time) of a rowing session */
97    Date getDate() throws RemoteException;
98  
99    /**
100    * Edits the date (and time) of a rowing session. Editing is allowed only
101    * for TENATIVE sessions.
102    * @exception RowingSessionStateException if the edited session is not
103    * in the TENATIVE state.
104    * @see RowingSessionState
105    */
106   void setDate( Date date )
107     throws RemoteException, RowingSessionStateException;
108 
109   /** Returns the level of a rowing session */
110   RowingSessionLevel getLevel() throws RemoteException;
111 
112   /**
113    * Edits the level of a rowing session. Editing is allowed only for
114    * TENATIVE sessions.
115    */
116   void setLevel( RowingSessionLevel level )
117     throws RemoteException, RowingSessionStateException;
118 
119   /** Returns the type of a rowing session */
120   RowingSessionType getType()
121     throws RemoteException;
122 
123   /**
124    * Edits the type of a rowing session. Editing is allowed only for
125    * TENATIVE sessions.
126    */
127   void setType( RowingSessionType type )
128     throws RemoteException, RowingSessionStateException;
129 
130 } // IRowingSession
131 
132 /*
133  * $Log: IRowingSession.java,v $
134  * Revision 1.5  2003/02/26 03:38:45  rphall
135  * Added copyright and GPL license
136  *
137  * Revision 1.4  2003/02/19 22:30:12  rphall
138  * Removed gratuitous use of CLRA acronym
139  *
140  */
141