applied LGPLv3 and source code formatting.
[vamsas.git] / src / uk / ac / vamsas / client / SessionHandle.java
1 /*
2  * This file is part of the Vamsas Client version 0.1. 
3  * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite, 
4  *  Andrew Waterhouse and Dominik Lindner.
5  * 
6  * Earlier versions have also been incorporated into Jalview version 2.4 
7  * since 2008, and TOPALi version 2 since 2007.
8  * 
9  * The Vamsas Client is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *  
14  * The Vamsas Client is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License for more details.
18  * 
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with the Vamsas Client.  If not, see <http://www.gnu.org/licenses/>.
21  */
22 package uk.ac.vamsas.client;
23
24 import java.io.Serializable;
25
26 /**
27  * Uniquely locates a particular VAMSAS session.
28  * 
29  * @author jimp
30  * 
31  */
32 public class SessionHandle implements Serializable {
33
34   /**
35    * @param sessionUrn
36    */
37   public SessionHandle(String _sessionUrn) {
38     super();
39     this.sessionUrn = _sessionUrn;
40   }
41
42   /**
43    * @return Returns the sessionUrn.
44    */
45   public String getSessionUrn() {
46     return this.sessionUrn;
47   }
48
49   /**
50    * @param sessionUrn
51    *          The sessionUrn to set.
52    */
53   public void setSessionUrn(String _sessionUrn) {
54     this.sessionUrn = _sessionUrn;
55   }
56
57   /**
58    * The path to the vamsas session file.
59    */
60   String sessionUrn = null;
61
62   /**
63    * @see java.lang.Object#equals(java.lang.Object)
64    */
65   public boolean equals(Object obj) {
66
67     if (obj instanceof SessionHandle)
68       return this.equals((SessionHandle) obj);
69     return false;
70   }
71
72   public boolean equals(SessionHandle that) {
73     return (this.sessionUrn.equals(that.getSessionUrn()));
74   }
75
76 }