public abstract class HttpOperations<INBOUND extends NettyInbound,OUTBOUND extends NettyOutbound> extends ChannelOperations<INBOUND,OUTBOUND> implements HttpInfos
ChannelOperations with state management for status and headers
(first HTTP response packet).| Modifier and Type | Class and Description |
|---|---|
protected static class |
HttpOperations.PostHeadersNettyOutbound |
ChannelOperations.OnSetupDisposable.Composite, Disposable.Swap| Modifier | Constructor and Description |
|---|---|
protected |
HttpOperations(Connection connection,
ConnectionObserver listener,
HttpMessageLogFactory httpMessageLogFactory) |
protected |
HttpOperations(HttpOperations<INBOUND,OUTBOUND> replaced) |
| Modifier and Type | Method and Description |
|---|---|
HttpOperations<INBOUND,OUTBOUND> |
addHandler(String name,
ChannelHandler handler) |
protected abstract void |
afterMarkSentHeaders() |
protected String |
asDebugLogMessage(Object o) |
protected abstract void |
beforeMarkSentHeaders() |
protected boolean |
hasSentBody()
Has Body been sent.
|
boolean |
hasSentHeaders()
Has headers been sent.
|
protected HttpMessageLogFactory |
httpMessageLogFactory() |
protected String |
initShortId() |
protected abstract boolean |
isContentAlwaysEmpty() |
boolean |
isWebsocket()
Returns true if websocket connection (upgraded).
|
protected boolean |
markSentBody()
Mark the body sent.
|
protected boolean |
markSentHeaderAndBody(Object... objectsToRelease)
Mark the headers and body sent.
|
protected boolean |
markSentHeaders(Object... objectsToRelease)
Mark the headers sent.
|
protected abstract HttpMessage |
newFullBodyMessage(ByteBuf body) |
protected abstract void |
onHeadersSent() |
protected abstract HttpMessage |
outboundHttpMessage()
Outbound Netty HttpMessage.
|
protected HttpMessage |
prepareHttpMessage(ByteBuf buffer) |
String |
requestId()
Return a unique id for the request.
|
static String |
resolvePath(String uri)
Returns the decoded path portion from the provided
uri. |
NettyOutbound |
send(Publisher<? extends ByteBuf> source) |
NettyOutbound |
sendFile(Path file,
long position,
long count) |
NettyOutbound |
sendObject(Object message) |
Mono<Void> |
then() |
String |
toString() |
addMetricsHandler, addReactiveBridge, afterInboundComplete, alloc, as, asLongText, asShortText, channel, connection, currentContext, discard, discardWhenNoReceiver, dispose, disposeSubscriber, formatName, get, inbound, isDisposed, isInboundCancelled, isInboundComplete, isInboundDisposed, isPersistent, isSubscriptionDisposed, listener, onComplete, onDispose, onDispose, onError, onInboundCancel, onInboundClose, onInboundComplete, onInboundError, onInboundNext, onNext, onOutboundComplete, onOutboundError, onSubscribe, onTerminate, onUnprocessedOutboundError, onWritabilityChanged, outbound, receive, receiveObject, send, sendObject, sendUsing, terminate, withConnection, wrapInboundErrorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcookies, fullPath, isKeepAlive, method, path, uri, versionneverComplete, sendByteArray, sendFile, sendFileChunked, sendGroups, sendObject, sendString, sendString, subscribe, then, thenaddHandler, addHandlerFirst, addHandlerFirst, addHandlerLast, addHandlerLast, bind, from, markPersistent, onReadIdle, onWriteIdle, rebind, removeHandler, replaceHandleraddress, disposeNow, disposeNowprotected HttpOperations(HttpOperations<INBOUND,OUTBOUND> replaced)
protected HttpOperations(Connection connection, ConnectionObserver listener, HttpMessageLogFactory httpMessageLogFactory)
public final boolean hasSentHeaders()
public boolean isWebsocket()
HttpInfosisWebsocket in interface HttpInfospublic String requestId()
HttpInfosFormat of the id:
<CONNECTION_ID>-<REQUEST_NUMBER>
Example:
<CONNECTION_ID>: 329c6ffd
<REQUEST_NUMBER>: 5
Result: 329c6ffd-5
public NettyOutbound send(Publisher<? extends ByteBuf> source)
send in interface NettyOutboundpublic NettyOutbound sendObject(Object message)
sendObject in interface NettyOutboundsendObject in class ChannelOperations<INBOUND extends NettyInbound,OUTBOUND extends NettyOutbound>public Mono<Void> then()
then in interface NettyOutboundprotected String asDebugLogMessage(Object o)
asDebugLogMessage in class ChannelOperations<INBOUND extends NettyInbound,OUTBOUND extends NettyOutbound>protected HttpMessageLogFactory httpMessageLogFactory()
protected abstract void beforeMarkSentHeaders()
protected abstract void afterMarkSentHeaders()
protected abstract boolean isContentAlwaysEmpty()
protected abstract void onHeadersSent()
protected abstract HttpMessage newFullBodyMessage(ByteBuf body)
public final NettyOutbound sendFile(Path file, long position, long count)
sendFile in interface NettyOutboundpublic String toString()
toString in class ChannelOperations<INBOUND extends NettyInbound,OUTBOUND extends NettyOutbound>public HttpOperations<INBOUND,OUTBOUND> addHandler(String name, ChannelHandler handler)
addHandler in interface Connectionprotected final boolean markSentHeaders(Object... objectsToRelease)
protected final boolean markSentBody()
protected final boolean hasSentBody()
protected final boolean markSentHeaderAndBody(Object... objectsToRelease)
protected final String initShortId()
initShortId in class ChannelOperations<INBOUND extends NettyInbound,OUTBOUND extends NettyOutbound>public static String resolvePath(String uri)
uri.uri - an HTTP URL that may contain a path with query/fragmenturiprotected abstract HttpMessage outboundHttpMessage()
protected HttpMessage prepareHttpMessage(ByteBuf buffer)