org.apache.tomcat.bayeux.request
Class MetaHandshakeRequest

java.lang.Object
  extended by org.apache.tomcat.bayeux.RequestBase
      extended by org.apache.tomcat.bayeux.request.MetaHandshakeRequest
All Implemented Interfaces:
BayeuxRequest

public class MetaHandshakeRequest
extends RequestBase
implements BayeuxRequest

Handshake request Bayeux message.

Version:
1.0
Author:
Guy A. Molinari, Filip Hanik

Field Summary
protected static java.util.HashMap<java.lang.String,java.lang.Object> responseTemplate
           
 
Fields inherited from class org.apache.tomcat.bayeux.RequestBase
channel, clientId, conType, data, desiredConnTypeFlag, event, ext, id, minVersion, reconnectInterval, response, subscription, suppConnTypes, suppConnTypesFlag, timestampFmt, tomcatBayeux, version
 
Fields inherited from interface org.apache.tomcat.bayeux.BayeuxRequest
CURRENT_REQ_ATTR, JSON_MSG_ARRAY, LAST_REQ_ATTR
 
Constructor Summary
MetaHandshakeRequest(TomcatBayeux tomcatBayeux, org.jboss.servlet.http.HttpEvent event, JSONObject jsReq)
           
 
Method Summary
 java.lang.String getMinimumVersion()
           
 java.lang.String getVersion()
           
 int process(int prevops)
          Generate and return a client identifier.
 HttpError validate()
          Check client request for validity.
 
Methods inherited from class org.apache.tomcat.bayeux.RequestBase
addToDeliveryQueue, deliver, flushMessages, getChannel, getClientId, getEvent, getExt, getId, getJSONArray, getJSONArray, getReconnectInterval, getTimeStamp, getTomcatBayeux
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

responseTemplate

protected static java.util.HashMap<java.lang.String,java.lang.Object> responseTemplate
Constructor Detail

MetaHandshakeRequest

public MetaHandshakeRequest(TomcatBayeux tomcatBayeux,
                            org.jboss.servlet.http.HttpEvent event,
                            JSONObject jsReq)
                     throws JSONException
Throws:
JSONException
Method Detail

getVersion

public java.lang.String getVersion()

getMinimumVersion

public java.lang.String getMinimumVersion()

validate

public HttpError validate()
Check client request for validity. Per section 4.1.1 of the Bayuex spec a handshake request must contain: 1) The "/meta/handshake" channel identifier. 2) The version of the protocol supported by the client 3) The client's supported connection types.

Specified by:
validate in interface BayeuxRequest
Overrides:
validate in class RequestBase
Returns:
HttpError This method returns null if no errors were found

process

public int process(int prevops)
            throws BayeuxException
Generate and return a client identifier. Return a list of supported connection types. Must be a subset of or identical to the list of types supported by the client. See section 4.1.2 of the Bayuex specification.

Specified by:
process in interface BayeuxRequest
Overrides:
process in class RequestBase
Parameters:
prevops - - the operation requested by the previous request, in case of chained requests.
Returns:
int - returns the interest operation for a CometEvent. Currently not used
Throws:
BayeuxException - - if an error was detected, and the appropriate error response couldn't be delivered to the client.


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.