org.apache.tomcat.bayeux.request
Class MetaConnectRequest

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

public class MetaConnectRequest
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
MetaConnectRequest(TomcatBayeux tb, org.jboss.servlet.http.HttpEvent event, JSONObject jsReq)
           
 
Method Summary
 int process(int prevops)
          Transition to connected state, flushing pending messages if available.
 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

MetaConnectRequest

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

validate

public HttpError validate()
Check client request for validity. Per section 4.2.1 of the Bayuex spec a connect request must contain: 1) The "/meta/connect" channel identifier. 2) The clientId returned by the server after handshake. 3) The desired connectionType (must be one of the server's supported types returned by handshake response.

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
Transition to connected state, flushing pending messages if available. If there are pending subscriptions and no messages to flush then the connection is held until there is a pending publish event to be delivered to this client (Section 4.2.2 of spec).

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.