KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > airsent > presentation > AirSentSessionData


1 /*
2  * Copyright (c) 1999-2001 Lutris Technologies, Inc. All Rights
3  * Reserved.
4  *
5  * This source code file is distributed by Lutris Technologies, Inc. for
6  * use only by licensed users of product(s) that include this source
7  * file. Use of this source file or the software that uses it is covered
8  * by the terms and conditions of the Lutris Enhydra Development License
9  * Agreement included with this product.
10  *
11  * This Software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
12  * ANY KIND, either express or implied. See the License for the specific terms
13  * governing rights and limitations under the License.
14  *
15  * Contributor(s):
16  *
17  * $Id: AirSentSessionData.java,v 1.1 2004/08/16 09:33:16 slobodan Exp $
18  */

19
20 package com.lutris.airsent.presentation;
21
22 import com.lutris.airsent.spec.customer.*;
23 import com.lutris.airsent.spec.messenger.Messenger;
24 import com.lutris.airsent.spec.delivery.OrderForm;
25
26 import java.util.*;
27
28 /**
29  * Object that will be held in session data. This should
30  * be the only object held there. Methods should be called
31  * on this object to set and get data.
32  */

33 public class AirSentSessionData implements java.io.Serializable JavaDoc {
34
35     /**
36      * Hash key to save session data for the CoreTest app in the Session
37      */

38     public static final String JavaDoc SESSION_KEY = "AirSentSessionData";
39     private int AUTHORIZATION = AirSentConstants.UNAUTH_USER;
40     protected String JavaDoc userMessage = null;
41     private Messenger messenger = null;
42     private Customer customer = null;
43     private OrderForm orderForm = null;
44     private long browserState = System.currentTimeMillis();
45
46     /**
47      * Gets the user authentication code.
48      *
49      *
50      * @return
51      *
52      */

53     public int getUserAuth() {
54     return AUTHORIZATION;
55     }
56
57     /**
58      * Sets the user authentication code.
59      *
60      *
61      * @param auth
62      *
63      *
64      */

65     public void setUserAuth(int auth) {
66     this.AUTHORIZATION = auth;
67     }
68
69     /**
70      * Set the messenger in the session data.
71      *
72      *
73      * @param messenger
74      *
75      *
76      */

77     public void setMessenger(Messenger messenger) {
78     this.messenger = messenger;
79     }
80
81     /**
82      * Set the customer in the session data.
83      *
84      *
85      * @param customer
86      *
87      *
88      */

89     public void setCustomer(Customer customer) {
90     this.customer = customer;
91     }
92
93     /**
94      * Gets the messenger user
95      *
96      */

97     public Messenger getMessenger() {
98     return messenger;
99     }
100
101     /**
102      * Gets the customer user
103      *
104      */

105     public Customer getCustomer() {
106     return customer;
107     }
108
109     /**
110      * Sets the user message
111      *
112      * @param msg the message to be set
113      */

114     public void setUserMessage(String JavaDoc msg) {
115     this.userMessage = msg;
116     }
117
118     /**
119      * Retrieve the most recent user message and then clear it so no
120      * other app tries to use it.
121      */

122     public String JavaDoc getAndClearUserMessage() {
123     String JavaDoc msg = this.userMessage;
124     
125     this.userMessage = null;
126
127     return msg;
128     }
129
130     /**
131      * Sets the browser state for
132      * server push functionality.
133      *
134      * @param browserState
135      *
136      *
137      */

138     public void setBrowserState(long browserState) {
139     this.browserState = browserState;
140     }
141
142     /**
143      * Gets the browser state for
144      * server push functionality.
145      *
146      *
147      * @return
148      *
149      *
150      */

151     public long getBrowserState() {
152     return browserState;
153     }
154
155     public void setOrderForm(OrderForm d) {
156         orderForm = d;
157     }
158
159     public OrderForm getOrderForm() {
160         return orderForm;
161     }
162 }
163
164
Popular Tags