Class ClientTracker.TrackedClient

  • All Implemented Interfaces:
    Client
    Enclosing class:
    ClientTracker

    private static class ClientTracker.TrackedClient
    extends java.lang.Object
    implements Client
    Client implementation used to populate internal data structures. It just implements the Client interface as well as adding mutators for metadata and subscriptions, and providing an equals method based on public id.
    • Constructor Summary

      Constructors 
      Constructor Description
      TrackedClient​(java.lang.String id)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getId()
      Returns the public identifier for this client.
      Metadata getMetadata()
      Returns the currently declared metadata for this client, if any.
      Subscriptions getSubscriptions()
      Returns the currently declared subscriptions for this client, if any.
      int hashCode()  
      (package private) void setMetadata​(java.util.Map metadata)
      Sets this client's metadata.
      (package private) void setSubscriptions​(java.util.Map subscriptions)
      Sets this client's subscriptions.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • id_

        private final java.lang.String id_
    • Constructor Detail

      • TrackedClient

        public TrackedClient​(java.lang.String id)
        Constructor.
        Parameters:
        id - client public id
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from interface: Client
        Returns the public identifier for this client.
        Specified by:
        getId in interface Client
        Returns:
        public id
      • getMetadata

        public Metadata getMetadata()
        Description copied from interface: Client
        Returns the currently declared metadata for this client, if any.
        Specified by:
        getMetadata in interface Client
        Returns:
        metadata object; may be null
      • getSubscriptions

        public Subscriptions getSubscriptions()
        Description copied from interface: Client
        Returns the currently declared subscriptions for this client, if any.
        Specified by:
        getSubscriptions in interface Client
        Returns:
        subscriptions object; may be null
      • setMetadata

        void setMetadata​(java.util.Map metadata)
        Sets this client's metadata.
        Parameters:
        metadata - new metadata
      • setSubscriptions

        void setSubscriptions​(java.util.Map subscriptions)
        Sets this client's subscriptions.
        Parameters:
        subscriptions - new subscriptions
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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