Package org.astrogrid.samp.hub
Class FacadeHubService.FacadeHubConnection
- java.lang.Object
-
- org.astrogrid.samp.hub.WrapperHubConnection
-
- org.astrogrid.samp.hub.FacadeHubService.FacadeHubConnection
-
- All Implemented Interfaces:
HubConnection
- Enclosing class:
- FacadeHubService
private static class FacadeHubService.FacadeHubConnection extends WrapperHubConnection
Utility HubConnection class which allows hub event notifications to be sent to clients.
-
-
Field Summary
Fields Modifier and Type Field Description private CallableClientcallable_private Subscriptionssubs_
-
Constructor Summary
Constructors Constructor Description FacadeHubConnection(HubConnection base)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeclareSubscriptions(java.util.Map subs)Declares this registered client's MType subscriptions.(package private) voidhubEvent(Message msg)Sends a given message as a notification, as if from the hub, to this connection if it is able to receive it.voidsetCallable(CallableClient callable)Tells the hub how it can perform callbacks on the client by providing a CallableClient object.-
Methods inherited from class org.astrogrid.samp.hub.WrapperHubConnection
call, callAll, callAndWait, declareMetadata, getMetadata, getRegInfo, getRegisteredClients, getSubscribedClients, getSubscriptions, notify, notifyAll, ping, reply, unregister
-
-
-
-
Field Detail
-
callable_
private CallableClient callable_
-
subs_
private Subscriptions subs_
-
-
Constructor Detail
-
FacadeHubConnection
FacadeHubConnection(HubConnection base)
Constructor.- Parameters:
base- base connection
-
-
Method Detail
-
setCallable
public void setCallable(CallableClient callable) throws SampException
Description copied from interface:HubConnectionTells the hub how it can perform callbacks on the client by providing a CallableClient object. This is required before the client can declare subscriptions or make asynchronous calls.- Specified by:
setCallablein interfaceHubConnection- Overrides:
setCallablein classWrapperHubConnection- Parameters:
callable- callable client- Throws:
SampException
-
declareSubscriptions
public void declareSubscriptions(java.util.Map subs) throws SampExceptionDescription copied from interface:HubConnectionDeclares this registered client's MType subscriptions.Only permitted if this client is already callable.
- Specified by:
declareSubscriptionsin interfaceHubConnection- Overrides:
declareSubscriptionsin classWrapperHubConnection- Parameters:
subs-Subscriptions-like map- Throws:
SampException
-
hubEvent
void hubEvent(Message msg)
Sends a given message as a notification, as if from the hub, to this connection if it is able to receive it.- Parameters:
msg- message to send
-
-