test clientsFile handlers.
[vamsas.git] / src / org / vamsas / client / ClientHandle.java
1 /*
2  */
3 package org.vamsas.client;
4
5 import java.io.Serializable;
6
7 /**
8  * Uniquely describes a vamsas client application.
9  * @author jimp 
10  */
11 public class ClientHandle implements Serializable {
12   static final long serialVersionUID = 0;
13   /**
14    * @param clientName
15    * @param version
16    */
17   public ClientHandle(String clientName, String version) {
18     super();
19     this.clientName = clientName;
20     this.version = version;
21   }
22   /**
23    * (non-unique) human readable vamsas client name
24    */
25   String clientName;
26
27   /**
28    * the unambiguous client identifier
29    * This may be rewritten by the Vorba object if
30    * other clients with the same name, version 
31    * and user are involved in a session.
32    * 
33    */
34   String clientUrn;
35
36   /**
37    * version modifier to tag application space
38    */
39   String version;
40
41   /**
42    * @return Returns the clientUrn.
43    */
44   public String getClientUrn() {
45     return clientUrn;
46   }
47
48   /**
49    * May become protected - should only be set by a Vorba object.
50    * @param clientUrn
51    *          The clientUrn to set.
52    */
53   public void setClientUrn(String clientUrn) {
54     this.clientUrn = clientUrn;
55   }
56
57   /**
58    * @return Returns the version.
59    */
60   public String getVersion() {
61     return version;
62   }
63
64   /**
65    * @param version
66    *          The version to set.
67    */
68   public void setVersion(String version) {
69     this.version = version;
70   }
71
72
73   /**
74    * @return Returns the clientName.
75    */
76   public String getClientName() {
77     return clientName;
78   }
79
80   /**
81    * @param clientName
82    *          The clientName to set.
83    */
84   public void setClientName(String clientName) {
85     this.clientName = clientName;
86   }
87
88   public boolean equals(Object that) {
89     if (that instanceof ClientHandle)
90       return this.equals((ClientHandle) that); 
91     return false;
92   }
93   public boolean equals(ClientHandle that) {
94     return (clientName.equals(that.clientName) && version.equals(that.version) && clientUrn.equals(that.clientUrn));
95   }
96 }