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 Object

WebSocket meta information.

Author:
Alexey Stashok
See Also:
ClientWebSocketMeta, ServerWebSocketMeta

Constructor Summary
WebSocketMeta(URI uri)
          Construct a WebSocketMeta using URI.
WebSocketMeta(URI uri, String origin, String protocol, Boolean isSecure)
          Construct a WebSocketMeta with the passed parameters.
 
Method Summary
 HttpHeader getHandshakeHeader()
          Returns websocket handshake header, represented as HttpHeader.
 String getOrigin()
          Gets the WebSocket Origin header value.
 String getProtocol()
          Gets the WebSocket Sec-WebSocket-Protocol header value.
 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.
 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(URI uri)
Construct a WebSocketMeta using URI. Origin header will be set to "http://localhost"

Parameters:
uri - WebSocket URI

WebSocketMeta

public WebSocketMeta(URI uri,
                     String origin,
                     String protocol,
                     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 URI getURI()
Gets WebSocket URI.

Returns:
WebSocket URI.

getOrigin

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

Returns:
the WebSocket Origin header value.

getProtocol

public 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 String toString()
The WebSocketMeta string description.

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


Copyright © 2010 Oracle Corpration. All Rights Reserved.