eneter.messaging.messagingsystems.websocketmessagingsystem
Class WebSocketMessage

java.lang.Object
  extended by eneter.messaging.messagingsystems.websocketmessagingsystem.WebSocketMessage

public final class WebSocketMessage
extends java.lang.Object

Represents a data message received via websocket communication.


Method Summary
 java.io.InputStream getInputStream()
          Returns the input stream user can use to read the message from.
 byte[] getWholeMessage()
          Returns the whole incoming message.
 java.lang.String getWholeTextMessage()
          Returns the whole incoming text message.
 boolean isText()
          Returns true if the message is text.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWholeMessage

public byte[] getWholeMessage()
                       throws java.io.IOException
Returns the whole incoming message. In case the message was sent via multiple frames it waits until all frames are collected and then returns the result message.

Returns:
received message
Throws:
java.io.IOException

getWholeTextMessage

public java.lang.String getWholeTextMessage()
                                     throws java.io.IOException
Returns the whole incoming text message. In case the message was sent via multiple frames it waits until all frames are collected and then returns the result message.
To receive message as a text message, according to websocket protocol the message must be sent via the text frame.

Returns:
received text message
Throws:
java.io.IOException

isText

public boolean isText()
Returns true if the message is text. The message is text when sent via text frame.

Returns:

getInputStream

public java.io.InputStream getInputStream()
Returns the input stream user can use to read the message from. The reading of the stream blocks if desired amount of data is not available and not all message frames were received.

Returns: