public class SpincastResponseRequestContextAddon<R extends IRequestContext<?>> extends Object implements IResponseRequestContextAddon<R>
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
IS_RESPONSE_CHARACTERS_BASED_BY_DEFAULT |
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SpincastResponseRequestContextAddon(R requestContext,
IServer server,
IJsonManager jsonManager,
IXmlManager xmlManager,
ISpincastConfig spincastConfig,
ISpincastUtils spincastUtils,
IETagFactory etagFactory) |
| Modifier and Type | Method and Description |
|---|---|
IResponseRequestContextAddon<R> |
addHeaderValue(String name,
String value)
Adds a value to a response header.
|
IResponseRequestContextAddon<R> |
addHeaderValues(String name,
List<String> values)
Adds a list of values to a response header.
|
void |
end()
Flushes everything and closes the response.
|
void |
flush()
Flushes the current response.
|
void |
flush(boolean end)
Flushes the current response.
|
protected ByteArrayOutputStream |
getBuffer() |
String |
getCharactersCharsetName()
The charset to use to convert characters to bytes.
|
String |
getContentType()
The current
Content-Type sent or to be send. |
protected IETagFactory |
getEtagFactory() |
protected Object |
getExchange() |
GZIPOutputStream |
getGzipBuffer() |
GzipOption |
getGzipOption()
The currently set gzip options.
|
List<String> |
getHeader(String name)
The values of a specific response header.
|
String |
getHeaderFirst(String name)
The first value of a specific header.
|
Map<String,List<String>> |
getHeaders()
The currently set response headers.
|
protected IJsonManager |
getJsonManager() |
protected ByteArrayOutputStream |
getOut() |
protected R |
getRequestContext() |
protected IServer |
getServer() |
protected ISpincastConfig |
getSpincastConfig() |
protected ISpincastUtils |
getSpincastUtils() |
int |
getStatusCode()
The current
status code sent or to be send. |
byte[] |
getUnsentBytes()
Gets the current unsent bytes (AKA the buffer).
|
String |
getUnsentCharacters()
Gets the current unsent characters (AKA the buffer), using the
UTF-8 encoding. |
String |
getUnsentCharacters(String encoding)
Gets the current unsent characters (AKA the buffer), using the
specified encoding.
|
protected IXmlManager |
getXmlManager() |
boolean |
isClosed()
Is the response closed? If so, nothing more can be sent...
|
boolean |
isHeadersSent()
Are the response headers sent? If this is the case,
then the headers can't be changed anymore.
|
protected boolean |
isRequestSizeValidated() |
protected boolean |
isResponseCharactersBased()
Try to determine is the response is characters based or not.
|
protected boolean |
isShouldGzip() |
void |
redirect(String newUrl,
boolean permanently)
Sets a redirection header.
|
void |
redirect(String newUrl,
int specific3xxCode)
Sets the redirection headers with a specified
3xx status code. |
IResponseRequestContextAddon<R> |
removeHeader(String name)
Removes an header by its name.
|
IResponseRequestContextAddon<R> |
resetBuffer()
Clears the buffer (the unsent buffer, of course).
|
IResponseRequestContextAddon<R> |
resetEverything()
Clears the buffer (the unsent buffer, of course), resets the cookies,
the headers, the
Content-Type and
sets the status code back to 200. |
protected void |
send(byte[] bytes,
String contentType,
boolean flush) |
void |
sendBytes(byte[] bytes)
Sends some
bytes, without flushing. |
void |
sendBytes(byte[] bytes,
String contentType)
Sends some
bytes using the specified Content-Type,
without flushing. |
void |
sendBytes(byte[] bytes,
String contentType,
boolean flush)
Send some bytes + flush if specified.
|
void |
sendCharacters(String content)
Sends a String, using the encoding returned by
getCharactersCharsetName,
without flushing. |
void |
sendCharacters(String content,
String contentType)
Sends a String, using the encoding returned by
getCharactersCharsetName and
using the specified Content-Type, without flushing. |
void |
sendCharacters(String content,
String contentType,
boolean flush)
Sends a String, using the encoding returned by
getCharactersCharsetName
and using the specified Content-Type. |
void |
sendHtml(String html)
Sends a String as
text/html, UTF-8 encoded, without flushing. |
void |
sendHtml(String string,
boolean flush)
Sends a String as
text/html, UTF-8 encoded,
and flushes, if specified. |
void |
sendHtmlParse(String html,
Map<String,Object> params)
Parses the given String using the
ITemplatingEngine and
the given parameters, then sends the result as text/html,
UTF-8 encoded, without flushing. |
void |
sendHtmlParse(String html,
Map<String,Object> params,
boolean flush)
Parses the given String using the
ITemplatingEngine and
the given parameters, then sends the result as text/html,
UTF-8 encoded, and flushes, if specified. |
void |
sendHtmlTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params)
Finds the
HTML template using the ITemplatingEngine, evaluates it using
the given parameters, then sends the
result as text/html, UTF-8 encoded, without flushing. |
void |
sendHtmlTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params,
boolean flush)
Finds the
HTML template using the ITemplatingEngine, evaluates it using
the given parameters, then sends the
result as text/html, UTF-8 encoded, and flushes, if specified. |
void |
sendHtmlTemplate(String templatePath,
Map<String,Object> params)
Finds the
HTML template using the ITemplatingEngine, evaluates it using
the given parameters, then sends the
result as text/html, UTF-8 encoded, without flushing. |
void |
sendHtmlTemplate(String templatePath,
Map<String,Object> params,
boolean flush)
Finds the
HTML template using the ITemplatingEngine, evaluates it using
the given parameters, then sends the
result as text/html, UTF-8 encoded, and flushes, if specified. |
void |
sendJson(String jsonString)
Sends a
Json String using the application/json Content-Type,
without flushing. |
void |
sendJson(String jsonString,
boolean flush)
Sends a
Json String using the application/json Content-Type,
and flushes, if specified. |
void |
sendJsonObj(Object obj)
Serializes the object to
Json and sends as application/json, without flushing. |
void |
sendJsonObj(Object obj,
boolean flush)
Serializes the object to
Json, sends as application/json,
and flushes, if specified. |
void |
sendParse(String content,
String contentType,
Map<String,Object> params)
Parses the given String using the
ITemplatingEngine and
the given parameters, then sends the result using the specified
Content-Type, without flushing. |
void |
sendParse(String content,
String contentType,
Map<String,Object> params,
boolean flush)
Parses the given String using the
ITemplatingEngine and
the given parameters, then sends the result using the specified
Content-Type, and flushes, if specified. |
void |
sendPlainText(String string)
Sends a String as
text/plain, UTF-8 encoded, without flushing. |
void |
sendPlainText(String string,
boolean flush)
Sends a String as
text/plain, UTF-8 encoded,
and flushes, if specified. |
void |
sendTemplate(String templatePath,
boolean isClasspathPath,
String contentType,
Map<String,Object> params)
Finds the specified template using the
ITemplatingEngine, evaluates it using
the given parameters, then sends the
result using the given contentType, without flushing. |
void |
sendTemplate(String templatePath,
boolean isClasspathPath,
String contentType,
Map<String,Object> params,
boolean flush)
Finds the specified template using the
ITemplatingEngine, evaluates it using
the given parameters, then sends the
result using the given contentType, and flushes, if specified. |
void |
sendTemplate(String templatePath,
String contentType,
Map<String,Object> params)
Finds the specified template using the
ITemplatingEngine, evaluates it using
the given parameters, then sends the
result using the given contentType, without flushing. |
void |
sendTemplate(String templatePath,
String contentType,
Map<String,Object> params,
boolean flush)
Finds the specified template using the
ITemplatingEngine, evaluates it using
the given parameters, then sends the
result using the given contentType, and flushes, if specified. |
void |
sendXml(String xml)
Sends some
XML using the application/xml Content-Type,
without flushing. |
void |
sendXml(String xml,
boolean flush)
Sends some
XML using the application/xml Content-Type,
and flushes, if specified. |
void |
sendXmlObj(Object obj)
Serializes the object to
XML and sends as application/xml, without flushing. |
void |
sendXmlObj(Object obj,
boolean flush)
Serializes the object to
XML, sends as application/xml, and flushes, if specified. |
IResponseRequestContextAddon<R> |
setCacheSeconds(int cacheSeconds)
Adds caching headers.
|
IResponseRequestContextAddon<R> |
setCacheSeconds(int cacheSeconds,
boolean isPrivateCache)
Adds caching headers for the specified number
of seconds.
|
IResponseRequestContextAddon<R> |
setCharactersCharsetName(String charactersCharsetName)
Sets the charset to use to convert characters to bytes.
|
IResponseRequestContextAddon<R> |
setContentType(String responseContentType)
The
Content-Type header to use for the response. |
IResponseRequestContextAddon<R> |
setGzipOption(GzipOption gzipOption)
Enable or disable gzipping of the response.
|
IResponseRequestContextAddon<R> |
setHeader(String name,
List<String> values)
Set multiple values to a response header.
|
IResponseRequestContextAddon<R> |
setHeader(String name,
String value)
Set the value to a response header.
|
protected void |
setIsShouldGzip(Boolean isShouldGzip) |
protected void |
setRequestSizeValidated(boolean requestSizeValidated) |
IResponseRequestContextAddon<R> |
setStatusCode(int responseStatusCode)
Sets the response's
status code to use. |
protected final org.slf4j.Logger logger
protected static final boolean IS_RESPONSE_CHARACTERS_BASED_BY_DEFAULT
@Inject public SpincastResponseRequestContextAddon(R requestContext, IServer server, IJsonManager jsonManager, IXmlManager xmlManager, ISpincastConfig spincastConfig, ISpincastUtils spincastUtils, IETagFactory etagFactory)
protected R getRequestContext()
protected IServer getServer()
protected Object getExchange()
protected IJsonManager getJsonManager()
protected IXmlManager getXmlManager()
protected ISpincastConfig getSpincastConfig()
protected ISpincastUtils getSpincastUtils()
protected IETagFactory getEtagFactory()
protected ByteArrayOutputStream getBuffer()
protected ByteArrayOutputStream getOut()
public GZIPOutputStream getGzipBuffer()
protected boolean isRequestSizeValidated()
protected void setRequestSizeValidated(boolean requestSizeValidated)
public IResponseRequestContextAddon<R> setGzipOption(GzipOption gzipOption)
IResponseRequestContextAddonGzipOption.DEFAULT which
will gzip the response only for some Content-Types
and only if a gzip 'Accept-Encoding' header
has been received from the client.setGzipOption in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public GzipOption getGzipOption()
IResponseRequestContextAddongetGzipOption in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public int getStatusCode()
IResponseRequestContextAddonstatus code sent or to be send.getStatusCode in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> setStatusCode(int responseStatusCode)
IResponseRequestContextAddonstatus code to use. Uses 200
by default.
Note that this status code can be changed automatically
if an exception is thrown.setStatusCode in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getContentType()
IResponseRequestContextAddonContent-Type sent or to be send.getContentType in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> setContentType(String responseContentType)
IResponseRequestContextAddonContent-Type header to use for the response. Most
sendXXX() methods will set this automatically.setContentType in interface IResponseRequestContextAddon<R extends IRequestContext<?>>protected boolean isResponseCharactersBased()
public boolean isClosed()
IResponseRequestContextAddonisClosed in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void redirect(String newUrl, boolean permanently)
IResponseRequestContextAddonRedirectException instead if you want to redirect the user
immediately.redirect in interface IResponseRequestContextAddon<R extends IRequestContext<?>>permanently - If true, a
301 header will be sent. If false,
302 will be sent.public void redirect(String newUrl, int specific3xxCode)
IResponseRequestContextAddon3xx status code.
This will NOT close the response and will NOT skip the remaining handlers!
Throw a RedirectException instead if you want to redirect the user
immediately.redirect in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendBytes(byte[] bytes)
IResponseRequestContextAddonbytes, without flushing.sendBytes in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendBytes(byte[] bytes,
String contentType)
IResponseRequestContextAddonbytes using the specified Content-Type,
without flushing.sendBytes in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendBytes(byte[] bytes,
String contentType,
boolean flush)
sendBytes in interface IResponseRequestContextAddon<R extends IRequestContext<?>>protected void send(byte[] bytes,
String contentType,
boolean flush)
public void sendCharacters(String content)
IResponseRequestContextAddongetCharactersCharsetName,
without flushing.sendCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendCharacters(String content, String contentType)
IResponseRequestContextAddongetCharactersCharsetName and
using the specified Content-Type, without flushing.sendCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendCharacters(String content, String contentType, boolean flush)
IResponseRequestContextAddongetCharactersCharsetName
and using the specified Content-Type. Flushes the response, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getCharactersCharsetName()
IResponseRequestContextAddon"UTF-8".getCharactersCharsetName in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> setCharactersCharsetName(String charactersCharsetName)
IResponseRequestContextAddon"UTF-8".
Make sure you use the same charset here
than the one that is sent as the "Content-Type" header (which
is also "UTF-8" by default, if you send data using
sendPlainText(), sendHtml() or sendJson()).setCharactersCharsetName in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendPlainText(String string)
IResponseRequestContextAddontext/plain, UTF-8 encoded, without flushing.sendPlainText in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendPlainText(String string, boolean flush)
IResponseRequestContextAddontext/plain, UTF-8 encoded,
and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendPlainText in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtml(String html)
IResponseRequestContextAddontext/html, UTF-8 encoded, without flushing.sendHtml in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtml(String string, boolean flush)
IResponseRequestContextAddontext/html, UTF-8 encoded,
and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendHtml in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtmlParse(String html, Map<String,Object> params)
IResponseRequestContextAddonITemplatingEngine and
the given parameters, then sends the result as text/html,
UTF-8 encoded, without flushing.sendHtmlParse in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtmlParse(String html, Map<String,Object> params, boolean flush)
IResponseRequestContextAddonITemplatingEngine and
the given parameters, then sends the result as text/html,
UTF-8 encoded, and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendHtmlParse in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendParse(String content, String contentType, Map<String,Object> params)
IResponseRequestContextAddonITemplatingEngine and
the given parameters, then sends the result using the specified
Content-Type, without flushing.sendParse in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendParse(String content, String contentType, Map<String,Object> params, boolean flush)
IResponseRequestContextAddonITemplatingEngine and
the given parameters, then sends the result using the specified
Content-Type, and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendParse in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtmlTemplate(String templatePath, Map<String,Object> params)
IResponseRequestContextAddonHTML template using the ITemplatingEngine, evaluates it using
the given parameters, then sends the
result as text/html, UTF-8 encoded, without flushing.sendHtmlTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>templatePath - must be a classpath's relative path.public void sendHtmlTemplate(String templatePath, boolean isClasspathPath, Map<String,Object> params)
IResponseRequestContextAddonHTML template using the ITemplatingEngine, evaluates it using
the given parameters, then sends the
result as text/html, UTF-8 encoded, without flushing.sendHtmlTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>isClasspathPath - if true, the 'templatePath' is considered as
a classpath's relative path. If false, it is considered as an absolute file
system path.public void sendHtmlTemplate(String templatePath, Map<String,Object> params, boolean flush)
IResponseRequestContextAddonHTML template using the ITemplatingEngine, evaluates it using
the given parameters, then sends the
result as text/html, UTF-8 encoded, and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendHtmlTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>templatePath - must be a classpath's relative path.public void sendHtmlTemplate(String templatePath, boolean isClasspathPath, Map<String,Object> params, boolean flush)
IResponseRequestContextAddonHTML template using the ITemplatingEngine, evaluates it using
the given parameters, then sends the
result as text/html, UTF-8 encoded, and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendHtmlTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>isClasspathPath - if true, the 'templatePath' is considered as
a classpath's relative path. If false, it is considered as an absolute file
system path.public void sendTemplate(String templatePath, String contentType, Map<String,Object> params)
IResponseRequestContextAddonITemplatingEngine, evaluates it using
the given parameters, then sends the
result using the given contentType, without flushing.sendTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>templatePath - must be a classpath's relative path.public void sendTemplate(String templatePath, boolean isClasspathPath, String contentType, Map<String,Object> params)
IResponseRequestContextAddonITemplatingEngine, evaluates it using
the given parameters, then sends the
result using the given contentType, without flushing.sendTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>isClasspathPath - if true, the 'templatePath' is considered as
a classpath's relative path. If false, it is considered as an absolute file
system path.public void sendTemplate(String templatePath, String contentType, Map<String,Object> params, boolean flush)
IResponseRequestContextAddonITemplatingEngine, evaluates it using
the given parameters, then sends the
result using the given contentType, and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>templatePath - must be a classpath's relative path.public void sendTemplate(String templatePath, boolean isClasspathPath, String contentType, Map<String,Object> params, boolean flush)
IResponseRequestContextAddonITemplatingEngine, evaluates it using
the given parameters, then sends the
result using the given contentType, and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>isClasspathPath - if true, the 'templatePath' is considered as
a classpath's relative path. If false, it is considered as an absolute file
system path.public void sendJson(String jsonString)
IResponseRequestContextAddonJson String using the application/json Content-Type,
without flushing.
Synonym of : sendCharacters(jsonString, "application/json")
sendJson in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendJson(String jsonString, boolean flush)
IResponseRequestContextAddonJson String using the application/json Content-Type,
and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.
Synonym of : sendCharacters(jsonString, "application/json", flush)
sendJson in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendJsonObj(Object obj)
IResponseRequestContextAddonJson and sends as application/json, without flushing.sendJsonObj in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendJsonObj(Object obj, boolean flush)
IResponseRequestContextAddonJson, sends as application/json,
and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendJsonObj in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendXml(String xml)
IResponseRequestContextAddonXML using the application/xml Content-Type,
without flushing.
Synonym of : sendCharacters(xml, "application/xml")
sendXml in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendXml(String xml, boolean flush)
IResponseRequestContextAddonXML using the application/xml Content-Type,
and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.
Synonym of : sendCharacters(xml, "application/xml", flush)
sendXml in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendXmlObj(Object obj)
IResponseRequestContextAddonXML and sends as application/xml, without flushing.sendXmlObj in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendXmlObj(Object obj, boolean flush)
IResponseRequestContextAddonXML, sends as application/xml, and flushes, if specified.
Note that once the response is flushed, no header can be added or changed anymore.sendXmlObj in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> resetBuffer()
IResponseRequestContextAddonresetBuffer in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> resetEverything()
IResponseRequestContextAddonContent-Type and
sets the status code back to 200.resetEverything in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public byte[] getUnsentBytes()
IResponseRequestContextAddongetUnsentBytes in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getUnsentCharacters()
IResponseRequestContextAddonUTF-8 encoding.getUnsentCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getUnsentCharacters(String encoding)
IResponseRequestContextAddongetUnsentCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> removeHeader(String name)
IResponseRequestContextAddonremoveHeader in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> setHeader(String name, String value)
IResponseRequestContextAddonnull, the header will be
removed (same behavior as removeHeader(String name))setHeader in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> setHeader(String name, List<String> values)
IResponseRequestContextAddonnull or empty, the header will be
removed (same behavior as removeHeader(String name))setHeader in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> addHeaderValue(String name, String value)
IResponseRequestContextAddonnull, it won't be added.addHeaderValue in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> addHeaderValues(String name, List<String> values)
IResponseRequestContextAddonnull, nothing will be added.addHeaderValues in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public Map<String,List<String>> getHeaders()
IResponseRequestContextAddonTreeMap with case insensitive keys.getHeaders in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public List<String> getHeader(String name)
IResponseRequestContextAddongetHeader in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getHeaderFirst(String name)
IResponseRequestContextAddonnull if the header is not found.getHeaderFirst in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public boolean isHeadersSent()
IResponseRequestContextAddonisHeadersSent in interface IResponseRequestContextAddon<R extends IRequestContext<?>>protected void setIsShouldGzip(Boolean isShouldGzip)
protected boolean isShouldGzip()
public void end()
IResponseRequestContextAddonroute handlers will still
be called).end in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void flush()
IResponseRequestContextAddonstatus code and Content-Type will be added.
Note that once the response is flushed, no header can be added or changed anymore.flush in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void flush(boolean end)
IResponseRequestContextAddonstatus code and content-type will be added.
Note that once the response is flushed, no header can be added or changed anymore.flush in interface IResponseRequestContextAddon<R extends IRequestContext<?>>end - If true, the exchange will be closed and no more data
can be sent.public IResponseRequestContextAddon<R> setCacheSeconds(int cacheSeconds)
IResponseRequestContextAddonsetCacheSeconds in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public IResponseRequestContextAddon<R> setCacheSeconds(int cacheSeconds, boolean isPrivateCache)
IResponseRequestContextAddonsetCacheSeconds in interface IResponseRequestContextAddon<R extends IRequestContext<?>>isPrivateCache - if true, the cache will
be flagged as "private".Copyright © 2016. All rights reserved.