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 CallableClient
callable_
private Subscriptions
subs_
-
Constructor Summary
Constructors Constructor Description FacadeHubConnection(HubConnection base)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
declareSubscriptions(java.util.Map subs)
Declares this registered client's MType subscriptions.(package private) 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.void
setCallable(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:HubConnection
Tells 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:
setCallable
in interfaceHubConnection
- Overrides:
setCallable
in classWrapperHubConnection
- Parameters:
callable
- callable client- Throws:
SampException
-
declareSubscriptions
public void declareSubscriptions(java.util.Map subs) throws SampException
Description copied from interface:HubConnection
Declares this registered client's MType subscriptions.Only permitted if this client is already callable.
- Specified by:
declareSubscriptions
in interfaceHubConnection
- Overrides:
declareSubscriptions
in 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
-
-