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,
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,
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,
Promise<Void> promise) |
protected void |
resume(AbstractHttpTransport.Context context,
ServerMessage.Mutable message,
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,
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,
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, 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 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()
AbstractServerTransport
init
in class AbstractServerTransport
protected 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
IOException
javax.servlet.ServletException
protected abstract AbstractHttpTransport.HttpScheduler suspend(AbstractHttpTransport.Context context, Promise<Void> promise, ServerMessage.Mutable message, long timeout)
protected abstract void write(AbstractHttpTransport.Context context, List<ServerMessage> messages, Promise<Void> promise)
protected void processMessages(AbstractHttpTransport.Context context, List<ServerMessage.Mutable> messages, 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, Promise<Void> promise)
protected void resume(AbstractHttpTransport.Context context, ServerMessage.Mutable message, 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
IOException
protected void handleMessage(AbstractHttpTransport.Context context, ServerMessage.Mutable message, Promise<ServerMessage.Mutable> promise)
protected javax.servlet.AsyncContext getAsyncContext(javax.servlet.http.HttpServletRequest request)
protected void sweep()
sweep
in class AbstractServerTransport
protected byte[] toJSONBytes(ServerMessage msg)
Copyright © 2008–2024 The CometD Project. All rights reserved.