Class HttpOperations<INBOUND extends NettyInbound,OUTBOUND extends NettyOutbound> 
- All Implemented Interfaces:
- Publisher<Void>,- Subscriber<Void>,- CoreSubscriber<Void>,- Disposable,- ChannelOperationsId,- Connection,- DisposableChannel,- HttpInfos,- NettyInbound,- NettyOutbound
ChannelOperations with state management for status and headers
 (first HTTP response packet).- Author:
- Stephane Maldini
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static final classNested classes/interfaces inherited from class reactor.netty.channel.ChannelOperationsChannelOperations.OnSetupNested classes/interfaces inherited from interface reactor.core.DisposableDisposable.Composite, Disposable.Swap
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedHttpOperations(Connection connection, ConnectionObserver listener, HttpOperations<INBOUND, OUTBOUND> replaced) protectedHttpOperations(Connection connection, ConnectionObserver listener, HttpMessageLogFactory httpMessageLogFactory) protectedHttpOperations(HttpOperations<INBOUND, OUTBOUND> replaced) 
- 
Method SummaryModifier and TypeMethodDescriptionaddHandler(String name, ChannelHandler handler) Add aChannelHandlerwithConnection.addHandlerFirst(io.netty.channel.ChannelHandler)if of type ofChannelOutboundHandlerotherwise withConnection.addHandlerLast(io.netty.channel.ChannelHandler).protected abstract voidprotected StringTransforms the object to a string for debug logs.protected abstract voidprotected final booleanHas Body been sent.final booleanHas headers been sent.protected HttpMessageLogFactoryprotected final Stringprotected abstract booleanbooleanReturns true if websocket connection (upgraded).protected final booleanMark the body sent.protected final booleanmarkSentHeaderAndBody(Object... objectsToRelease) Mark the headers and body sent.protected final booleanmarkSentHeaders(Object... objectsToRelease) Mark the headers sent.protected abstract HttpMessagenewFullBodyMessage(ByteBuf body) protected abstract voidprotected abstract HttpMessageOutbound Netty HttpMessage.protected HttpMessageprepareHttpMessage(ByteBuf buffer) Return a unique id for the request.static StringresolvePath(String uri) Returns the decoded path portion from the provideduri.Sends data to the peer, listens for any error on write and closes on terminal signal (complete|error).final NettyOutboundSends content from the givenPathusingFileChannel.transferTo(long, long, WritableByteChannel)support, if the system supports it, the path resolves to a local file systemFile, compression and SSL/TLS is not enabled, then transfer will use zero-byte copy to the peer., otherwise chunked read/write will be used.sendObject(Object message) Sends data to the peer, listens for any error on write and closes on terminal signal (complete|error).then()Obtains aMonoof pending outbound(s) write completion.toString()Methods inherited from class reactor.netty.channel.ChannelOperationsaddMetricsHandler, 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, wrapInboundErrorMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.netty.ConnectionaddHandler, addHandlerFirst, addHandlerFirst, addHandlerLast, addHandlerLast, bind, markPersistent, onReadIdle, onWriteIdle, rebind, removeHandler, replaceHandlerMethods inherited from interface reactor.netty.DisposableChanneladdress, disposeNow, disposeNowMethods inherited from interface reactor.netty.http.HttpInfoscookies, fullPath, isKeepAlive, method, path, uri, versionMethods inherited from interface reactor.netty.NettyOutboundneverComplete, sendByteArray, sendFile, sendFileChunked, sendGroups, sendObject, sendString, sendString, subscribe, then, then
- 
Constructor Details- 
HttpOperations
- 
HttpOperationsprotected HttpOperations(Connection connection, ConnectionObserver listener, HttpOperations<INBOUND, OUTBOUND> replaced) 
- 
HttpOperationsprotected HttpOperations(Connection connection, ConnectionObserver listener, HttpMessageLogFactory httpMessageLogFactory) 
 
- 
- 
Method Details- 
hasSentHeaderspublic final boolean hasSentHeaders()Has headers been sent.- Returns:
- true if headers have been sent
 
- 
isWebsocketpublic boolean isWebsocket()Description copied from interface:HttpInfosReturns true if websocket connection (upgraded).- Specified by:
- isWebsocketin interface- HttpInfos
- Returns:
- true if websocket connection
 
