Package org.astrogrid.samp.gui
Class MessageTrackerHubService
java.lang.Object
org.astrogrid.samp.hub.BasicHubService
org.astrogrid.samp.gui.GuiHubService
org.astrogrid.samp.gui.MessageTrackerHubService
- All Implemented Interfaces:
HubService
GuiHubService subclass which additionally keeps track of which messages
have been sent and received, and can provide a graphical display of these.
The overhead in maintaining the GUI display can be significant if there is
high volume of message traffic.
- Since:
- 20 Nov 2008
- Author:
- Mark Taylor
-
Field Summary
Fields inherited from class org.astrogrid.samp.hub.BasicHubService
MAX_TIMEOUT, MAX_WAITERS
-
Constructor Summary
ConstructorsConstructorDescriptionMessageTrackerHubService
(Random random) Constructs a hub service with default message tracker GUI expiry times.MessageTrackerHubService
(Random random, int listRemoveDelay, int tableRemoveDelay, int tableMaxRows) Constructs a hub service with specified message tracker GUI expiry times. -
Method Summary
Modifier and TypeMethodDescriptioncreateClient
(String publicId, ProfileToken ptoken) Factory method used to create all the client objects which will be used by this hub service.Factory method used to create the client set used by this hub service.Creates a new component containing a display of the current hub internal state.Returns the selection model corresponding to this service's client list model.getRxListModel
(Client client) Returns a ListModel representing the pending messages received by a given client.getTxListModel
(Client client) Returns a ListModel representing the pending messages sent from a given client.protected void
Does the work for thereply
method of connections registered with this service.void
start()
Begin operation.Methods inherited from class org.astrogrid.samp.gui.GuiHubService
createHubWindow, createMenus, declareMetadata, declareSubscriptions, getClientListModel
Methods inherited from class org.astrogrid.samp.hub.BasicHubService
call, callAll, callAndWait, createConnection, createHubMessageHandlers, disconnect, disconnectAll, getClientSet, getIdComparator, getMetadata, getRegisteredClients, getServiceConnection, getSubscribedClients, getSubscriptions, isHubRunning, notify, notifyAll, register, setCallable, shutdown, unregister
-
Constructor Details
-
MessageTrackerHubService
Constructs a hub service with default message tracker GUI expiry times.- Parameters:
random
- random number generator
-
MessageTrackerHubService
public MessageTrackerHubService(Random random, int listRemoveDelay, int tableRemoveDelay, int tableMaxRows) Constructs a hub service with specified message tracker GUI expiry times. The delay times are times in milliseconds after message resolution before message representations expire and hence remove themselves from gui components.- Parameters:
random
- random number generatorlistRemoveDelay
- expiry delay for summary icons in client list displaytableRemoveDelay
- expiry delay for rows in message table displaytableMaxRows
- maximum number of rows in message table (beyond this limit resolved messages may be removed early)
-
-
Method Details
-
start
public void start()Description copied from interface:HubService
Begin operation. TheHubService.register(org.astrogrid.samp.hub.ProfileToken)
method should not be called until the hub has been started.- Specified by:
start
in interfaceHubService
- Overrides:
start
in classGuiHubService
-
createClientSet
Description copied from class:BasicHubService
Factory method used to create the client set used by this hub service.- Overrides:
createClientSet
in classGuiHubService
- Returns:
- client set
-
createClient
Description copied from class:BasicHubService
Factory method used to create all the client objects which will be used by this hub service.- Overrides:
createClient
in classBasicHubService
- Parameters:
publicId
- client public IDptoken
- connection source- Returns:
- hub client
-
createHubPanel
Description copied from class:GuiHubService
Creates a new component containing a display of the current hub internal state.- Overrides:
createHubPanel
in classGuiHubService
- Returns:
- new hub viewer panel
-
getClientSelectionModel
Description copied from class:GuiHubService
Returns the selection model corresponding to this service's client list model.- Overrides:
getClientSelectionModel
in classGuiHubService
- Returns:
- list selection model for client selection
-
getTxListModel
Returns a ListModel representing the pending messages sent from a given client. Elements of the model areTransmission
objects.- Parameters:
client
- client owned by this hub service- Returns:
- transmission list model
-
getRxListModel
Returns a ListModel representing the pending messages received by a given client. Elements of the model areTransmission
objects.- Parameters:
client
- client owned by this hub service- Returns:
- transmission list model
-
reply
Description copied from class:BasicHubService
Does the work for thereply
method of connections registered with this service.- Overrides:
reply
in classBasicHubService
- Parameters:
caller
- calling clientmsgId
- message IDresponse
- response to forward- Throws:
SampException
- See Also:
-