@XmlHints(allowTopLevelDefinition=true) public class SafeProtocol extends AbstractByteProtocol
TcpProtocol and precedes every message with a cookie. It should probably not be
used in production. Should probably change to LengthProtocol. Both sender and receiver must use the same protocol.| Modifier and Type | Field and Description |
|---|---|
static String |
COOKIE |
EOF, NO_MAX_LENGTH, NO_STREAM, objectSerializer, rethrowExceptionOnRead, STREAM_OK, streamOk| Constructor and Description |
|---|
SafeProtocol() |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
read(InputStream inputStream)
Reads the actual data only after assuring that the cookie was preceding the message.
|
void |
setObjectSerializer(ObjectSerializer objectSerializer) |
void |
write(OutputStream os,
Object data,
String encoding)
Write the specified message into the
OutputStream. |
copy, copy, nullIfEmptyArray, safeRead, safeRead, writeByteArraypublic static final String COOKIE
public InputStream read(InputStream inputStream) throws IOException
inputStream - null if the cookie could not be successfully received.IOExceptionpublic void write(OutputStream os, Object data, String encoding) throws IOException
OutputStream.os - the OutputStream in which the data is going to be writtendata - data to be writtenencoding - in which the data will be serialized if its type is StringIOException - if an exception occurs@Inject public void setObjectSerializer(ObjectSerializer objectSerializer)
setObjectSerializer in class AbstractByteProtocolCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.