public class EneterProtocolFormatter extends java.lang.Object implements IProtocolFormatter
Constructor and Description |
---|
EneterProtocolFormatter() |
Modifier and Type | Method and Description |
---|---|
ProtocolMessage |
decodeMessage(java.io.InputStream readStream)
Decodes message from the stream.
|
ProtocolMessage |
decodeMessage(java.lang.Object readMessage)
Decodes message from the given object.
|
java.lang.Object |
encodeCloseConnectionMessage(java.lang.String responseReceiverId)
Encodes the close connection request message.
|
void |
encodeCloseConnectionMessage(java.lang.String responseReceiverId,
java.io.OutputStream outputSream)
Encodes the close connection request message to the stream.
|
java.lang.Object |
encodeMessage(java.lang.String responseReceiverId,
java.lang.Object message)
Encodes the data message.
|
void |
encodeMessage(java.lang.String responseReceiverId,
java.lang.Object message,
java.io.OutputStream outputSream)
Encodes the data message into the stream.
|
java.lang.Object |
encodeOpenConnectionMessage(java.lang.String responseReceiverId)
Encodes the open connection request message.
|
void |
encodeOpenConnectionMessage(java.lang.String responseReceiverId,
java.io.OutputStream outputSream)
Encodes the open connection request message to the stream.
|
public java.lang.Object encodeOpenConnectionMessage(java.lang.String responseReceiverId) throws java.lang.Exception
IProtocolFormatter
encodeOpenConnectionMessage
in interface IProtocolFormatter
responseReceiverId
- id of the client opening the connection.java.lang.Exception
public void encodeOpenConnectionMessage(java.lang.String responseReceiverId, java.io.OutputStream outputSream) throws java.lang.Exception
IProtocolFormatter
encodeOpenConnectionMessage
in interface IProtocolFormatter
responseReceiverId
- id of the client opening the connection.outputSream
- output where the encoded open connection message is writtenjava.lang.Exception
public java.lang.Object encodeCloseConnectionMessage(java.lang.String responseReceiverId) throws java.lang.Exception
IProtocolFormatter
encodeCloseConnectionMessage
in interface IProtocolFormatter
responseReceiverId
- id of the client that wants to disconnect or that will be disconnectedjava.lang.Exception
public void encodeCloseConnectionMessage(java.lang.String responseReceiverId, java.io.OutputStream outputSream) throws java.lang.Exception
IProtocolFormatter
encodeCloseConnectionMessage
in interface IProtocolFormatter
responseReceiverId
- id of the client that wants to disconnect or that will be disconnectedoutputSream
- output where the encoded close connection message is writtenjava.lang.Exception
public java.lang.Object encodeMessage(java.lang.String responseReceiverId, java.lang.Object message) throws java.lang.Exception
IProtocolFormatter
encodeMessage
in interface IProtocolFormatter
responseReceiverId
- client id.message
- serialized message to be sent.java.lang.Exception
public void encodeMessage(java.lang.String responseReceiverId, java.lang.Object message, java.io.OutputStream outputSream) throws java.lang.Exception
IProtocolFormatter
encodeMessage
in interface IProtocolFormatter
responseReceiverId
- id of the client that wants to send the message.message
- serialized message to be sent.outputSream
- output where the encoded message is writtenjava.lang.Exception
public ProtocolMessage decodeMessage(java.io.InputStream readStream)
IProtocolFormatter
decodeMessage
in interface IProtocolFormatter
readStream
- stream to be readpublic ProtocolMessage decodeMessage(java.lang.Object readMessage)
IProtocolFormatter
decodeMessage
in interface IProtocolFormatter
readMessage
- reference to the object.