public class ClientRegWatcher extends Object implements org.astrogrid.samp.client.CallableClient
Constructor and Description |
---|
ClientRegWatcher(org.astrogrid.samp.client.HubConnection connection)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getIdFromName(String name)
Returns the client ID of a client with a given name if one is registered.
|
org.astrogrid.samp.Subscriptions |
getSubscriptions()
Returns the subscriptions object indicating the MTypes this client
can handle.
|
void |
receiveCall(String senderId,
String msgId,
org.astrogrid.samp.Message msg) |
void |
receiveNotification(String senderId,
org.astrogrid.samp.Message msg) |
void |
receiveResponse(String responderId,
String msgTag,
org.astrogrid.samp.Response response) |
String |
waitForIdFromName(String name,
long waitMillis)
Blocks until a client with a given name is regstered,
and then returns its client ID.
|
org.astrogrid.samp.Response |
waitForResponse(String msgTag)
Blocks until a response with a given tag is received, then returns
that response.
|
public ClientRegWatcher(org.astrogrid.samp.client.HubConnection connection)
connection
- hub connectionpublic org.astrogrid.samp.Subscriptions getSubscriptions()
public String waitForIdFromName(String name, long waitMillis)
name
- client name soughtwaitMillis
- maximum number of milliseconds to waitname
,
or null if timeout is exceededpublic String getIdFromName(String name)
name
- client namename
,
or null if none is currently registeredpublic org.astrogrid.samp.Response waitForResponse(String msgTag)
msgTag
- message tagpublic void receiveCall(String senderId, String msgId, org.astrogrid.samp.Message msg) throws org.astrogrid.samp.client.SampException
receiveCall
in interface org.astrogrid.samp.client.CallableClient
org.astrogrid.samp.client.SampException
public void receiveNotification(String senderId, org.astrogrid.samp.Message msg)
receiveNotification
in interface org.astrogrid.samp.client.CallableClient
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.