*/
package org.vamsas.client;
+import java.io.Serializable;
+
/**
* Uniquely describes a vamsas client application.
* @author jimp
*/
-public class ClientHandle {
+public class ClientHandle implements Serializable {
+ static final long serialVersionUID = 0;
+ /**
+ * @param clientName
+ * @param version
+ */
+ public ClientHandle(String clientName, String version) {
+ super();
+ this.clientName = clientName;
+ this.version = version;
+ this.setClientUrn("vamsas://"+clientName+":"+version+"/"); // TODO: decide on application handle ornthing (used to prefix new ids made by a particular application)
+ }
/**
* (non-unique) human readable vamsas client name
*/
/**
* the unambiguous client identifier
+ * This may be rewritten by the Vorba object if
+ * other clients with the same name, version
+ * and user are involved in a session.
+ *
*/
String clientUrn;
}
/**
+ * May become protected - should only be set by a Vorba object.
* @param clientUrn
* The clientUrn to set.
*/
public void setClientName(String clientName) {
this.clientName = clientName;
}
+
+ public boolean equals(Object that) {
+ if (that instanceof ClientHandle)
+ return this.equals((ClientHandle) that);
+ return false;
+ }
+ public boolean equals(ClientHandle that) {
+ return (clientName.equals(that.clientName) && version.equals(that.version) && clientUrn.equals(that.clientUrn));
+ }
}