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) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeaderValue(String name,
String value) |
void |
addHeaderValues(String name,
List<String> values) |
void |
end() |
void |
flush() |
void |
flush(boolean end) |
protected ByteArrayOutputStream |
getBuffer() |
String |
getCharactersCharsetName() |
String |
getContentType() |
protected Object |
getExchange() |
GZIPOutputStream |
getGzipBuffer() |
GzipOption |
getGzipOption() |
List<String> |
getHeader(String name) |
String |
getHeaderFirst(String name) |
Map<String,List<String>> |
getHeaders() |
protected IJsonManager |
getJsonManager() |
protected ByteArrayOutputStream |
getOut() |
protected R |
getRequestContext() |
protected IServer |
getServer() |
protected ISpincastConfig |
getSpincastConfig() |
protected ISpincastUtils |
getSpincastUtils() |
int |
getStatusCode() |
byte[] |
getUnsentBytes() |
String |
getUnsentCharacters() |
String |
getUnsentCharacters(String encoding) |
protected IXmlManager |
getXmlManager() |
boolean |
isClosed() |
boolean |
isHeadersSent() |
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) |
void |
redirect(String newUrl,
int specific3xxCode) |
void |
removeHeader(String name) |
void |
resetBuffer() |
void |
resetEverything() |
protected void |
send(byte[] bytes,
String contentType,
boolean flush) |
void |
sendBytes(byte[] bytes) |
void |
sendBytes(byte[] bytes,
String contentType) |
void |
sendBytes(byte[] bytes,
String contentType,
boolean flush)
Send some bytes + flush if specified.
|
void |
sendCharacters(String content) |
void |
sendCharacters(String content,
String contentType) |
void |
sendCharacters(String content,
String contentType,
boolean flush) |
void |
sendHtml(String html) |
void |
sendHtml(String string,
boolean flush) |
void |
sendHtmlParse(String html,
Map<String,Object> params) |
void |
sendHtmlParse(String html,
Map<String,Object> params,
boolean flush) |
void |
sendHtmlTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params) |
void |
sendHtmlTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params,
boolean flush) |
void |
sendHtmlTemplate(String templatePath,
Map<String,Object> params) |
void |
sendHtmlTemplate(String templatePath,
Map<String,Object> params,
boolean flush) |
void |
sendJson(String jsonString) |
void |
sendJson(String jsonString,
boolean flush) |
void |
sendJsonObj(Object obj) |
void |
sendJsonObj(Object obj,
boolean flush) |
void |
sendParse(String content,
String contentType,
Map<String,Object> params) |
void |
sendParse(String content,
String contentType,
Map<String,Object> params,
boolean flush) |
void |
sendPlainText(String string) |
void |
sendPlainText(String string,
boolean flush) |
void |
sendTemplate(String templatePath,
boolean isClasspathPath,
String contentType,
Map<String,Object> params) |
void |
sendTemplate(String templatePath,
boolean isClasspathPath,
String contentType,
Map<String,Object> params,
boolean flush) |
void |
sendTemplate(String templatePath,
String contentType,
Map<String,Object> params) |
void |
sendTemplate(String templatePath,
String contentType,
Map<String,Object> params,
boolean flush) |
void |
sendXml(String xml) |
void |
sendXml(String xml,
boolean flush) |
void |
sendXmlObj(Object obj) |
void |
sendXmlObj(Object obj,
boolean flush) |
void |
setCharactersCharsetName(String charactersCharsetName) |
void |
setContentType(String responseContentType) |
void |
setGzipOption(GzipOption gzipOption) |
void |
setHeader(String name,
List<String> values) |
void |
setHeader(String name,
String value) |
protected void |
setIsShouldGzip(Boolean isShouldGzip) |
protected void |
setRequestSizeValidated(boolean requestSizeValidated) |
void |
setStatusCode(int responseStatusCode) |
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)
protected R getRequestContext()
protected IServer getServer()
protected Object getExchange()
protected IJsonManager getJsonManager()
protected IXmlManager getXmlManager()
protected ISpincastConfig getSpincastConfig()
protected ISpincastUtils getSpincastUtils()
protected ByteArrayOutputStream getBuffer()
protected ByteArrayOutputStream getOut()
public GZIPOutputStream getGzipBuffer()
protected boolean isRequestSizeValidated()
protected void setRequestSizeValidated(boolean requestSizeValidated)
public void setGzipOption(GzipOption gzipOption)
setGzipOption in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public GzipOption getGzipOption()
getGzipOption in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public int getStatusCode()
getStatusCode in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void setStatusCode(int responseStatusCode)
setStatusCode in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getContentType()
getContentType in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void setContentType(String responseContentType)
setContentType in interface IResponseRequestContextAddon<R extends IRequestContext<?>>protected boolean isResponseCharactersBased()
public boolean isClosed()
isClosed in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void redirect(String newUrl, boolean permanently)
redirect in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void redirect(String newUrl, int specific3xxCode)
redirect in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendBytes(byte[] bytes)
sendBytes in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendBytes(byte[] bytes,
String contentType)
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)
sendCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendCharacters(String content, String contentType)
sendCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendCharacters(String content, String contentType, boolean flush)
sendCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getCharactersCharsetName()
getCharactersCharsetName in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void setCharactersCharsetName(String charactersCharsetName)
setCharactersCharsetName in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendPlainText(String string)
sendPlainText in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendPlainText(String string, boolean flush)
sendPlainText in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtml(String html)
sendHtml in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtml(String string, boolean flush)
sendHtml in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtmlParse(String html, Map<String,Object> params)
sendHtmlParse in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtmlParse(String html, Map<String,Object> params, boolean flush)
sendHtmlParse in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendParse(String content, String contentType, Map<String,Object> params)
sendParse in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendParse(String content, String contentType, Map<String,Object> params, boolean flush)
sendParse in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtmlTemplate(String templatePath, Map<String,Object> params)
sendHtmlTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtmlTemplate(String templatePath, boolean isClasspathPath, Map<String,Object> params)
sendHtmlTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtmlTemplate(String templatePath, Map<String,Object> params, boolean flush)
sendHtmlTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendHtmlTemplate(String templatePath, boolean isClasspathPath, Map<String,Object> params, boolean flush)
sendHtmlTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendTemplate(String templatePath, String contentType, Map<String,Object> params)
sendTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendTemplate(String templatePath, boolean isClasspathPath, String contentType, Map<String,Object> params)
sendTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendTemplate(String templatePath, String contentType, Map<String,Object> params, boolean flush)
sendTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendTemplate(String templatePath, boolean isClasspathPath, String contentType, Map<String,Object> params, boolean flush)
sendTemplate in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendJson(String jsonString)
sendJson in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendJson(String jsonString, boolean flush)
sendJson in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendJsonObj(Object obj)
sendJsonObj in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendJsonObj(Object obj, boolean flush)
sendJsonObj in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendXml(String xml)
sendXml in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendXml(String xml, boolean flush)
sendXml in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendXmlObj(Object obj)
sendXmlObj in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void sendXmlObj(Object obj, boolean flush)
sendXmlObj in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void resetBuffer()
resetBuffer in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void resetEverything()
resetEverything in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public byte[] getUnsentBytes()
getUnsentBytes in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getUnsentCharacters()
getUnsentCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getUnsentCharacters(String encoding)
getUnsentCharacters in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void removeHeader(String name)
removeHeader in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void setHeader(String name, String value)
setHeader in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void setHeader(String name, List<String> values)
setHeader in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void addHeaderValue(String name, String value)
addHeaderValue in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void addHeaderValues(String name, List<String> values)
addHeaderValues in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public Map<String,List<String>> getHeaders()
getHeaders in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public List<String> getHeader(String name)
getHeader in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public String getHeaderFirst(String name)
getHeaderFirst in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public boolean isHeadersSent()
isHeadersSent in interface IResponseRequestContextAddon<R extends IRequestContext<?>>protected void setIsShouldGzip(Boolean isShouldGzip)
protected boolean isShouldGzip()
public void end()
end in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void flush()
flush in interface IResponseRequestContextAddon<R extends IRequestContext<?>>public void flush(boolean end)
flush in interface IResponseRequestContextAddon<R extends IRequestContext<?>>Copyright © 2016. All rights reserved.