Package org.astrogrid.samp.hub
Class FacadeHubService
java.lang.Object
org.astrogrid.samp.hub.FacadeHubService
- All Implemented Interfaces:
HubService
HubService that provides hub functionality by accessing an existing
hub service. The existing hub service is defined by a supplied
ClientProfile object.
- Since:
- 1 Feb 2011
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisconnectAll(ProfileToken profileToken) Forcibly terminates any connections created by a previous call ofHubService.register(org.astrogrid.samp.hub.ProfileToken)with a particularprofileToken.booleanIndicates whether this hub service is currently open for operations.register(ProfileToken profileToken) Creates a new connection to this hub service, thereby initiating a new registered client.voidshutdown()Tidies up any resources owned by this object.voidstart()No-op.
-
Constructor Details
-
FacadeHubService
Constructor.- Parameters:
profile- defines the hub connection factory on which this service is based
-
-
Method Details
-
isHubRunning
public boolean isHubRunning()Description copied from interface:HubServiceIndicates whether this hub service is currently open for operations.- Specified by:
isHubRunningin interfaceHubService- Returns:
- true iff called between
HubService.start()andHubService.shutdown()
-
register
Description copied from interface:HubServiceCreates a new connection to this hub service, thereby initiating a new registered client.It is the responsibility of the returned connection, not the user of that connection, to broadcast the various
samp.hub.event.*notifications at the appropriate times.Most of the
HubConnectionmethods are declared to throwSampException, however, implementations may throw unchecked exceptions if that is more convenient; users of the connection should be prepared to catch these if they occur.- Specified by:
registerin interfaceHubService- Parameters:
profileToken- identifier for the profile acting as gatekeeper for this connection- Returns:
- new hub connection representing registration of a new client
- Throws:
SampException
-
disconnectAll
Description copied from interface:HubServiceForcibly terminates any connections created by a previous call ofHubService.register(org.astrogrid.samp.hub.ProfileToken)with a particularprofileToken. Any necessary hub events will be sent.- Specified by:
disconnectAllin interfaceHubService- Parameters:
profileToken- previous argument toregister
-
start
public void start()No-op.- Specified by:
startin interfaceHubService
-
shutdown
public void shutdown()Description copied from interface:HubServiceTidies up any resources owned by this object. Should be called when no longer required.- Specified by:
shutdownin interfaceHubService
-