public abstract class DataClient extends Object implements DataSender
Modifier and Type | Class and Description |
---|---|
static class |
DataClient.Events
SubData Client Event API Class
|
Modifier and Type | Field and Description |
---|---|
DataClient.Events |
on |
Constructor and Description |
---|
DataClient() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Closes the connection
|
abstract <ForwardableMessageOut extends MessageOut & Forwardable> |
forwardMessage(UUID id,
ForwardableMessageOut message)
Forward a message to another Client
|
abstract InetSocketAddress |
getAddress()
Get Remote Address
|
abstract void |
getClient(UUID id,
Callback<ObjectMap<String>> callback)
Grabs a Client from the Network
|
abstract void |
getClients(Callback<Map<UUID,? extends ObjectMap<String>>> callback)
Grabs all the Clients on the Network
|
DataClient |
getConnection()
Deprecated.
The Client connection to the Server is this
|
UUID |
getID()
Get the ID of this Client
|
abstract DataProtocol |
getProtocol()
Get the Protocol for this Client
|
abstract boolean |
isClosed()
Get if the connection has been closed
|
abstract DataClient |
openChannel()
Open an Async Data SubChannel
|
abstract void |
ping(Callback<PingResponse> response)
Ping the Server
|
abstract void |
ping(UUID id,
Callback<PingResponse> response)
Ping a remote Client
|
abstract void |
sendMessage(MessageOut message)
Send a message to the Server
|
void |
waitFor()
Wait for the connection to close
|
public final DataClient.Events on
public abstract void getClient(UUID id, Callback<ObjectMap<String>> callback)
id
- Client IDpublic abstract void getClients(Callback<Map<UUID,? extends ObjectMap<String>>> callback)
public abstract void ping(Callback<PingResponse> response)
ping
in interface DataSender
response
- Ping Responsepublic abstract void ping(UUID id, Callback<PingResponse> response)
id
- Client IDresponse
- Ping Responsepublic abstract void sendMessage(MessageOut message)
sendMessage
in interface DataSender
message
- Message to sendPackets must NOT e tagged as Forward-Only
public abstract <ForwardableMessageOut extends MessageOut & Forwardable> void forwardMessage(UUID id, ForwardableMessageOut message)
id
- Client IDmessage
- Message to sendMessages must be tagged as Forwardable
@Deprecated public DataClient getConnection()
getConnection
in interface DataSender
public abstract DataProtocol getProtocol()
getProtocol
in interface DataSender
public UUID getID()
getID
in interface DataSender
public abstract InetSocketAddress getAddress()
public abstract DataClient openChannel() throws IOException
IOException
public abstract void close() throws IOException
IOException
public void waitFor() throws InterruptedException
InterruptedException
public abstract boolean isClosed()
Copyright © 2019. All rights reserved.