org.glassfish.grizzly.websockets
Class WebSocketMeta

java.lang.Object
  extended by org.glassfish.grizzly.websockets.WebSocketMeta
Direct Known Subclasses:
ClientWebSocketMeta, ServerWebSocketMeta

public abstract class WebSocketMeta
extends java.lang.Object

WebSocket meta information.

Author:
Alexey Stashok
See Also:
ClientWebSocketMeta, ServerWebSocketMeta

Constructor Summary
WebSocketMeta(java.net.URI uri)
          Construct a WebSocketMeta using URI.
WebSocketMeta(java.net.URI uri, java.lang.String origin, java.lang.String protocol, java.lang.Boolean isSecure)
          Construct a WebSocketMeta with the passed parameters.
 
Method Summary
 HttpHeader getHandshakeHeader()
          Returns websocket handshake header, represented as HttpHeader.
 java.lang.String getOrigin()
          Gets the WebSocket Origin header value.
 java.lang.String getProtocol()
          Gets the WebSocket Sec-WebSocket-Protocol header value.
 java.net.URI getURI()
          Gets WebSocket URI.
 boolean isSecure()
          Returns true, if this WebSocket communication won't be secured, or false otherwise.
protected  void setHandshakeHeader(HttpHeader httpHeader)
          Set the websocket handshake header, represented as HttpHeader.
 java.lang.String toString()
          The WebSocketMeta string description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebSocketMeta

public WebSocketMeta(java.net.URI uri)
Construct a WebSocketMeta using URI. Origin header will be set to "http://localhost"

Parameters:
uri - WebSocket URI

WebSocketMeta

public WebSocketMeta(java.net.URI uri,
                     java.lang.String origin,
                     java.lang.String protocol,
                     java.lang.Boolean isSecure)
Construct a WebSocketMeta with the passed parameters.

Parameters:
uri - WebSocket URI
origin - the WebSocket Origin header value.
protocol - the WebSocket Sec-WebSocket-Protocol header value.
isSecure - true, if websocket is secured "wss", or false otherwise.
Method Detail

getURI

public java.net.URI getURI()
Gets WebSocket URI.

Returns:
WebSocket URI.

getOrigin

public java.lang.String getOrigin()
Gets the WebSocket Origin header value.

Returns:
the WebSocket Origin header value.

getProtocol

public java.lang.String getProtocol()
Gets the WebSocket Sec-WebSocket-Protocol header value.

Returns:
the WebSocket Sec-WebSocket-Protocol header value.

isSecure

public boolean isSecure()
Returns true, if this WebSocket communication won't be secured, or false otherwise.

Returns:
true, if this WebSocket communication won't be secured, or false otherwise.

getHandshakeHeader

public HttpHeader getHandshakeHeader()
Returns websocket handshake header, represented as HttpHeader.

Returns:
websocket handshake header, represented as HttpHeader.

setHandshakeHeader

protected void setHandshakeHeader(HttpHeader httpHeader)
Set the websocket handshake header, represented as HttpHeader.

Parameters:
httpHeader - websocket handshake header, represented as HttpHeader.

toString

public java.lang.String toString()
The WebSocketMeta string description.

Overrides:
toString in class java.lang.Object
Returns:
the WebSocketMeta string description.


Copyright © 2011 Oracle Corpration. All Rights Reserved.