org.eclipse.ecf.core.identity
Interface ID

All Superinterfaces:
java.lang.Comparable, org.eclipse.core.runtime.IAdaptable, java.security.Principal, java.io.Serializable
All Known Subinterfaces:
IFileID, IRemoteServiceID, IResourceID, IServiceID, IServiceTypeID
All Known Implementing Classes:
BaseID, BnRDnsSdServiceTypeID, DnsSdServiceID, DnsSdServiceTypeID, FileTransferID, GUID, JSLPServiceID, JSLPServiceTypeID, LocalID, LongID, R_OSGiID, RemoteServiceID, RestID, RpcId, RSExampleID, ServiceID, ServiceTypeID, SoapID, StringID, TrivialID, URIID, XMPPFileID, XMPPID, XMPPRoomID, XMPPSID, ZooDiscoveryServiceID, ZooDiscoveryServiceTypeID, ZooDiscoveryTargetID

public interface ID
extends java.io.Serializable, java.lang.Comparable, java.security.Principal, org.eclipse.core.runtime.IAdaptable

Contract for ECF identity

ECF IDs are immutable once constructed, and unique within the containing Namespace.

ID instances are created via the Namespace.createInstance(...) method. This method is called by the IDFactory.createID(...) methods for the given Namespace. So, for example, to create an ID instance with the name "slewis":

 ID id = IDFactory.getDefault().createID(namespace, "slewis");
 

See Also:
Namespace

Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
          Get the unique name of this identity.
 Namespace getNamespace()
          Get the Namespace instance associated with this identity
 int hashCode()
           
 java.lang.String toExternalForm()
          Get this ID instance in String form.
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface java.security.Principal
toString
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Method Detail

equals

boolean equals(java.lang.Object obj)
Specified by:
equals in interface java.security.Principal
Overrides:
equals in class java.lang.Object

hashCode

int hashCode()
Specified by:
hashCode in interface java.security.Principal
Overrides:
hashCode in class java.lang.Object

getName

java.lang.String getName()
Get the unique name of this identity.

Specified by:
getName in interface java.security.Principal
Returns:
String unique name for this identity. Will not be null, and must be a unique String within the Namespace returned by getNamespace()

getNamespace

Namespace getNamespace()
Get the Namespace instance associated with this identity

Returns:
Namespace the Namespace corresponding to this identity. Will not return null.

toExternalForm

java.lang.String toExternalForm()
Get this ID instance in String form. Will not return null.

Returns:
String that is external representation of this ID