public final class Response
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
ActionHook |
hook
Action hook.
|
Constructor and Description |
---|
Response() |
Modifier and Type | Method and Description |
---|---|
void |
action(ActionCode actionCode,
java.lang.Object param) |
void |
addHeader(java.lang.String name,
java.lang.String value) |
void |
addHeader(java.lang.String name,
java.lang.String value,
java.nio.charset.Charset charset) |
boolean |
checkRegisterForWrite() |
boolean |
containsHeader(java.lang.String name)
Warning: This method always returns
false for Content-Type
and Content-Length. |
void |
doWrite(ByteChunk chunk)
Write a chunk of bytes.
|
long |
getBytesWritten(boolean flush)
Bytes written to socket - i.e. after compression, chunking, etc.
|
java.lang.String |
getCharacterEncoding() |
long |
getCommitTime()
Return the time the response was committed (based on System.currentTimeMillis).
|
java.lang.String |
getContentLanguage()
Return the content language.
|
int |
getContentLength() |
long |
getContentLengthLong() |
java.lang.String |
getContentType() |
long |
getContentWritten()
Bytes written by application - i.e. before compression, chunking, etc.
|
java.lang.Exception |
getErrorException()
Get the Exception that occurred during request
processing.
|
ActionHook |
getHook() |
java.util.Locale |
getLocale() |
java.lang.String |
getMessage()
Get the status message.
|
MimeHeaders |
getMimeHeaders() |
java.lang.Object |
getNote(int pos) |
OutputBuffer |
getOutputBuffer() |
Request |
getRequest() |
int |
getStatus() |
WriteListener |
getWriteListener() |
boolean |
isCommitted() |
boolean |
isExceptionPresent() |
boolean |
isReady() |
void |
onWritePossible() |
void |
recycle() |
void |
reset() |
void |
sendHeaders()
Signal that we're done with the headers, and body will follow.
|
void |
setCharacterEncoding(java.lang.String charset) |
void |
setCommitted(boolean v) |
void |
setContentLength(long contentLength) |
void |
setContentType(java.lang.String type)
Sets the content type.
|
void |
setContentTypeNoCharset(java.lang.String type) |
void |
setErrorException(java.lang.Exception ex)
Set the error Exception that occurred during
request processing.
|
void |
setHeader(java.lang.String name,
java.lang.String value) |
void |
setHook(ActionHook hook) |
void |
setLocale(java.util.Locale locale)
Called explicitly by user to set the Content-Language and
the default encoding
|
void |
setMessage(java.lang.String message)
Set the status message.
|
void |
setNote(int pos,
java.lang.Object value) |
void |
setOutputBuffer(OutputBuffer outputBuffer) |
void |
setRequest(Request req) |
void |
setStatus(int status)
Set the response status
|
void |
setWriteListener(WriteListener listener) |
public volatile ActionHook hook
public Request getRequest()
public void setRequest(Request req)
public OutputBuffer getOutputBuffer()
public void setOutputBuffer(OutputBuffer outputBuffer)
public MimeHeaders getMimeHeaders()
public ActionHook getHook()
public void setHook(ActionHook hook)
public final void setNote(int pos, java.lang.Object value)
public final java.lang.Object getNote(int pos)
public void action(ActionCode actionCode, java.lang.Object param)
public int getStatus()
public void setStatus(int status)
public java.lang.String getMessage()
public void setMessage(java.lang.String message)
public boolean isCommitted()
public void setCommitted(boolean v)
public long getCommitTime()
public void setErrorException(java.lang.Exception ex)
public java.lang.Exception getErrorException()
public boolean isExceptionPresent()
public void reset() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public boolean containsHeader(java.lang.String name)
false
for Content-Type
and Content-Length.public void setHeader(java.lang.String name, java.lang.String value)
public void addHeader(java.lang.String name, java.lang.String value)
public void addHeader(java.lang.String name, java.lang.String value, java.nio.charset.Charset charset)
public void sendHeaders()
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
public java.lang.String getContentLanguage()
public void setCharacterEncoding(java.lang.String charset)
public java.lang.String getCharacterEncoding()
public void setContentType(java.lang.String type)
type
- the content typepublic void setContentTypeNoCharset(java.lang.String type)
public java.lang.String getContentType()
public void setContentLength(long contentLength)
public int getContentLength()
public long getContentLengthLong()
public void doWrite(ByteChunk chunk) throws java.io.IOException
java.io.IOException
public void recycle()
public long getContentWritten()
public long getBytesWritten(boolean flush)
public WriteListener getWriteListener()
public void setWriteListener(WriteListener listener)
public boolean isReady()
public boolean checkRegisterForWrite()
public void onWritePossible() throws java.io.IOException
java.io.IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.