public interface Protocol
In order to send and receive documents via the Socket Adapter, it is mandatory for an implementation of this interface to be available.
Modifier and Type | Method and Description |
---|---|
byte[] |
getReceivedAsBytes()
Get the received document as a byte array.
|
java.io.InputStream |
getReceivedAsStream()
Get the received document as a stream.
|
byte[] |
getReplyAsBytes()
Return the reply from the receiving party.
|
java.io.InputStream |
getReplyAsStream()
Get the reply as an InputStream.
|
void |
receiveDocument()
Receive a document.
|
void |
receiveDocumentError()
The document receive was processed incorrectly, send a reply indicating
it.
|
void |
receiveDocumentSuccess()
The document receive was processed correctly, send a reply indicating it.
|
void |
sendDocument(byte[] bytes)
Send a document.
|
void |
setSocket(java.net.Socket s)
Set the Socket that should be used for the next conversation.
|
boolean |
wasSendSuccess()
Return true if the
sendDocument was considered successful. |
void setSocket(java.net.Socket s)
s
- the socket.void sendDocument(byte[] bytes) throws java.io.IOException
bytes
- the bytes to send.java.io.IOException
- wrapping any underlying exception.byte[] getReplyAsBytes() throws java.io.IOException, java.lang.IllegalStateException
java.io.IOException
- if there was a failure getting the reply.java.lang.IllegalStateException
- if the previous command was not
sendDocument
sendDocument(byte[])
boolean wasSendSuccess() throws java.lang.IllegalStateException
sendDocument
was considered successful.java.lang.IllegalStateException
- if the previoussendDocument(byte[])
java.io.InputStream getReplyAsStream() throws java.io.IOException, java.lang.IllegalStateException
java.io.IOException
- if there was a failure getting the reply.java.lang.IllegalStateException
- if the previous command was not
sendDocument
getReplyAsBytes()
void receiveDocument() throws java.io.IOException
java.io.IOException
- wrapping any underlying exception.java.io.InputStream getReceivedAsStream() throws java.io.IOException, java.lang.IllegalStateException
java.io.IOException
- if there was a failure g.etting the received doc.java.lang.IllegalStateException
- if the previous command was not
receiveDocument
byte[] getReceivedAsBytes() throws java.io.IOException, java.lang.IllegalStateException
java.io.IOException
- if there was a failure getting the received doc.java.lang.IllegalStateException
- if the previous command was not
receiveDocument
void receiveDocumentSuccess() throws java.io.IOException, java.lang.IllegalStateException
java.io.IOException
- if there was a failure sending the reply.java.lang.IllegalStateException
- if the previous command was not
receiveDocument
void receiveDocumentError() throws java.io.IOException, java.lang.IllegalStateException
java.io.IOException
- if there was a failure sending the reply.java.lang.IllegalStateException
- if the previous command was not
receiveDocument