org.apache.tomcat.bayeux.request
Class PublishRequest

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

public class PublishRequest
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
PublishRequest(TomcatBayeux tb, org.jboss.servlet.http.HttpEvent event, JSONObject jsReq)
           
 
Method Summary
 int process(int prevops)
          Send the event message to all registered subscribers.
 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

PublishRequest

public PublishRequest(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 5.1.1 of the Bayuex spec a connect request must contain: 1) The channel identifier of the channel for publication. 2) The data to send.

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
Send the event message to all registered subscribers.

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.