com.sun.grizzly.websockets
Class HandShake

java.lang.Object
  extended by com.sun.grizzly.websockets.HandShake
Direct Known Subclasses:
ClientHandShake, ServerHandShake

public abstract class HandShake
extends Object

Author:
Justin Lee

Constructor Summary
HandShake(boolean isSecure, String path)
           
HandShake(boolean isSecure, String origin, String serverHostName, String portNumber, String resourcePath)
           
 
Method Summary
 String getLocation()
           
 String getOrigin()
          Origin (bytes 4F 72 69 67 69 6E; always the fourth name-value pair)

The value gives the scheme, hostname, and port (if it's not the default port for the given scheme) of the page that asked the client to open the Web Socket.

 String getPort()
           
 String getResourcePath()
           
 String getServerHostName()
           
 String getSubProtocol()
          WebSocket-Protocol (bytes 57 65 62 53 6F 63 6B 65 74 2D 50 72 6F 74 6F 63 6F 6C; optional, if present, will be the fifth name-value pair) The value gives the name of a subprotocol that the client is intending to select.
 boolean isSecure()
           
 void setLocation(String location)
           
 void setOrigin(String origin)
           
 void setPort(String port)
           
 void setResourcePath(String resourcePath)
           
 void setSecure(boolean secure)
           
 void setServerHostName(String serverHostName)
           
 void setSubProtocol(String subProtocol)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandShake

public HandShake(boolean isSecure,
                 String path)

HandShake

public HandShake(boolean isSecure,
                 String origin,
                 String serverHostName,
                 String portNumber,
                 String resourcePath)
Method Detail

getLocation

public String getLocation()

setLocation

public void setLocation(String location)

getOrigin

public String getOrigin()
Origin (bytes 4F 72 69 67 69 6E; always the fourth name-value pair)

The value gives the scheme, hostname, and port (if it's not the default port for the given scheme) of the page that asked the client to open the Web Socket. It would be interesting if the server's operator had deals with operators of other sites, since the server could then decide how to respond (or indeed, _whether_ to respond) based on which site was requesting a connection. The value must be interpreted as UTF-8.


setOrigin

public void setOrigin(String origin)

getPort

public String getPort()

setPort

public void setPort(String port)

setResourcePath

public void setResourcePath(String resourcePath)

getResourcePath

public String getResourcePath()

isSecure

public boolean isSecure()

setSecure

public void setSecure(boolean secure)

getServerHostName

public String getServerHostName()

setServerHostName

public void setServerHostName(String serverHostName)

getSubProtocol

public String getSubProtocol()
WebSocket-Protocol (bytes 57 65 62 53 6F 63 6B 65 74 2D 50 72 6F 74 6F 63 6F 6C; optional, if present, will be the fifth name-value pair) The value gives the name of a subprotocol that the client is intending to select. It would be interesting if the server supports multiple protocols or subProtocol versions. The value must be interpreted as UTF-8.


setSubProtocol

public void setSubProtocol(String subProtocol)


Copyright © 2011 Oracle Corpration. All Rights Reserved.