Class ServiceTypeID
- java.lang.Object
-
- org.eclipse.ecf.core.identity.BaseID
-
- org.eclipse.ecf.discovery.identity.ServiceTypeID
-
- All Implemented Interfaces:
Serializable
,Comparable
,Principal
,org.eclipse.core.runtime.IAdaptable
,ID
,IServiceTypeID
- Direct Known Subclasses:
DnsSdServiceTypeID
,JSLPServiceTypeID
,ZooDiscoveryServiceTypeID
public class ServiceTypeID extends BaseID implements IServiceTypeID
ServiceTypeID base class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
DELIM
protected String
namingAuthority
protected String[]
protocols
protected String[]
scopes
protected String[]
services
protected String
typeName
-
Fields inherited from interface org.eclipse.ecf.discovery.identity.IServiceTypeID
DEFAULT_NA, DEFAULT_PROTO, DEFAULT_SCOPE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ServiceTypeID(Namespace namespace)
ServiceTypeID(Namespace namespace, String aType)
Clients should not call this method directly.protected
ServiceTypeID(Namespace namespace, String[] services, String[] scopes, String[] protocols, String namingAuthority)
protected
ServiceTypeID(Namespace ns, IServiceTypeID id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createType()
boolean
equals(Object o)
String
getInternal()
Get the internal name of the service type.String
getName()
Get the unique name of this identity.String
getNamingAuthority()
String[]
getProtocols()
String[]
getScopes()
String[]
getServices()
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)
.String
toString()
-
Methods inherited from class org.eclipse.ecf.core.identity.BaseID
compareTo, getAdapter, 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
getNamespace, toExternalForm
-
-
-
-
Constructor Detail
-
ServiceTypeID
protected ServiceTypeID(Namespace namespace)
-
ServiceTypeID
protected ServiceTypeID(Namespace namespace, String[] services, String[] scopes, String[] protocols, String namingAuthority)
-
ServiceTypeID
protected ServiceTypeID(Namespace ns, IServiceTypeID id)
-
ServiceTypeID
public ServiceTypeID(Namespace namespace, String aType)
Clients should not call this method directly. Use theNamespace
and/orServiceIDFactory
instead.- Parameters:
namespace
- namespace should not benull
aType
- type should not benull
-
-
Method Detail
-
createType
protected void createType()
-
getName
public String getName()
Description copied from interface:ID
Get the unique name of this identity.
-
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.
-
toString
public String toString()
-
getNamingAuthority
public String getNamingAuthority()
- Specified by:
getNamingAuthority
in interfaceIServiceTypeID
- Returns:
- String Naming Authority for this ServiceType. Will not be
null
. If this instance has been created with the provider specific default, this will returnIServiceTypeID.DEFAULT_NA
instead.
-
getProtocols
public String[] getProtocols()
- Specified by:
getProtocols
in interfaceIServiceTypeID
- Returns:
- String[] of protocols supported. Will not be
null
, but may be empty array. If this instance has been created with the provider specific default, this will returnIServiceTypeID.DEFAULT_PROTO
instead.
-
getScopes
public String[] getScopes()
- Specified by:
getScopes
in interfaceIServiceTypeID
- Returns:
- The scopes in which this Service is registered. Will not be
null
, but may be empty array. If this instance has been created with the provider specific default, this will returnIServiceTypeID.DEFAULT_SCOPE
instead!
-
getServices
public String[] getServices()
- Specified by:
getServices
in interfaceIServiceTypeID
- Returns:
- The name of the service type. If the underlying discovery mechanism
supports naming hierarchies, the hierarchy will be returned
flattened as an array. Will not be
null
, but may be empty array.
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
getInternal
public String getInternal()
Description copied from interface:IServiceTypeID
Get the internal name of the service type. Provider implementations may choose to have this return the same value asID.getName()
, or they may return a different, internal value appropriate to the provider.- Specified by:
getInternal
in interfaceIServiceTypeID
- Returns:
- String internal name for this service type. Will not return
null
.
-
-