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 java.lang.String |
BROWSER_COOKIE_DOMAIN_OPTION |
static java.lang.String |
BROWSER_COOKIE_HTTP_ONLY_OPTION |
static java.lang.String |
BROWSER_COOKIE_NAME_OPTION |
static java.lang.String |
BROWSER_COOKIE_PATH_OPTION |
static java.lang.String |
BROWSER_COOKIE_SECURE_OPTION |
static java.lang.String |
HTTP2_MAX_SESSIONS_PER_BROWSER_OPTION |
static java.lang.String |
JSON_DEBUG_OPTION |
static java.lang.String |
MAX_SESSIONS_PER_BROWSER_OPTION |
static java.lang.String |
MESSAGE_PARAM |
static java.lang.String |
MULTI_SESSION_INTERVAL_OPTION |
static java.lang.String |
PREFIX |
static java.lang.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,
java.lang.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 java.lang.String |
findBrowserId(javax.servlet.http.HttpServletRequest request) |
protected java.util.Collection<ServerSessionImpl> |
findCurrentSessions(javax.servlet.http.HttpServletRequest request) |
protected ServerSessionImpl |
findSession(java.util.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) |
protected javax.servlet.AsyncContext |
getAsyncContext(javax.servlet.http.HttpServletRequest request) |
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,
java.lang.String json,
java.lang.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 |
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,
boolean canSuspend) |
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 java.lang.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,
java.util.List<ServerMessage> messages,
ServerMessage.Mutable[] replies) |
allowMessageDeliveryDuringHandshake, destroy, dump, dump, getAdvice, getBayeux, getInterval, getMaxInterval, getMaxLazyTimeout, getMaxMessageSize, getTimeout, isAllowMessageDeliveryDuringHandshake, isHandshakeReconnect, isMetaConnectDeliveryOnly, parseMessages, parseMessages, processReply, scheduleExpiration, setAllowMessageDeliveryDuringHandshake, setHandshakeReconnect, setInterval, setMaxInterval, setMaxLazyTimeout, setMaxMessageSize, setMetaConnectDeliveryOnly, setTimeout, toJSONBytes, toStringgetName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefixclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getOption, getOptionNames, getOptionPrefixpublic static final java.lang.String PREFIX
public static final java.lang.String JSON_DEBUG_OPTION
public static final java.lang.String MESSAGE_PARAM
public static final java.lang.String BROWSER_COOKIE_NAME_OPTION
public static final java.lang.String BROWSER_COOKIE_DOMAIN_OPTION
public static final java.lang.String BROWSER_COOKIE_PATH_OPTION
public static final java.lang.String BROWSER_COOKIE_SECURE_OPTION
public static final java.lang.String BROWSER_COOKIE_HTTP_ONLY_OPTION
public static final java.lang.String MAX_SESSIONS_PER_BROWSER_OPTION
public static final java.lang.String HTTP2_MAX_SESSIONS_PER_BROWSER_OPTION
public static final java.lang.String MULTI_SESSION_INTERVAL_OPTION
public static final java.lang.String TRUST_CLIENT_SESSION
protected final org.slf4j.Logger _logger
protected AbstractHttpTransport(BayeuxServerImpl bayeux, java.lang.String name)
public void init()
AbstractServerTransportinit in class AbstractServerTransportprotected long getMultiSessionInterval()
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 java.io.IOException,
javax.servlet.ServletException
java.io.IOExceptionjavax.servlet.ServletExceptionprotected 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,
java.util.List<ServerMessage> messages,
ServerMessage.Mutable[] replies)
protected void processMessages(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ServerMessage.Mutable[] messages)
throws java.io.IOException
java.io.IOExceptionprotected ServerSessionImpl findSession(java.util.Collection<ServerSessionImpl> sessions, ServerMessage.Mutable message)
protected java.util.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, boolean canSuspend)
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 java.lang.String findBrowserId(javax.servlet.http.HttpServletRequest request)
protected java.lang.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,
java.lang.String json,
java.lang.Throwable exception)
throws java.io.IOException
java.io.IOExceptionprotected javax.servlet.AsyncContext getAsyncContext(javax.servlet.http.HttpServletRequest request)
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 AbstractServerTransportCopyright © 2008–2019 The CometD Project. All rights reserved.