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 StringDELIMprotected StringnamingAuthorityprotected String[]protocolsprotected String[]scopesprotected String[]servicesprotected StringtypeName-
Fields inherited from interface org.eclipse.ecf.discovery.identity.IServiceTypeID
DEFAULT_NA, DEFAULT_PROTO, DEFAULT_SCOPE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedServiceTypeID(Namespace namespace)ServiceTypeID(Namespace namespace, String aType)Clients should not call this method directly.protectedServiceTypeID(Namespace namespace, String[] services, String[] scopes, String[] protocols, String namingAuthority)protectedServiceTypeID(Namespace ns, IServiceTypeID id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateType()booleanequals(Object o)StringgetInternal()Get the internal name of the service type.StringgetName()Get the unique name of this identity.StringgetNamingAuthority()String[]getProtocols()String[]getScopes()String[]getServices()inthashCode()protected intnamespaceCompareTo(BaseID o)protected booleannamespaceEquals(BaseID o)Called byNamespace.testIDEquals(BaseID, BaseID).protected StringnamespaceGetName()Called byNamespace.getNameForID(BaseID).protected intnamespaceHashCode()Called byNamespace.getHashCodeForID(BaseID).StringtoString()-
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 theNamespaceand/orServiceIDFactoryinstead.- Parameters:
namespace- namespace should not benullaType- type should not benull
-
-
Method Detail
-
createType
protected void createType()
-
getName
public String getName()
Description copied from interface:IDGet the unique name of this identity.
-
namespaceCompareTo
protected int namespaceCompareTo(BaseID o)
Description copied from class:BaseID- Specified by:
namespaceCompareToin classBaseID- Parameters:
o- the other ID to compare to. Will not benull.- Returns:
- the appropriate value as per
Comparablecontract.
-
namespaceEquals
protected boolean namespaceEquals(BaseID o)
Description copied from class:BaseIDCalled byNamespace.testIDEquals(BaseID, BaseID).- Specified by:
namespaceEqualsin classBaseID- Parameters:
o- the other ID to test against. May benull.- Returns:
trueif this ID is equal to the given ID.falseotherwise.
-
namespaceGetName
protected String namespaceGetName()
Description copied from class:BaseIDCalled byNamespace.getNameForID(BaseID).- Specified by:
namespaceGetNamein 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:BaseIDCalled byNamespace.getHashCodeForID(BaseID).- Specified by:
namespaceHashCodein 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:
getNamingAuthorityin 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_NAinstead.
-
getProtocols
public String[] getProtocols()
- Specified by:
getProtocolsin 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_PROTOinstead.
-
getScopes
public String[] getScopes()
- Specified by:
getScopesin 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_SCOPEinstead!
-
getServices
public String[] getServices()
- Specified by:
getServicesin 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:IServiceTypeIDGet 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:
getInternalin interfaceIServiceTypeID- Returns:
- String internal name for this service type. Will not return
null.
-
-