KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > pim > presentation > EnhydraPimSessionData


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: DiscRackSessionData.java,v 1.1 2004/08/16 09:39:19 slobodan Exp $
22  */

23
24 package org.enhydra.pim.presentation;
25
26 import org.enhydra.pim.business.api.ContactI;
27 import org.enhydra.pim.business.api.ContactTypeI;
28 import org.enhydra.pim.business.api.OwnerI;
29 import org.enhydra.pim.business.api.PersonI;
30
31 /**
32  * Object that will be held in session data. This should
33  * be the only object held there. Methods should be called
34  * on this object to set and get data.
35  */

36
37 public class EnhydraPimSessionData implements java.io.Serializable JavaDoc {
38     
39     /**
40      * Hash key to save session data for the DiscRack app in the Session
41      */

42     public static final String JavaDoc SESSION_KEY = "EnhydraPimSessionData";
43
44     /**
45      *
46      * @uml.property name="myUser"
47      * @uml.associationEnd multiplicity="(0 1)"
48      */

49     protected OwnerI myUser = null;
50
51     protected String JavaDoc userMessage = null;
52
53     /**
54      *
55      * @uml.property name="ownerSessionHandle"
56      * @uml.associationEnd multiplicity="(0 1)"
57      */

58     protected OwnerI ownerSessionHandle = null;
59
60     /**
61      *
62      * @uml.property name="personSessionHandle"
63      * @uml.associationEnd multiplicity="(0 1)"
64      */

65     protected PersonI personSessionHandle = null;
66
67     /**
68      *
69      * @uml.property name="contactDataSessionHandle"
70      * @uml.associationEnd multiplicity="(0 1)"
71      */

72     protected ContactI contactDataSessionHandle = null;
73
74     /**
75      *
76      * @uml.property name="contactTypeSessionHandle"
77      * @uml.associationEnd multiplicity="(0 1)"
78      */

79     protected ContactTypeI contactTypeSessionHandle = null;
80
81     /**
82      * @return Returns the SESSION_KEY.
83      *
84      * @uml.property name="sESSION_KEY"
85      */

86     public static String JavaDoc getSESSION_KEY() {
87         return SESSION_KEY;
88     }
89
90     /**
91      * @return Returns the contactDataSessionHandle.
92      *
93      * @uml.property name="contactDataSessionHandle"
94      */

95     public ContactI getContactDataSessionHandle() {
96         return this.contactDataSessionHandle;
97     }
98
99     /**
100      * @param contactDataSessionHandle The contactDataSessionHandle to set.
101      *
102      * @uml.property name="contactDataSessionHandle"
103      */

104     public void setContactDataSessionHandle(ContactI contactDataSessionHandle) {
105         this.contactDataSessionHandle = contactDataSessionHandle;
106     }
107
108     /**
109      * @return Returns the contactTypeSessionHandle.
110      *
111      * @uml.property name="contactTypeSessionHandle"
112      */

113     public ContactTypeI getContactTypeSessionHandle() {
114         return this.contactTypeSessionHandle;
115     }
116
117     /**
118      * @param contactTypeSessionHandle The contactTypeSessionHandle to set.
119      *
120      * @uml.property name="contactTypeSessionHandle"
121      */

122     public void setContactTypeSessionHandle(ContactTypeI contactTypeSessionHandle) {
123         this.contactTypeSessionHandle = contactTypeSessionHandle;
124     }
125
126     /**
127      * @return Returns the myUser.
128      *
129      * @uml.property name="myUser"
130      */

131     public OwnerI getMyUser() {
132         return this.myUser;
133     }
134
135     /**
136      * @param myUser The myUser to set.
137      *
138      * @uml.property name="myUser"
139      */

140     public void setMyUser(OwnerI myUser) {
141         this.myUser = myUser;
142     }
143
144     /**
145      * @return Returns the ownerSessionHandle.
146      *
147      * @uml.property name="ownerSessionHandle"
148      */

149     public OwnerI getOwnerSessionHandle() {
150         return this.ownerSessionHandle;
151     }
152
153     /**
154      * @param ownerSessionHandle The ownerSessionHandle to set.
155      *
156      * @uml.property name="ownerSessionHandle"
157      */

158     public void setOwnerSessionHandle(OwnerI ownerSessionHandle) {
159         this.ownerSessionHandle = ownerSessionHandle;
160     }
161
162     /**
163      * @return Returns the personSessionHandle.
164      *
165      * @uml.property name="personSessionHandle"
166      */

167     public PersonI getPersonSessionHandle() {
168         return this.personSessionHandle;
169     }
170
171     /**
172      * @param personSessionHandle The personSessionHandle to set.
173      *
174      * @uml.property name="personSessionHandle"
175      */

176     public void setPersonSessionHandle(PersonI personSessionHandle) {
177         this.personSessionHandle = personSessionHandle;
178     }
179
180     /**
181      * @return Returns the userMessage.
182      *
183      * @uml.property name="userMessage"
184      */

185     public String JavaDoc getUserMessage() {
186         return this.userMessage;
187     }
188     
189
190     /**
191      * Sets the Owner object
192      *
193      * @param theUser the person object
194      */

195     public void setUser(OwnerI theUser) {
196         this.myUser = theUser;
197     }
198     
199     /**
200      * Gets the Owner object
201      *
202      * @return person
203      */

204     public OwnerI getUser() {
205         return this.myUser;
206     }
207     
208     /**
209      * Method to remove the current user from the session
210      */

211     public void removeUser() {
212         this.myUser = null;
213     }
214
215     /**
216      * Sets the message
217      *
218      * @param msg the message to be set
219      *
220      * @uml.property name="userMessage"
221      */

222     public void setUserMessage(String JavaDoc msg) {
223         this.userMessage = msg;
224     }
225
226     
227     /**
228      * Retrieve the most recent user message and then clear it so no
229      * other app tries to use it.
230      */

231     public String JavaDoc getAndClearUserMessage() {
232         String JavaDoc msg = this.userMessage;
233         this.userMessage = null;
234         return msg;
235     }
236 }
237
Popular Tags