public class HubClient extends java.lang.Object implements Client
| Modifier and Type | Class and Description |
|---|---|
private class |
HubClient.NoCallableClient
No-op callback handler implementation.
|
| Modifier and Type | Field and Description |
|---|---|
private CallableClient |
callable_ |
private Metadata |
metadata_ |
private ProfileToken |
profileToken_ |
private java.lang.String |
publicId_ |
private Subscriptions |
subscriptions_ |
| Constructor and Description |
|---|
HubClient(java.lang.String publicId,
ProfileToken profileToken)
Constructor.
|
| Modifier and Type | Method and 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() |
private final java.lang.String publicId_
private final ProfileToken profileToken_
private volatile Subscriptions subscriptions_
private volatile Metadata metadata_
private volatile CallableClient callable_
public HubClient(java.lang.String publicId,
ProfileToken profileToken)
publicId - client public IDprofileToken - identifier for the source of the hub connectionpublic java.lang.String getId()
Clientpublic Metadata getMetadata()
ClientgetMetadata in interface Clientpublic Subscriptions getSubscriptions()
ClientgetSubscriptions in interface Clientpublic ProfileToken getProfileToken()
public void setMetadata(java.util.Map meta)
meta - metadata mappublic void setSubscriptions(java.util.Map subs)
subs - subscriptions mappublic boolean isSubscribed(java.lang.String mtype)
mtype - MTypepublic java.util.Map getSubscription(java.lang.String mtype)
mtype - MTypemtype,
or null if not subscribedpublic void setCallable(CallableClient callable)
callable - new callable interface, or nullpublic CallableClient getCallable()
public boolean isCallable()
public java.lang.String toString()
toString in class java.lang.Object