Class HubClient

  • All Implemented Interfaces:
    Client

    public class HubClient
    extends java.lang.Object
    implements Client
    Represents a client registered with a hub.
    Since:
    15 Jul 2008
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      HubClient​(java.lang.String publicId, ProfileToken profileToken)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CallableClient getCallable()
      Returns the callable object which allows this client to receive callbacks.
      java.lang.String getId()
      Returns the public identifier for this client.
      Metadata getMetadata()
      Returns the currently declared metadata for this client, if any.
      ProfileToken getProfileToken()
      Returns a token identifying the source of this client's connection to the hub.
      java.util.Map getSubscription​(java.lang.String mtype)
      Returns the subscription information for a given MType for this client.
      Subscriptions getSubscriptions()
      Returns the currently declared subscriptions for this client, if any.
      boolean isCallable()
      Indicates whether this client is callable.
      boolean isSubscribed​(java.lang.String mtype)
      Indicates whether this client is subscribed to a given MType.
      void setCallable​(CallableClient callable)
      Sets the callable object which allows this client to receive callbacks.
      void setMetadata​(java.util.Map meta)
      Sets this client's metadata map.
      void setSubscriptions​(java.util.Map subs)
      Sets this client's subscriptions list.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HubClient

        public HubClient​(java.lang.String publicId,
                         ProfileToken profileToken)
        Constructor.
        Parameters:
        publicId - client public ID
        profileToken - identifier for the source of the hub connection
    • 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
      • getProfileToken

        public ProfileToken getProfileToken()
        Returns a token identifying the source of this client's connection to the hub.
        Returns:
        profile token
      • setMetadata

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

        public void setSubscriptions​(java.util.Map subs)
        Sets this client's subscriptions list.
        Parameters:
        subs - subscriptions map
      • isSubscribed

        public boolean isSubscribed​(java.lang.String mtype)
        Indicates whether this client is subscribed to a given MType.
        Parameters:
        mtype - MType
        Returns:
        true iff subscribed to MType
      • getSubscription

        public java.util.Map getSubscription​(java.lang.String mtype)
        Returns the subscription information for a given MType for this client.
        Parameters:
        mtype - MType
        Returns:
        subscriptions map value for key mtype, or null if not subscribed
      • setCallable

        public void setCallable​(CallableClient callable)
        Sets the callable object which allows this client to receive callbacks. If null is used, a no-op callable object is installed.
        Parameters:
        callable - new callable interface, or null
      • getCallable

        public CallableClient getCallable()
        Returns the callable object which allows this client to receive callbacks. It is never null.
        Returns:
        callable object
      • isCallable

        public boolean isCallable()
        Indicates whether this client is callable.
        Returns:
        true iff this client has a non-useless callback handler installed
      • toString

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