Package net.ME1312.SubData.Client
Class DataClient
java.lang.Object
net.ME1312.SubData.Client.DataClient
- All Implemented Interfaces:
DataSender
SubData Client API Class
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
Closes the connectionabstract void
forwardMessage
(UUID id, MessageOut... messages) Forward a message to another Clientabstract InetSocketAddress
Get Remote Addressabstract int
Get SubData's default Block Sizeabstract void
Grabs a Client from the Networkabstract void
Grabs all the Clients on the NetworkDeprecated.The Client connection to the Server is thisgetID()
Get the ID of this Clientabstract DataProtocol
Get the Protocol for this Clientabstract boolean
isClosed()
Get if the connection has been closedabstract DataClient
Open an Async Data SubChannelabstract void
ping
(Consumer<PingResponse> response) Ping the Serverabstract void
ping
(UUID id, Consumer<PingResponse> response) Ping a remote Clientabstract void
sendMessage
(MessageOut... messages) Send a message to the Serverabstract void
tempBlockSize
(Integer size) Set SubData's Block Size for the current messagevoid
waitFor()
Wait for the connection to close
-
Field Details
-
on
-
-
Constructor Details
-
DataClient
public DataClient()
-
-
Method Details
-
getClient
Grabs a Client from the Network- Parameters:
id
- Client ID
-
getClients
Grabs all the Clients on the Network -
ping
Ping the Server- Specified by:
ping
in interfaceDataSender
- Parameters:
response
- Ping Response
-
ping
Ping a remote Client- Parameters:
id
- Client IDresponse
- Ping Response
-
sendMessage
Send a message to the Server- Specified by:
sendMessage
in interfaceDataSender
- Parameters:
messages
- Messages to send- See Also:
-
forwardMessage
Forward a message to another Client- Parameters:
id
- Client IDmessages
- Messages to send- See Also:
-
getBlockSize
public abstract int getBlockSize()Get SubData's default Block Size- Returns:
- Block Size
-
tempBlockSize
Set SubData's Block Size for the current message- Parameters:
size
- Block Size (null for default)
-
getConnection
Deprecated.The Client connection to the Server is thisGet the Client that connects the Server to us- Specified by:
getConnection
in interfaceDataSender
- Returns:
- This Client
-
getProtocol
Get the Protocol for this Client- Specified by:
getProtocol
in interfaceDataSender
- Returns:
- Client Protocol
-
getID
Get the ID of this Client- Specified by:
getID
in interfaceDataSender
- Returns:
- Client ID
-
getAddress
Get Remote Address- Returns:
- Address
-
newChannel
Open an Async Data SubChannel- Returns:
- New SubData Channel
- Throws:
IOException
-
close
Closes the connection- Throws:
IOException
-
waitFor
Wait for the connection to close- Throws:
InterruptedException
-
isClosed
public abstract boolean isClosed()Get if the connection has been closed- Returns:
- Closed Status
-