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

public class ServiceTypeID extends BaseID implements IServiceTypeID
ServiceTypeID base class.
See Also:
  • Field Details

  • Constructor Details

    • 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 the Namespace and/or ServiceIDFactory instead.
      Parameters:
      namespace - namespace should not be null
      aType - type should not be null
  • Method Details

    • createType

      protected void createType()
    • getName

      public String getName()
      Description copied from interface: ID
      Get the unique name of this identity.
      Specified by:
      getName in interface ID
      Specified by:
      getName in interface Principal
      Overrides:
      getName in class BaseID
      Returns:
      String unique name for this identity. Will not be null, and must be a unique String within the Namespace returned by getNamespace()
    • namespaceCompareTo

      protected int namespaceCompareTo(BaseID o)
      Description copied from class: 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
      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 String namespaceGetName()
      Description copied from class: 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
      Specified by:
      namespaceHashCode in class BaseID
      Returns:
      int hashCode for this ID. Returned value must be unique within this process.
    • toString

      public String toString()
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
    • getNamingAuthority

      public String getNamingAuthority()
      Specified by:
      getNamingAuthority in interface IServiceTypeID
      Returns:
      String Naming Authority for this ServiceType. Will not be null. If this instance has been created with the provider specific default, this will return IServiceTypeID.DEFAULT_NA instead.
    • getProtocols

      public String[] getProtocols()
      Specified by:
      getProtocols in interface IServiceTypeID
      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 return IServiceTypeID.DEFAULT_PROTO instead.
    • getScopes

      public String[] getScopes()
      Specified by:
      getScopes in interface IServiceTypeID
      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 return IServiceTypeID.DEFAULT_SCOPE instead!
    • getServices

      public String[] getServices()
      Specified by:
      getServices in interface IServiceTypeID
      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)
      Specified by:
      equals in interface ID
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class BaseID
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface ID
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class BaseID
    • 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 as ID.getName(), or they may return a different, internal value appropriate to the provider.
      Specified by:
      getInternal in interface IServiceTypeID
      Returns:
      String internal name for this service type. Will not return null.