org.webbitserver.wrapper
Class WebSocketConnectionWrapper

java.lang.Object
  extended by org.webbitserver.wrapper.WebSocketConnectionWrapper
All Implemented Interfaces:
Executor, DataHolder, HttpConnection, WebSocketConnection

public class WebSocketConnectionWrapper
extends Object
implements WebSocketConnection


Constructor Summary
WebSocketConnectionWrapper(WebSocketConnection connection)
           
 
Method Summary
 WebSocketConnectionWrapper close()
           
 Map<String,Object> data()
          Arbitrary data that can be stored for the lifetime of the connection.
 Object data(String key)
          Retrieve data value by key.
 WebSocketConnectionWrapper data(String key, Object value)
          Store data value by key.
 Set<String> dataKeys()
          List data keys.
 void execute(Runnable command)
           
 Executor handlerExecutor()
           
 HttpRequest httpRequest()
           
 WebSocketConnection originalControl()
           
 WebSocketConnectionWrapper ping(byte[] msg)
          Sends a ping frame
 WebSocketConnectionWrapper pong(byte[] msg)
          Sends a pong frame
 WebSocketConnectionWrapper send(byte[] message)
          Sends a binary frame
 WebSocketConnectionWrapper send(byte[] message, int offset, int length)
          Sends a binary frame
 WebSocketConnectionWrapper send(String message)
          Sends a text frame
 WebSocketConnection underlyingControl()
           
 WebSocketConnectionWrapper underlyingControl(WebSocketConnection control)
           
 String version()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketConnectionWrapper

public WebSocketConnectionWrapper(WebSocketConnection connection)
Method Detail

underlyingControl

public WebSocketConnection underlyingControl()

underlyingControl

public WebSocketConnectionWrapper underlyingControl(WebSocketConnection control)

originalControl

public WebSocketConnection originalControl()

httpRequest

public HttpRequest httpRequest()
Specified by:
httpRequest in interface HttpConnection

send

public WebSocketConnectionWrapper send(String message)
Description copied from interface: WebSocketConnection
Sends a text frame

Specified by:
send in interface WebSocketConnection
Parameters:
message - frame payload
Returns:
this

send

public WebSocketConnectionWrapper send(byte[] message)
Description copied from interface: WebSocketConnection
Sends a binary frame

Specified by:
send in interface WebSocketConnection
Parameters:
message - frame payload
Returns:
this

ping

public WebSocketConnectionWrapper ping(byte[] msg)
Description copied from interface: WebSocketConnection
Sends a ping frame

Specified by:
ping in interface WebSocketConnection
Parameters:
msg - the payload of the ping
Returns:
this

send

public WebSocketConnectionWrapper send(byte[] message,
                                       int offset,
                                       int length)
Description copied from interface: WebSocketConnection
Sends a binary frame

Specified by:
send in interface WebSocketConnection
Parameters:
message - frame payload
offset - The offset within the array of the first byte to be written; must be non-negative and no larger than message.length
length - The maximum number of bytes to be written to the given array; must be non-negative and no larger than message.length - offset
Returns:
this

pong

public WebSocketConnectionWrapper pong(byte[] msg)
Description copied from interface: WebSocketConnection
Sends a pong frame

Specified by:
pong in interface WebSocketConnection
Parameters:
msg - the payload of the ping
Returns:
this

close

public WebSocketConnectionWrapper close()
Specified by:
close in interface HttpConnection
Specified by:
close in interface WebSocketConnection

data

public Map<String,Object> data()
Description copied from interface: DataHolder
Arbitrary data that can be stored for the lifetime of the connection.

Specified by:
data in interface DataHolder

data

public Object data(String key)
Description copied from interface: DataHolder
Retrieve data value by key.

Specified by:
data in interface DataHolder
See Also:
DataHolder.data()

data

public WebSocketConnectionWrapper data(String key,
                                       Object value)
Description copied from interface: DataHolder
Store data value by key.

Specified by:
data in interface DataHolder
Specified by:
data in interface WebSocketConnection
See Also:
DataHolder.data()

dataKeys

public Set<String> dataKeys()
Description copied from interface: DataHolder
List data keys.

Specified by:
dataKeys in interface DataHolder
See Also:
DataHolder.data()

handlerExecutor

public Executor handlerExecutor()
Specified by:
handlerExecutor in interface HttpConnection

version

public String version()
Specified by:
version in interface WebSocketConnection
Returns:
the WebSocket protocol version

execute

public void execute(Runnable command)
Specified by:
execute in interface Executor


Copyright © 2012. All Rights Reserved.