Class ProviderId


  • public class ProviderId
    extends java.lang.Object
    External identity of a Provider family. It also carriers two designations of external characteristics, the URI scheme and primary/ancillary indicator.

    The device URI scheme is used to determine applicability of a provider to operations on a specific device. The ancillary indicator serves to designate a provider as a primary or ancillary.

    A ProviderRegistry uses this designation to permit only one primary provider per device URI scheme. Multiple ancillary providers can register with the same device URI scheme however.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static ProviderId NONE
      Represents no provider ID.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProviderId​(java.lang.String scheme, java.lang.String id)
      Creates a new primary provider identifier from the specified string.
      ProviderId​(java.lang.String scheme, java.lang.String id, boolean ancillary)
      Creates a new provider identifier from the specified string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      java.lang.String id()
      Returns the device URI scheme specific id portion.
      boolean isAncillary()
      Indicates whether this identifier designates an ancillary providers.
      java.lang.String scheme()
      Returns the device URI scheme to which this provider is bound.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • NONE

        public static final ProviderId NONE
        Represents no provider ID.
    • Constructor Detail

      • ProviderId

        public ProviderId​(java.lang.String scheme,
                          java.lang.String id)
        Creates a new primary provider identifier from the specified string. The providers are expected to follow the reverse DNS convention, e.g. org.onosproject.provider.of.device
        Parameters:
        scheme - device URI scheme to which this provider is bound, e.g. "of", "snmp"
        id - string identifier
      • ProviderId

        public ProviderId​(java.lang.String scheme,
                          java.lang.String id,
                          boolean ancillary)
        Creates a new provider identifier from the specified string. The providers are expected to follow the reverse DNS convention, e.g. org.onosproject.provider.of.device
        Parameters:
        scheme - device URI scheme to which this provider is bound, e.g. "of", "snmp"
        id - string identifier
        ancillary - ancillary provider indicator
    • Method Detail

      • scheme

        public java.lang.String scheme()
        Returns the device URI scheme to which this provider is bound.
        Returns:
        device URI scheme
      • id

        public java.lang.String id()
        Returns the device URI scheme specific id portion.
        Returns:
        id
      • isAncillary

        public boolean isAncillary()
        Indicates whether this identifier designates an ancillary providers.
        Returns:
        true if the provider is ancillary; false if primary
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object