Package org.astrogrid.samp.hub
Class HubClient
java.lang.Object
org.astrogrid.samp.hub.HubClient
- All Implemented Interfaces:
Client
Represents a client registered with a hub.
- Since:
- 15 Jul 2008
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the callable object which allows this client to receive callbacks.getId()Returns the public identifier for this client.Returns the currently declared metadata for this client, if any.Returns a token identifying the source of this client's connection to the hub.getSubscription(String mtype) Returns the subscription information for a given MType for this client.Returns the currently declared subscriptions for this client, if any.booleanIndicates whether this client is callable.booleanisSubscribed(String mtype) Indicates whether this client is subscribed to a given MType.voidsetCallable(CallableClient callable) Sets the callable object which allows this client to receive callbacks.voidsetMetadata(Map meta) Sets this client's metadata map.voidsetSubscriptions(Map subs) Sets this client's subscriptions list.toString()
-
Constructor Details
-
HubClient
Constructor.- Parameters:
publicId- client public IDprofileToken- identifier for the source of the hub connection
-
-
Method Details
-
getId
Description copied from interface:ClientReturns the public identifier for this client. -
getMetadata
Description copied from interface:ClientReturns the currently declared metadata for this client, if any.- Specified by:
getMetadatain interfaceClient- Returns:
- metadata object; may be null
-
getSubscriptions
Description copied from interface:ClientReturns the currently declared subscriptions for this client, if any.- Specified by:
getSubscriptionsin interfaceClient- Returns:
- subscriptions object; may be null
-
getProfileToken
Returns a token identifying the source of this client's connection to the hub.- Returns:
- profile token
-
setMetadata
Sets this client's metadata map.- Parameters:
meta- metadata map
-
setSubscriptions
Sets this client's subscriptions list.- Parameters:
subs- subscriptions map
-
isSubscribed
Indicates whether this client is subscribed to a given MType.- Parameters:
mtype- MType- Returns:
- true iff subscribed to MType
-
getSubscription
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
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
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
-