org.apache.tomcat.bayeux
Class RequestBase
java.lang.Object
org.apache.tomcat.bayeux.RequestBase
- All Implemented Interfaces:
- BayeuxRequest
- Direct Known Subclasses:
- MetaConnectRequest, MetaDisconnectRequest, MetaHandshakeRequest, MetaSubscribeRequest, MetaUnsubscribeRequest, PublishRequest
public abstract class RequestBase
- extends java.lang.Object
- implements BayeuxRequest
Common functionality and member variables for all Bayeux requests.
- Version:
- 0.9
- Author:
- Guy A. Molinari, Filip Hanik
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
timestampFmt
protected static final java.text.SimpleDateFormat timestampFmt
tomcatBayeux
protected TomcatBayeux tomcatBayeux
channel
protected java.lang.String channel
id
protected java.lang.String id
clientId
protected java.lang.String clientId
version
protected java.lang.String version
suppConnTypes
protected java.lang.String[] suppConnTypes
suppConnTypesFlag
protected int suppConnTypesFlag
desiredConnTypeFlag
protected int desiredConnTypeFlag
minVersion
protected java.lang.String minVersion
subscription
protected java.lang.String subscription
data
protected java.lang.String data
conType
protected java.lang.String conType
ext
protected java.util.LinkedHashMap<java.lang.String,java.lang.Object> ext
event
protected org.jboss.servlet.http.HttpEvent event
response
protected java.util.HashMap<java.lang.String,java.lang.Object> response
reconnectInterval
protected int reconnectInterval
RequestBase
protected RequestBase(TomcatBayeux tb,
org.jboss.servlet.http.HttpEvent event,
JSONObject jsReq)
throws JSONException
- Throws:
JSONException
validate
public HttpError validate()
- Description copied from interface:
BayeuxRequest
- Validates a specific request.
This method must be called prior to process()
as a request can do pre processing in the validate method.
Should the validation fail, an error object is returned
containing an error message, and potentially a stack trace
if an exception was generated
- Specified by:
validate
in interface BayeuxRequest
- Returns:
- HttpError - null if no error was detected, an HttpError object containing information about the error.
getTomcatBayeux
public TomcatBayeux getTomcatBayeux()
getChannel
public java.lang.String getChannel()
getId
public java.lang.String getId()
getClientId
public java.lang.String getClientId()
getExt
public java.util.LinkedHashMap getExt()
getEvent
public org.jboss.servlet.http.HttpEvent getEvent()
deliver
protected static void deliver(org.jboss.servlet.http.HttpEvent event,
ClientImpl to)
throws java.io.IOException,
javax.servlet.ServletException,
BayeuxException
- Throws:
java.io.IOException
javax.servlet.ServletException
BayeuxException
getJSONArray
protected static JSONArray getJSONArray(org.jboss.servlet.http.HttpEvent event,
boolean nullok)
getJSONArray
protected JSONArray getJSONArray()
addToDeliveryQueue
protected void addToDeliveryQueue(ClientImpl to,
JSONObject msg)
throws java.io.IOException,
javax.servlet.ServletException,
BayeuxException
- Throws:
java.io.IOException
javax.servlet.ServletException
BayeuxException
flushMessages
protected void flushMessages(ClientImpl client)
throws BayeuxException
- Throws:
BayeuxException
process
public int process(int prevops)
throws BayeuxException
- Description copied from interface:
BayeuxRequest
- processes a remote client Bayeux message
- Specified by:
process
in interface BayeuxRequest
- 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.
getReconnectInterval
public int getReconnectInterval()
getTimeStamp
public java.lang.String getTimeStamp()
Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.