org.apache.tomcat.bayeux.request
Class MetaHandshakeRequest
java.lang.Object
org.apache.tomcat.bayeux.RequestBase
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 |
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 |
responseTemplate
protected static java.util.HashMap<java.lang.String,java.lang.Object> responseTemplate
MetaHandshakeRequest
public MetaHandshakeRequest(TomcatBayeux tomcatBayeux,
org.jboss.servlet.http.HttpEvent event,
JSONObject jsReq)
throws JSONException
- Throws:
JSONException
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-2008 Apache Software Foundation. All Rights Reserved.