KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > core > SessionID


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19
20 package sync4j.framework.core;
21
22 /**
23  * This class is related to the "last" and "next" values in an <Anchor> tag
24  * in the metainfo spec
25  *
26  * @author Stefano Fornari @ Funambol
27  *
28  * @version $Id: SessionID.java,v 1.4 2005/03/02 20:57:37 harrie Exp $
29  */

30 public final class SessionID
31 implements java.io.Serializable JavaDoc {
32     
33     // ------------------------------------------------------------ Private data
34

35     private String JavaDoc sessionID;
36     
37     // ------------------------------------------------------------ Constructors
38

39     /**
40      * For serialization purposes
41      */

42     protected SessionID() {}
43     
44     /**
45      * Create a new SessionID object with the parameters
46      *
47      * @param sessionID the identifier of session - NOT NULL
48      *
49      */

50     public SessionID(final String JavaDoc sessionID) {
51         setSessionID(sessionID);
52     }
53     
54     // ---------------------------------------------------------- Public methods
55

56     /**
57      * Gets the session identifier
58      *
59      * @return sessionID the session identifier
60      */

61     public String JavaDoc getSessionID() {
62         return sessionID;
63     }
64     
65     /**
66      * Sets the session identifier
67      *
68      * @param sessionID the session identifier
69      */

70     public void setSessionID(String JavaDoc sessionID) {
71         if (sessionID == null || sessionID.length() == 0) {
72             throw new IllegalArgumentException JavaDoc(
73                                           "sessionID cannot be null or empty");
74         }
75         this.sessionID = sessionID;
76     }
77 }
78
Popular Tags