org.eclipse.ecf.discovery.identity
Class ServiceID

java.lang.Object
  extended by org.eclipse.ecf.core.identity.BaseID
      extended by org.eclipse.ecf.discovery.identity.ServiceID
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, java.security.Principal, org.eclipse.core.runtime.IAdaptable, ID, IServiceID
Direct Known Subclasses:
DnsSdServiceID, JSLPServiceID, ZooDiscoveryServiceID

public class ServiceID
extends BaseID
implements IServiceID

Service identity type. ServiceIDs are IDs that uniquely identify a remote service. Subclasses may be created as appropriate.

See Also:
Serialized Form

Field Summary
protected  java.net.URI location
           
protected  IServiceInfo serviceInfo
           
protected  IServiceTypeID type
           
 
Fields inherited from class org.eclipse.ecf.core.identity.BaseID
namespace
 
Constructor Summary
protected ServiceID(Namespace namespace, IServiceTypeID type, java.net.URI anURI)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
protected  java.lang.String getFullyQualifiedName()
           
 java.net.URI getLocation()
          (non-Javadoc)
 IServiceInfo getServiceInfo()
           
 java.lang.String getServiceName()
          Get service name for this ID.
 java.lang.String getServiceType()
          Get service type for this ID.
 IServiceTypeID getServiceTypeID()
          Get service type ID for this ID.
 int hashCode()
           
protected  int namespaceCompareTo(BaseID o)
          Called by Namespace.getCompareToForObject(BaseID, BaseID).
protected  boolean namespaceEquals(BaseID o)
          Called by Namespace.testIDEquals(BaseID, BaseID).
protected  java.lang.String namespaceGetName()
          Called by Namespace.getNameForID(BaseID).
protected  int namespaceHashCode()
          Called by Namespace.getHashCodeForID(BaseID).
 void setServiceInfo(IServiceInfo serviceInfo)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.ecf.core.identity.BaseID
compareTo, getAdapter, getName, getNamespace, namespaceToExternalForm, toExternalForm
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ecf.core.identity.ID
getName, getNamespace, toExternalForm
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

serviceInfo

protected IServiceInfo serviceInfo
Since:
3.0

type

protected IServiceTypeID type

location

protected java.net.URI location
Since:
3.0
Constructor Detail

ServiceID

protected ServiceID(Namespace namespace,
                    IServiceTypeID type,
                    java.net.URI anURI)
Since:
3.0
Method Detail

getFullyQualifiedName

protected java.lang.String getFullyQualifiedName()

namespaceCompareTo

protected int namespaceCompareTo(BaseID o)
Description copied from class: BaseID
Called by Namespace.getCompareToForObject(BaseID, BaseID).

Specified by:
namespaceCompareTo in class BaseID
Parameters:
o - the other ID to compare to. Will not be null.
Returns:
the appropriate value as per Comparable contract.

namespaceEquals

protected boolean namespaceEquals(BaseID o)
Description copied from class: BaseID
Called by Namespace.testIDEquals(BaseID, BaseID).

Specified by:
namespaceEquals in class BaseID
Parameters:
o - the other ID to test against. May be null.
Returns:
true if this ID is equal to the given ID. false otherwise.

namespaceGetName

protected java.lang.String namespaceGetName()
Description copied from class: BaseID
Called by Namespace.getNameForID(BaseID).

Specified by:
namespaceGetName in class BaseID
Returns:
String name for this ID. Must not be null. Value returned should be unique within this Namespace.

namespaceHashCode

protected int namespaceHashCode()
Description copied from class: BaseID
Called by Namespace.getHashCodeForID(BaseID).

Specified by:
namespaceHashCode in class BaseID
Returns:
int hashCode for this ID. Returned value must be unique within this process.

getServiceType

public java.lang.String getServiceType()
Get service type for this ID.

Returns:
String service type. Will not be null.

getServiceTypeID

public IServiceTypeID getServiceTypeID()
Description copied from interface: IServiceID
Get service type ID for this ID.

Specified by:
getServiceTypeID in interface IServiceID
Returns:
IServiceTypeID. Will not be null.

getServiceName

public java.lang.String getServiceName()
Get service name for this ID.

Specified by:
getServiceName in interface IServiceID
Returns:
String service name. May be null.

toString

public java.lang.String toString()
Specified by:
toString in interface java.security.Principal
Overrides:
toString in class java.lang.Object

getLocation

public java.net.URI getLocation()
(non-Javadoc)

Specified by:
getLocation in interface IServiceID
Since:
3.0
See Also:
IServiceID.getLocation()

getServiceInfo

public IServiceInfo getServiceInfo()
Returns:
the serviceInfo
Since:
3.0

setServiceInfo

public void setServiceInfo(IServiceInfo serviceInfo)
Parameters:
serviceInfo - the serviceInfo to set
Since:
3.0

hashCode

public int hashCode()
Specified by:
hashCode in interface java.security.Principal
Specified by:
hashCode in interface ID
Overrides:
hashCode in class BaseID
Since:
3.0
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface java.security.Principal
Specified by:
equals in interface ID
Overrides:
equals in class BaseID
Since:
3.0
See Also:
Object.equals(java.lang.Object)