org.glassfish.grizzly.websockets
Class ClientWebSocketMeta

java.lang.Object
  extended by org.glassfish.grizzly.websockets.WebSocketMeta
      extended by org.glassfish.grizzly.websockets.ClientWebSocketMeta

public class ClientWebSocketMeta
extends WebSocketMeta

Client-side WebSocket meta information.

Author:
Alexey Stashok
See Also:
WebSocketMeta, ServerWebSocketMeta

Constructor Summary
ClientWebSocketMeta(URI uri)
          Construct a client-side WebSocketMeta using URI.
ClientWebSocketMeta(URI uri, String origin, String protocol, String host, String key1, String key2, byte[] key3, Boolean isSecure)
          Construct a client-side WebSocketMeta.
 
Method Summary
 String getHost()
          Gets the WebSocket "Host" header value.
 SecKey getKey1()
          Gets the WebSocket "Sec-WebSocket-Key1" header value.
 SecKey getKey2()
          Gets the WebSocket "Sec-WebSocket-Key2" header value.
 byte[] getKey3()
          Gets the WebSocket key3 value transferred as a payload.
 String toString()
          The WebSocketMeta string description.
 
Methods inherited from class org.glassfish.grizzly.websockets.WebSocketMeta
getHandshakeHeader, getOrigin, getProtocol, getURI, isSecure, setHandshakeHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientWebSocketMeta

public ClientWebSocketMeta(URI uri)
Construct a client-side WebSocketMeta using URI. Origin header will be set to "http://localhost" Sec-WebSocket-Key1, Sec-WebSocket-Key2 and key3 will be autogenerated.

Parameters:
uri - WebSocket URI

ClientWebSocketMeta

public ClientWebSocketMeta(URI uri,
                           String origin,
                           String protocol,
                           String host,
                           String key1,
                           String key2,
                           byte[] key3,
                           Boolean isSecure)
Construct a client-side WebSocketMeta.

Parameters:
uri - WebSocket URI
origin - the WebSocket "Origin" header value
protocol - the WebSocket "Sec-WebSocket-Protocol" header value
host - the WebSocket "Host" header value
key1 - the WebSocket "Sec-WebSocket-Key1" header value
key2 - the WebSocket "Sec-WebSocket-Key2" header value
key3 - the WebSocket key3 value transferred as a payload.
isSecure - true, if the WebSocket will be used in the secured mode, or false otherwise. It's possible to pass null, in this case WebSocket will try to autodetect security basing on passed uri parameter.
Method Detail

getHost

public String getHost()
Gets the WebSocket "Host" header value.

Returns:
the WebSocket "Host" header value.

getKey1

public SecKey getKey1()
Gets the WebSocket "Sec-WebSocket-Key1" header value.

Returns:
the WebSocket "Sec-WebSocket-Key1" header value.

getKey2

public SecKey getKey2()
Gets the WebSocket "Sec-WebSocket-Key2" header value.

Returns:
the WebSocket "Sec-WebSocket-Key2" header value.

getKey3

public byte[] getKey3()
Gets the WebSocket key3 value transferred as a payload.

Returns:
the WebSocket key3 value transferred as a payload.

toString

public String toString()
Description copied from class: WebSocketMeta
The WebSocketMeta string description.

Overrides:
toString in class WebSocketMeta
Returns:
the WebSocketMeta string description.


Copyright © 2010 Oracle Corpration. All Rights Reserved.