public abstract class AbstractServerHttpExchange extends Object implements ServerHttpExchange
ServerHttpExchange.| Modifier and Type | Field and Description |
|---|---|
protected Actions<Data> |
bodyActions |
protected Actions<Void> |
closeActions |
| Constructor and Description |
|---|
AbstractServerHttpExchange() |
| Modifier and Type | Method and Description |
|---|---|
ServerHttpExchange |
bodyAction(Action<Data> action)
Attaches an action to be called with the whole request body where the
request ends.
|
ServerHttpExchange |
close()
Closes the response.
|
ServerHttpExchange |
close(ByteBuffer data)
Writes a byte to the response body and close the response.
|
ServerHttpExchange |
close(String data)
Writes a string to the response body and close the response.
|
ServerHttpExchange |
closeAction(Action<Void> action)
Attaches an action to be called on response close.
|
protected abstract void |
doClose() |
protected abstract void |
doSetHeader(String name,
String value) |
protected abstract void |
doSetStatus(HttpStatus status) |
protected abstract void |
doWrite(ByteBuffer byteBuffer) |
protected abstract void |
doWrite(String data) |
String |
header(String name)
Returns the first request header associated with the given name.
|
protected abstract void |
readBody() |
ServerHttpExchange |
setHeader(String name,
Iterable<String> value)
Sets response headers.
|
ServerHttpExchange |
setHeader(String name,
String value)
Sets a response header.
|
ServerHttpExchange |
setStatus(HttpStatus status)
Sets the HTTP status for the response.
|
ServerHttpExchange |
write(ByteBuffer byteBuffer)
Writes a byte body to the response body.
|
ServerHttpExchange |
write(String data)
Writes a text to the response body.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitheaderNames, headers, method, uripublic String header(String name)
ServerHttpExchangeheader in interface ServerHttpExchangepublic ServerHttpExchange bodyAction(Action<Data> action)
ServerHttpExchangebodyAction in interface ServerHttpExchangeprotected abstract void readBody()
public final ServerHttpExchange setHeader(String name, Iterable<String> value)
ServerHttpExchangesetHeader in interface ServerHttpExchangepublic ServerHttpExchange setHeader(String name, String value)
ServerHttpExchangesetHeader in interface ServerHttpExchangepublic ServerHttpExchange write(String data)
ServerHttpExchangewrite in interface ServerHttpExchangepublic ServerHttpExchange write(ByteBuffer byteBuffer)
ServerHttpExchangewrite in interface ServerHttpExchangeprotected abstract void doWrite(ByteBuffer byteBuffer)
protected abstract void doWrite(String data)
public ServerHttpExchange close()
ServerHttpExchangeclose in interface ServerHttpExchangeprotected abstract void doClose()
public ServerHttpExchange close(String data)
ServerHttpExchangeclose in interface ServerHttpExchangepublic ServerHttpExchange close(ByteBuffer data)
ServerHttpExchangeclose in interface ServerHttpExchangepublic ServerHttpExchange setStatus(HttpStatus status)
ServerHttpExchangesetStatus in interface ServerHttpExchangeprotected abstract void doSetStatus(HttpStatus status)
public ServerHttpExchange closeAction(Action<Void> action)
ServerHttpExchangecloseAction in interface ServerHttpExchangeCopyright 2014, The Vibe Project