public abstract class HttpChannel<IN,OUT> extends ChannelStream<IN,OUT>
ChannelStream
extension that provides for several helpers to control HTTP behavior and
observe its metadata.ReactorChannel.ConsumerSpec
Modifier and Type | Field and Description |
---|---|
protected static AtomicIntegerFieldUpdater<HttpChannel> |
HEADERS_SENT |
static String |
HTTP_SCHEME |
static String |
HTTPS_SCHEME |
static String |
WS_SCHEME |
static String |
WSS_SCHEME |
log
Constructor and Description |
---|
HttpChannel(Environment env,
long prefetch,
Dispatcher eventsDispatcher) |
Modifier and Type | Method and Description |
---|---|
HttpChannel<IN,OUT> |
addHeader(String name,
String value)
Accumulate a Request Header using the given name and value, appending ";" for each new value
|
HttpChannel<IN,OUT> |
addResponseHeader(String name,
String value)
Accumulate a response HTTP header for the given key name, appending ";" for each new value
|
protected abstract void |
doAddHeader(String name,
String value) |
protected abstract void |
doAddResponseHeader(String name,
String value) |
protected abstract void |
doHeader(String name,
String value) |
protected abstract void |
doResponseHeader(String name,
String value) |
protected abstract void |
doResponseStatus(Status status) |
HttpChannel<IN,OUT> |
header(String name,
String value)
Register an HTTP request header
|
abstract HttpHeaders |
headers() |
abstract boolean |
isKeepAlive()
Is the request keepAlive
|
abstract HttpChannel<IN,OUT> |
keepAlive(boolean keepAlive)
set the request keepAlive if true otherwise remove the existing connection keep alive header
|
abstract Method |
method() |
String |
param(String key)
Read URI param from the given key
|
Map<String,String> |
params()
Read all URI params
|
abstract Protocol |
protocol() |
HttpChannel<IN,OUT> |
responseHeader(String name,
String value)
Define the response HTTP header for the given key
|
abstract ResponseHeaders |
responseHeaders() |
abstract Status |
responseStatus() |
HttpChannel<IN,OUT> |
responseStatus(Status status)
Set the response status to an outgoing response
|
HttpChannel<IN,OUT> |
sse() |
abstract Transfer |
transfer() |
abstract HttpChannel<IN,OUT> |
transfer(Transfer transfer)
Define the Transfer mode for this http connection
|
abstract String |
uri() |
delegate, doDecoded, doSubscribeWriter, getCapacity, getDecoder, getDispatcher, getEncoder, getEnvironment, writeBufferWith, writeWith
adaptiveConsume, adaptiveConsumeOn, after, batchConsume, batchConsumeOn, broadcast, broadcastOn, broadcastTo, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, cache, cancelSubscription, capacity, cast, combine, concatMap, concatWith, consume, consume, consume, consume, consume, consumeLater, consumeOn, consumeOn, consumeOn, count, count, decode, defaultIfEmpty, dematerialize, dispatchOn, dispatchOn, dispatchOn, distinct, distinct, distinctUntilChanged, distinctUntilChanged, downstreamSubscription, elapsed, elementAt, elementAtOrDefault, encode, env, exists, fanIn, filter, filter, finallyDo, flatMap, getTimer, groupBy, ignoreError, ignoreError, isReactivePull, join, joinWith, keepAlive, last, lift, log, log, map, materialize, merge, mergeWith, nest, next, observe, observeCancel, observeComplete, observeError, observeStart, observeSubscribe, onErrorResumeNext, onErrorResumeNext, onErrorReturn, onErrorReturn, onOverflowBuffer, onOverflowBuffer, onOverflowDrop, partition, partition, process, recover, reduce, reduce, repeat, repeat, repeatWhen, requestWhen, retry, retry, retry, retry, retryWhen, sample, sample, sample, sample, sample, sample, sampleFirst, sampleFirst, sampleFirst, sampleFirst, sampleFirst, sampleFirst, scan, scan, skip, skip, skip, skipWhile, skipWhile, sort, sort, sort, sort, split, split, startWith, startWith, startWith, subscribe, subscribeOn, subscribeOn, subscribeOn, switchMap, take, take, take, takeWhile, tap, throttle, throttle, timeout, timeout, timeout, timeout, timestamp, toBlockingQueue, toBlockingQueue, toList, toList, toString, unbounded, when, window, window, window, window, window, window, window, window, window, window, window, zip, zipWith, zipWith
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
on, remoteAddress
public static final String WS_SCHEME
public static final String WSS_SCHEME
public static final String HTTP_SCHEME
public static final String HTTPS_SCHEME
protected static final AtomicIntegerFieldUpdater<HttpChannel> HEADERS_SENT
public HttpChannel(Environment env, long prefetch, Dispatcher eventsDispatcher)
public final Map<String,String> params()
public final String param(String key)
key
- matching keypublic abstract HttpHeaders headers()
public final HttpChannel<IN,OUT> header(String name, String value)
name
- Header namevalue
- Header contentpublic abstract boolean isKeepAlive()
public abstract HttpChannel<IN,OUT> keepAlive(boolean keepAlive)
public HttpChannel<IN,OUT> addHeader(String name, String value)
name
- value
- public abstract Protocol protocol()
public abstract String uri()
public abstract Method method()
public abstract Status responseStatus()
public HttpChannel<IN,OUT> responseStatus(Status status)
status
- the status to defineprotected abstract void doResponseStatus(Status status)
public abstract ResponseHeaders responseHeaders()
public final HttpChannel<IN,OUT> responseHeader(String name, String value)
name
- the HTTP response header key to overridevalue
- the HTTP response header contentpublic HttpChannel<IN,OUT> addResponseHeader(String name, String value)
name
- the HTTP response header namevalue
- the HTTP response header valuepublic HttpChannel<IN,OUT> sse()
public abstract Transfer transfer()
public abstract HttpChannel<IN,OUT> transfer(Transfer transfer)
transfer
- the new transfer modeCopyright © 2016. All rights reserved.