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 class |
AbstractHttpTransport.Context |
static interface |
AbstractHttpTransport.HttpScheduler
A
Scheduler for HTTP-based transports. |
protected class |
AbstractHttpTransport.LongPollScheduler |
AbstractServerTransport.Scheduler| Modifier and Type | Field and Description |
|---|---|
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_SAME_SITE_OPTION |
static String |
BROWSER_COOKIE_SECURE_OPTION |
static String |
DUPLICATE_META_CONNECT_HTTP_RESPONSE_CODE_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_OPTION |
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 void |
decBrowserId(ServerSessionImpl session,
boolean http2) |
protected String |
findBrowserId(AbstractHttpTransport.Context context) |
protected Collection<ServerSessionImpl> |
findCurrentSessions(javax.servlet.http.HttpServletRequest request) |
protected ServerSessionImpl |
findSession(Collection<ServerSessionImpl> sessions,
ServerMessage.Mutable message) |
protected void |
flush(AbstractHttpTransport.Context context,
org.cometd.bayeux.Promise<Void> promise) |
protected javax.servlet.AsyncContext |
getAsyncContext(javax.servlet.http.HttpServletRequest request) |
protected int |
getDuplicateMetaConnectHttpResponseCode() |
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 failure) |
protected void |
handleMessage(AbstractHttpTransport.Context context,
ServerMessage.Mutable message,
org.cometd.bayeux.Promise<ServerMessage.Mutable> promise) |
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 |
processMessages(AbstractHttpTransport.Context context,
List<ServerMessage.Mutable> messages,
org.cometd.bayeux.Promise<Void> promise) |
protected void |
resume(AbstractHttpTransport.Context context,
ServerMessage.Mutable message,
org.cometd.bayeux.Promise<Void> promise) |
protected void |
sendError(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
int code,
Throwable failure) |
protected String |
setBrowserId(AbstractHttpTransport.Context context) |
protected abstract AbstractHttpTransport.HttpScheduler |
suspend(AbstractHttpTransport.Context context,
org.cometd.bayeux.Promise<Void> promise,
ServerMessage.Mutable message,
long timeout) |
protected void |
sweep()
Sweeps the transport for old Browser IDs
|
protected byte[] |
toJSONBytes(ServerMessage msg) |
protected abstract void |
write(AbstractHttpTransport.Context context,
List<ServerMessage> messages,
org.cometd.bayeux.Promise<Void> promise) |
allowMessageDeliveryDuringHandshake, destroy, dump, getBayeux, getInterval, getJSONContextServer, getMaxInterval, getMaxLazyTimeout, getMaxMessageSize, getTimeout, isAllowMessageDeliveryDuringHandshake, isHandshakeReconnect, isMetaConnectDeliveryOnly, newMetaConnectCycle, parseMessages, parseMessages, processReply, scheduleExpiration, setAllowMessageDeliveryDuringHandshake, setHandshakeReconnect, setInterval, setMaxInterval, setMaxLazyTimeout, setMaxMessageSize, setMetaConnectDeliveryOnly, setTimeout, toJSON, toStringgetName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefixclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic 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 BROWSER_COOKIE_SAME_SITE_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 TRUST_CLIENT_SESSION_OPTION
public static final String DUPLICATE_META_CONNECT_HTTP_RESPONSE_CODE_OPTION
protected AbstractHttpTransport(BayeuxServerImpl bayeux, String name)
public void init()
AbstractServerTransportinit in class AbstractServerTransportprotected long getMultiSessionInterval()
protected int getDuplicateMetaConnectHttpResponseCode()
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
IOExceptionjavax.servlet.ServletExceptionprotected abstract AbstractHttpTransport.HttpScheduler suspend(AbstractHttpTransport.Context context, org.cometd.bayeux.Promise<Void> promise, ServerMessage.Mutable message, long timeout)
protected abstract void write(AbstractHttpTransport.Context context, List<ServerMessage> messages, org.cometd.bayeux.Promise<Void> promise)
protected void processMessages(AbstractHttpTransport.Context context, List<ServerMessage.Mutable> messages, org.cometd.bayeux.Promise<Void> promise)
protected ServerSessionImpl findSession(Collection<ServerSessionImpl> sessions, ServerMessage.Mutable message)
protected Collection<ServerSessionImpl> findCurrentSessions(javax.servlet.http.HttpServletRequest request)
protected boolean isHTTP2(javax.servlet.http.HttpServletRequest request)
protected void flush(AbstractHttpTransport.Context context, org.cometd.bayeux.Promise<Void> promise)
protected void resume(AbstractHttpTransport.Context context, ServerMessage.Mutable message, org.cometd.bayeux.Promise<Void> promise)
protected void sendError(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
int code,
Throwable failure)
protected String findBrowserId(AbstractHttpTransport.Context context)
protected String setBrowserId(AbstractHttpTransport.Context context)
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 failure)
throws IOException
IOExceptionprotected void handleMessage(AbstractHttpTransport.Context context, ServerMessage.Mutable message, org.cometd.bayeux.Promise<ServerMessage.Mutable> promise)
protected javax.servlet.AsyncContext getAsyncContext(javax.servlet.http.HttpServletRequest request)
protected void sweep()
sweep in class AbstractServerTransportprotected byte[] toJSONBytes(ServerMessage msg)
Copyright © 2008–2022 The CometD Project. All rights reserved.