Package org.cometd.server.transport
Class AbstractStreamHttpTransport
java.lang.Object
org.cometd.common.AbstractTransport
org.cometd.server.AbstractServerTransport
org.cometd.server.transport.AbstractHttpTransport
org.cometd.server.transport.AbstractStreamHttpTransport
- All Implemented Interfaces:
ServerTransport
,Transport
,org.eclipse.jetty.util.component.Dumpable
- Direct Known Subclasses:
JSONPTransport
,JSONTransport
public abstract class AbstractStreamHttpTransport extends AbstractHttpTransport
The base class for HTTP transports that use blocking stream I/O.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractStreamHttpTransport.DispatchingLongPollScheduler
Nested classes/interfaces inherited from class org.cometd.server.transport.AbstractHttpTransport
AbstractHttpTransport.HttpScheduler, AbstractHttpTransport.LongPollScheduler
Nested classes/interfaces inherited from class org.cometd.server.AbstractServerTransport
AbstractServerTransport.Scheduler
-
Field Summary
Fields inherited from class org.cometd.server.transport.AbstractHttpTransport
_logger, BROWSER_COOKIE_DOMAIN_OPTION, BROWSER_COOKIE_HTTP_ONLY_OPTION, BROWSER_COOKIE_NAME_OPTION, BROWSER_COOKIE_PATH_OPTION, BROWSER_COOKIE_SAME_SITE_OPTION, BROWSER_COOKIE_SECURE_OPTION, DUPLICATE_META_CONNECT_HTTP_RESPONSE_CODE_OPTION, HTTP2_MAX_SESSIONS_PER_BROWSER_OPTION, JSON_DEBUG_OPTION, MAX_SESSIONS_PER_BROWSER_OPTION, MESSAGE_PARAM, MULTI_SESSION_INTERVAL_OPTION, PREFIX, TRUST_CLIENT_SESSION, TRUST_CLIENT_SESSION_OPTION
Fields inherited from class org.cometd.server.AbstractServerTransport
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
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractStreamHttpTransport(BayeuxServerImpl bayeux, String name)
-
Method Summary
Modifier and Type Method Description protected abstract javax.servlet.ServletOutputStream
beginWrite(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected abstract void
endWrite(javax.servlet.http.HttpServletResponse response, javax.servlet.ServletOutputStream output)
void
handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected AbstractHttpTransport.HttpScheduler
newHttpScheduler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.AsyncContext asyncContext, ServerSessionImpl session, ServerMessage.Mutable reply, long timeout)
protected ServerMessage.Mutable[]
parseMessages(String[] requestParameters)
protected abstract ServerMessage.Mutable[]
parseMessages(javax.servlet.http.HttpServletRequest request)
protected void
process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected AbstractHttpTransport.HttpScheduler
suspend(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, ServerMessage.Mutable reply, long timeout)
protected void
write(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, boolean scheduleExpiration, List<ServerMessage> messages, ServerMessage.Mutable[] replies)
protected void
writeComplete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, List<ServerMessage> messages, ServerMessage.Mutable[] replies)
protected void
writeMessage(javax.servlet.http.HttpServletResponse response, javax.servlet.ServletOutputStream output, ServerSessionImpl session, ServerMessage message)
Methods inherited from class org.cometd.server.transport.AbstractHttpTransport
accept, bayeuxServerHandle, decBrowserId, error, findBrowserId, findCurrentSessions, findSession, flush, getAsyncContext, getContext, getCurrentRequest, getMultiSessionInterval, handleJSONParseException, incBrowserId, init, isHTTP2, metaConnectResumed, metaConnectSuspended, processMessages, processMetaConnect, processMetaHandshake, resume, setBrowserId, setCurrentRequest, sweep
Methods inherited from class org.cometd.server.AbstractServerTransport
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, toString
Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cometd.bayeux.Transport
getName, getOption, getOptionNames, getOptionPrefix
-
Constructor Details
-
Method Details
-
handle
public void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException- Specified by:
handle
in classAbstractHttpTransport
- Throws:
IOException
javax.servlet.ServletException
-
process
protected void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException- Throws:
IOException
javax.servlet.ServletException
-
suspend
protected AbstractHttpTransport.HttpScheduler suspend(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, ServerMessage.Mutable reply, long timeout)- Specified by:
suspend
in classAbstractHttpTransport
-
newHttpScheduler
protected AbstractHttpTransport.HttpScheduler newHttpScheduler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.AsyncContext asyncContext, ServerSessionImpl session, ServerMessage.Mutable reply, long timeout) -
parseMessages
protected abstract ServerMessage.Mutable[] parseMessages(javax.servlet.http.HttpServletRequest request) throws IOException, ParseException- Throws:
IOException
ParseException
-
parseMessages
protected ServerMessage.Mutable[] parseMessages(String[] requestParameters) throws IOException, ParseException- Throws:
IOException
ParseException
-
write
protected void write(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, boolean scheduleExpiration, List<ServerMessage> messages, ServerMessage.Mutable[] replies)- Specified by:
write
in classAbstractHttpTransport
-
writeMessage
protected void writeMessage(javax.servlet.http.HttpServletResponse response, javax.servlet.ServletOutputStream output, ServerSessionImpl session, ServerMessage message) throws IOException- Throws:
IOException
-
beginWrite
protected abstract javax.servlet.ServletOutputStream beginWrite(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException- Throws:
IOException
-
endWrite
protected abstract void endWrite(javax.servlet.http.HttpServletResponse response, javax.servlet.ServletOutputStream output) throws IOException- Throws:
IOException
-
writeComplete
protected void writeComplete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServerSessionImpl session, List<ServerMessage> messages, ServerMessage.Mutable[] replies)
-