- 
requestIdDescription copied from interface:HttpInfosReturn a unique id for the request. The id is a combination of the id of the underlying connection and the serial number of the request received on that connection.Format of the id: <CONNECTION_ID>-<REQUEST_NUMBER>Example: <CONNECTION_ID>: 329c6ffd <REQUEST_NUMBER>: 5 Result: 329c6ffd-5
- 
sendDescription copied from interface:NettyOutboundSends data to the peer, listens for any error on write and closes on terminal signal (complete|error).A new NettyOutboundtype (or the same) for typed send sequences.Note: Nesting any send* method is not supported. - Specified by:
- sendin interface- NettyOutbound
- Parameters:
- source- the dataStream publishing OUT items to write on this channel
- Returns:
- A new NettyOutboundto append further send. It will emit a complete signal successful sequence write (e.g. after "flush") or any error during write.
 
- 
sendObjectDescription copied from interface:NettyOutboundSends data to the peer, listens for any error on write and closes on terminal signal (complete|error).Note: Nesting any send* method is not supported. - Specified by:
- sendObjectin interface- NettyOutbound
- Overrides:
- sendObjectin class- ChannelOperations<INBOUND extends NettyInbound,- OUTBOUND extends NettyOutbound> 
- Parameters:
- message- the object to publish
- Returns:
- A Monoto signal successful sequence write (e.g. after "flush") or any error during write
 
- 
thenDescription copied from interface:NettyOutboundObtains aMonoof pending outbound(s) write completion.- Specified by:
- thenin interface- NettyOutbound
- Returns:
- a Monoof pending outbound(s) write completion
 
- 
asDebugLogMessageDescription copied from class:ChannelOperationsTransforms the object to a string for debug logs.- Overrides:
- asDebugLogMessagein class- ChannelOperations<INBOUND extends NettyInbound,- OUTBOUND extends NettyOutbound> 
- Parameters:
- o- the object to be transformed
- Returns:
- the string to be logged
 
- 
httpMessageLogFactory
- 
beforeMarkSentHeadersprotected abstract void beforeMarkSentHeaders()
- 
afterMarkSentHeadersprotected abstract void afterMarkSentHeaders()
- 
isContentAlwaysEmptyprotected abstract boolean isContentAlwaysEmpty()
- 
onHeadersSentprotected abstract void onHeadersSent()
- 
newFullBodyMessage
- 
sendFileDescription copied from interface:NettyOutboundSends content from the givenPathusingFileChannel.transferTo(long, long, WritableByteChannel)support, if the system supports it, the path resolves to a local file systemFile, compression and SSL/TLS is not enabled, then transfer will use zero-byte copy to the peer., otherwise chunked read/write will be used.It will listens for any error on write and closes on terminal signal (complete|error). If more than one publisher is attached (multiple calls to send()) completion occurs after all publishers complete. Note: Nesting any send* method is not supported. - Specified by:
- sendFilein interface- NettyOutbound
- Parameters:
- file- the file Path
- position- where to start
- count- how much to transfer
- Returns:
- A Publisher to signal successful sequence write (e.g. after "flush") or any error during write
 
- 
toString- Overrides:
- toStringin class- ChannelOperations<INBOUND extends NettyInbound,- OUTBOUND extends NettyOutbound> 
 
- 
addHandlerDescription copied from interface:ConnectionAdd aChannelHandlerwithConnection.addHandlerFirst(io.netty.channel.ChannelHandler)if of type ofChannelOutboundHandlerotherwise withConnection.addHandlerLast(io.netty.channel.ChannelHandler). Implementation may add more auto handling in particular HTTP based context will prepend an HttpContent body extractor.[ [reactor codecs], [<- user FIRST HANDLERS added here, user LAST HANDLERS added here ->], [reactor handlers] ]If effectively added, the handler will be safely removed when the channel is made inactive (pool release). As the Connection object is available once the channel is in active state, events prior this state will not be available (i.e. channelRegistered,initChannel,channelActive, etc.)- Specified by:
- addHandlerin interface- Connection
- Parameters:
- name- handler name
- handler- handler instance
- Returns:
- this Connection
 
- 
markSentHeadersMark the headers sent.- Returns:
- true if marked for the first time
 
- 
markSentBodyprotected final boolean markSentBody()Mark the body sent.- Returns:
- true if marked for the first time
 
- 
hasSentBodyprotected final boolean hasSentBody()Has Body been sent.- Returns:
- true if body has been sent
- Since:
- 1.0.37
 
- 
markSentHeaderAndBodyMark the headers and body sent.- Returns:
- true if marked for the first time
 
- 
initShortId- Overrides:
- initShortIdin class- ChannelOperations<INBOUND extends NettyInbound,- OUTBOUND extends NettyOutbound> 
 
- 
resolvePathReturns the decoded path portion from the provideduri.- Parameters:
- uri- an HTTP URL that may contain a path with query/fragment
- Returns:
- the decoded path portion from the provided uri
 
- 
outboundHttpMessageOutbound Netty HttpMessage.- Returns:
- Outbound Netty HttpMessage
 
- 
prepareHttpMessage
 
-