Class ServiceID
- java.lang.Object
-
- org.eclipse.ecf.core.identity.BaseID
-
- org.eclipse.ecf.discovery.identity.ServiceID
-
- All Implemented Interfaces:
Serializable
,Comparable
,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
Fields Modifier and Type Field Description protected URI
location
protected IServiceInfo
serviceInfo
protected IServiceTypeID
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
ServiceID(Namespace namespace, IServiceTypeID type, URI anURI)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
protected String
getFullyQualifiedName()
URI
getLocation()
(non-Javadoc)IServiceInfo
getServiceInfo()
String
getServiceName()
Get service name for this ID.String
getServiceType()
Get service type for this ID.IServiceTypeID
getServiceTypeID()
Get service type ID for this ID.int
hashCode()
protected int
namespaceCompareTo(BaseID o)
protected boolean
namespaceEquals(BaseID o)
Called byNamespace.testIDEquals(BaseID, BaseID)
.protected String
namespaceGetName()
Called byNamespace.getNameForID(BaseID)
.protected int
namespaceHashCode()
Called byNamespace.getHashCodeForID(BaseID)
.void
setServiceInfo(IServiceInfo serviceInfo)
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 java.lang.Comparable
compareTo
-
Methods inherited from interface org.eclipse.ecf.core.identity.ID
getName, getNamespace, toExternalForm
-
-
-
-
Field Detail
-
serviceInfo
protected IServiceInfo serviceInfo
- Since:
- 3.0
-
type
protected IServiceTypeID type
-
location
protected URI location
- Since:
- 3.0
-
-
Constructor Detail
-
ServiceID
protected ServiceID(Namespace namespace, IServiceTypeID type, URI anURI)
- Parameters:
namespace
- namespace should not benull
type
- service type ID should not benull
anURI
- uri for service location should not benull
- Since:
- 3.0
-
-
Method Detail
-
getFullyQualifiedName
protected String getFullyQualifiedName()
-
namespaceCompareTo
protected int namespaceCompareTo(BaseID o)
Description copied from class:BaseID
- Specified by:
namespaceCompareTo
in classBaseID
- Parameters:
o
- the other ID to compare to. Will not benull
.- Returns:
- the appropriate value as per
Comparable
contract.
-
namespaceEquals
protected boolean namespaceEquals(BaseID o)
Description copied from class:BaseID
Called byNamespace.testIDEquals(BaseID, BaseID)
.- Specified by:
namespaceEquals
in classBaseID
- Parameters:
o
- the other ID to test against. May benull
.- Returns:
true
if this ID is equal to the given ID.false
otherwise.
-
namespaceGetName
protected String namespaceGetName()
Description copied from class:BaseID
Called byNamespace.getNameForID(BaseID)
.- Specified by:
namespaceGetName
in classBaseID
- 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 byNamespace.getHashCodeForID(BaseID)
.- Specified by:
namespaceHashCode
in classBaseID
- Returns:
- int hashCode for this ID. Returned value must be unique within this process.
-
getServiceType
public 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 interfaceIServiceID
- Returns:
- IServiceTypeID. Will not be
null
.
-
getServiceName
public String getServiceName()
Get service name for this ID.- Specified by:
getServiceName
in interfaceIServiceID
- Returns:
- String service name. May be
null
.
-
toString
public String toString()
-
getLocation
public URI getLocation()
(non-Javadoc)- Specified by:
getLocation
in interfaceIServiceID
- Returns:
- URI the location for this serviceID
- 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()
-
-