Package org.apache.nifi.remote.io.socket
Class SocketCommunicationsSession
java.lang.Object
org.apache.nifi.remote.AbstractCommunicationsSession
org.apache.nifi.remote.io.socket.SocketCommunicationsSession
- All Implemented Interfaces:
Closeable
,AutoCloseable
,CommunicationsSession
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SocketInput
private final SocketOutput
private final Socket
private int
Fields inherited from interface org.apache.nifi.remote.protocol.CommunicationsSession
MAGIC_BYTES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
long
long
getInput()
int
void
Asynchronously interrupts this FlowFileCodec.boolean
isClosed()
boolean
void
setTimeout
(int millis) Methods inherited from class org.apache.nifi.remote.AbstractCommunicationsSession
createTransitUri, getUserDn, setUserDn
-
Field Details
-
socket
-
request
-
response
-
timeout
private int timeout
-
-
Constructor Details
-
SocketCommunicationsSession
- Throws:
IOException
-
-
Method Details
-
isClosed
public boolean isClosed()- Returns:
true
if the connection is closed,false
otherwise
-
getInput
-
getOutput
-
setTimeout
- Throws:
IOException
-
getTimeout
- Throws:
IOException
-
close
- Throws:
IOException
-
isDataAvailable
public boolean isDataAvailable() -
getBytesWritten
public long getBytesWritten() -
getBytesRead
public long getBytesRead() -
interrupt
public void interrupt()Description copied from interface:CommunicationsSession
Asynchronously interrupts this FlowFileCodec. Implementations must ensure that they stop sending and receiving data as soon as possible after this method has been called, even if doing so results in sending only partial data to the peer. This will usually result in the peer throwing a SocketTimeoutException.
-