public abstract class AbstractHttpTransport extends AbstractServerTransport
HTTP ServerTransport base class, used by ServerTransports that use HTTP as transport or to initiate a transport connection.
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractHttpTransport.HttpScheduler |
protected class |
AbstractHttpTransport.LongPollScheduler |
AbstractServerTransport.Scheduler
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
_logger |
static String |
AUTOBATCH_OPTION |
static String |
BROWSER_COOKIE_DOMAIN_OPTION |
static String |
BROWSER_COOKIE_HTTP_ONLY_OPTION |
static String |
BROWSER_COOKIE_NAME_OPTION |
static String |
BROWSER_COOKIE_PATH_OPTION |
static String |
BROWSER_COOKIE_SECURE_OPTION |
static String |
HTTP2_MAX_SESSIONS_PER_BROWSER_OPTION |
static String |
JSON_DEBUG_OPTION |
static String |
MAX_SESSIONS_PER_BROWSER_OPTION |
static String |
MESSAGE_PARAM |
static String |
MULTI_SESSION_INTERVAL_OPTION |
static String |
PREFIX |
static String |
TRUST_CLIENT_SESSION |
ALLOW_MESSAGE_DELIVERY_DURING_HANDSHAKE, HANDSHAKE_RECONNECT_OPTION, INTERVAL_OPTION, JSON_CONTEXT_OPTION, MAX_INTERVAL_OPTION, MAX_LAZY_TIMEOUT_OPTION, MAX_MESSAGE_SIZE_OPTION, MAX_PROCESSING_OPTION, MAX_QUEUE_OPTION, META_CONNECT_DELIVERY_OPTION, TIMEOUT_OPTION
Modifier | Constructor and Description |
---|---|
protected |
AbstractHttpTransport(BayeuxServerImpl bayeux,
String name) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
accept(javax.servlet.http.HttpServletRequest request) |
protected ServerMessage.Mutable |
bayeuxServerHandle(ServerSessionImpl session,
ServerMessage.Mutable message) |
protected void |
decBrowserId(ServerSessionImpl session,
boolean http2) |
protected void |
error(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.AsyncContext asyncContext,
int responseCode) |
protected String |
findBrowserId(javax.servlet.http.HttpServletRequest request) |
protected Collection<ServerSessionImpl> |
findCurrentSessions(javax.servlet.http.HttpServletRequest request) |
protected ServerSessionImpl |
findSession(Collection<ServerSessionImpl> sessions,
ServerMessage.Mutable message) |
protected void |
flush(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ServerSessionImpl session,
boolean sendQueue,
boolean scheduleExpiration,
ServerMessage.Mutable... replies) |
BayeuxContext |
getContext() |
javax.servlet.http.HttpServletRequest |
getCurrentRequest() |
protected long |
getMultiSessionInterval() |
abstract void |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
handleJSONParseException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String json,
Throwable exception) |
protected boolean |
incBrowserId(ServerSessionImpl session,
boolean http2)
Increments the count of sessions for the given browser identifier.
|
void |
init()
Initializes the transport, resolving default and direct options.
|
protected boolean |
isAutoBatch() |
protected boolean |
isHTTP2(javax.servlet.http.HttpServletRequest request) |
protected void |
metaConnectResumed(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.AsyncContext asyncContext,
ServerSession session) |
protected void |
metaConnectSuspended(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.AsyncContext asyncContext,
ServerSession session) |
protected void |
processMessages(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ServerMessage.Mutable[] messages) |
protected ServerMessage.Mutable |
processMetaConnect(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ServerSessionImpl session,
ServerMessage.Mutable message) |
protected ServerMessage.Mutable |
processMetaHandshake(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ServerSessionImpl session,
ServerMessage.Mutable message) |
protected void |
resume(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.AsyncContext asyncContext,
ServerSessionImpl session,
ServerMessage.Mutable reply) |
protected String |
setBrowserId(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setCurrentRequest(javax.servlet.http.HttpServletRequest request) |
protected abstract AbstractHttpTransport.HttpScheduler |
suspend(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ServerSessionImpl session,
ServerMessage.Mutable reply,
long timeout) |
protected void |
sweep()
Sweeps the transport for old Browser IDs
|
protected abstract void |
write(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ServerSessionImpl session,
boolean scheduleExpiration,
List<ServerMessage> messages,
ServerMessage.Mutable[] replies) |
allowMessageDeliveryDuringHandshake, destroy, dump, dump, getAdvice, getBayeux, getInterval, getMaxInterval, getMaxLazyTimeout, getMaxMessageSize, getTimeout, isAllowMessageDeliveryDuringHandshake, isHandshakeReconnect, isMetaConnectDeliveryOnly, parseMessages, parseMessages, processReply, setAllowMessageDeliveryDuringHandshake, setHandshakeReconnect, setInterval, setMaxInterval, setMaxLazyTimeout, setMaxMessageSize, setMetaConnectDeliveryOnly, setTimeout, toJSONBytes, toString
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, getOption, getOptionNames, getOptionPrefix
public static final String PREFIX
public static final String JSON_DEBUG_OPTION
public static final String MESSAGE_PARAM
public static final String BROWSER_COOKIE_NAME_OPTION
public static final String BROWSER_COOKIE_DOMAIN_OPTION
public static final String BROWSER_COOKIE_PATH_OPTION
public static final String BROWSER_COOKIE_SECURE_OPTION
public static final String BROWSER_COOKIE_HTTP_ONLY_OPTION
public static final String MAX_SESSIONS_PER_BROWSER_OPTION
public static final String HTTP2_MAX_SESSIONS_PER_BROWSER_OPTION
public static final String MULTI_SESSION_INTERVAL_OPTION
public static final String AUTOBATCH_OPTION
public static final String TRUST_CLIENT_SESSION
protected final org.slf4j.Logger _logger
protected AbstractHttpTransport(BayeuxServerImpl bayeux, String name)
public void init()
AbstractServerTransport
init
in class AbstractServerTransport
protected long getMultiSessionInterval()
protected boolean isAutoBatch()
public void setCurrentRequest(javax.servlet.http.HttpServletRequest request)
public javax.servlet.http.HttpServletRequest getCurrentRequest()
public abstract boolean accept(javax.servlet.http.HttpServletRequest request)
public abstract void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
protected abstract AbstractHttpTransport.HttpScheduler suspend(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, ServerMessage.Mutable reply, long timeout)
protected abstract void write(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, boolean scheduleExpiration, List<ServerMessage> messages, ServerMessage.Mutable[] replies)
protected void processMessages(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerMessage.Mutable[] messages) throws IOException
IOException
protected ServerSessionImpl findSession(Collection<ServerSessionImpl> sessions, ServerMessage.Mutable message)
protected Collection<ServerSessionImpl> findCurrentSessions(javax.servlet.http.HttpServletRequest request)
protected ServerMessage.Mutable processMetaHandshake(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, ServerMessage.Mutable message)
protected ServerMessage.Mutable processMetaConnect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, ServerMessage.Mutable message)
protected boolean isHTTP2(javax.servlet.http.HttpServletRequest request)
protected void flush(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, boolean sendQueue, boolean scheduleExpiration, ServerMessage.Mutable... replies)
protected void resume(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.AsyncContext asyncContext, ServerSessionImpl session, ServerMessage.Mutable reply)
public BayeuxContext getContext()
protected String findBrowserId(javax.servlet.http.HttpServletRequest request)
protected String setBrowserId(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected boolean incBrowserId(ServerSessionImpl session, boolean http2)
session
- the session that increments the counthttp2
- whether the HTTP protocol is HTTP/2decBrowserId(ServerSessionImpl, boolean)
protected void decBrowserId(ServerSessionImpl session, boolean http2)
protected void handleJSONParseException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String json, Throwable exception) throws IOException
IOException
protected void error(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.AsyncContext asyncContext, int responseCode)
protected ServerMessage.Mutable bayeuxServerHandle(ServerSessionImpl session, ServerMessage.Mutable message)
protected void metaConnectSuspended(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.AsyncContext asyncContext, ServerSession session)
protected void metaConnectResumed(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.AsyncContext asyncContext, ServerSession session)
protected void sweep()
sweep
in class AbstractServerTransport
Copyright © 2008–2017 The CometD Project. All rights reserved.