Interface GridCommunicationClient
-
- All Known Implementing Classes:
GridAbstractCommunicationClient,GridTcpNioCommunicationClient
public interface GridCommunicationClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanasync()booleanclose()booleanclosed()intconnectionIndex()voiddoHandshake(IgniteInClosure2X<InputStream,OutputStream> handshakeC)Executes the given handshake closure on opened client passing underlying IO streams.voidforceClose()Forces client close.longgetIdleTime()Gets idle time of this client.voidrelease()Releases this client by decreasing reservations.booleanreserve()voidsendMessage(byte[] data, int len)booleansendMessage(@Nullable UUID nodeId, Message msg, @Nullable IgniteInClosure<IgniteException> c)voidsendMessage(ByteBuffer data)
-
-
-
Method Detail
-
doHandshake
void doHandshake(IgniteInClosure2X<InputStream,OutputStream> handshakeC) throws IgniteCheckedException
Executes the given handshake closure on opened client passing underlying IO streams. This method pulled to client interface a handshake is only operation requiring access to both output and input streams.- Parameters:
handshakeC- Handshake.- Throws:
IgniteCheckedException- If handshake failed.
-
close
boolean close()
- Returns:
Trueif client has been closed by this call,falseif failed to close client (due to concurrent reservation or concurrent close).
-
forceClose
void forceClose()
Forces client close.
-
closed
boolean closed()
- Returns:
Trueif client is closed;
-
reserve
boolean reserve()
- Returns:
Trueif client was reserved,falseotherwise.
-
release
void release()
Releases this client by decreasing reservations.
-
getIdleTime
long getIdleTime()
Gets idle time of this client.- Returns:
- Idle time of this client.
-
sendMessage
void sendMessage(ByteBuffer data) throws IgniteCheckedException
- Parameters:
data- Data to send.- Throws:
IgniteCheckedException- If failed.
-
sendMessage
void sendMessage(byte[] data, int len) throws IgniteCheckedException- Parameters:
data- Data to send.len- Length.- Throws:
IgniteCheckedException- If failed.
-
sendMessage
boolean sendMessage(@Nullable @Nullable UUID nodeId, Message msg, @Nullable @Nullable IgniteInClosure<IgniteException> c) throws IgniteCheckedException- Parameters:
nodeId- Remote node ID. Provided only for sync clients.msg- Message to send.c- Ack closure.- Returns:
Trueif should try to resend message.- Throws:
IgniteCheckedException- If failed.
-
async
boolean async()
- Returns:
Trueif send is asynchronous.
-
connectionIndex
int connectionIndex()
- Returns:
- Connection index.
-
-