public final class Response extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
characterEncoding |
protected boolean |
charsetSet
Has the charset been explicitly set.
|
protected boolean |
commited
Committed flag.
|
protected String |
contentLanguage |
protected long |
contentLength |
protected String |
contentType
HTTP specific fields.
|
protected Exception |
errorException
Holds request error exception.
|
protected String |
errorURI
Request error URI.
|
protected boolean |
flushLeftovers |
protected MimeHeaders |
headers
Response headers.
|
ActionHook |
hook
Action hook.
|
protected int |
lastWrite |
protected String |
message
Status message.
|
protected Object[] |
notes
Notes.
|
protected OutputBuffer |
outputBuffer
Associated output buffer.
|
protected Request |
req |
protected long |
sendfileEnd |
protected String |
sendfilePath |
protected long |
sendfileStart |
protected int |
status
Status code.
|
Constructor and Description |
---|
Response() |
Modifier and Type | Method and Description |
---|---|
void |
acknowledge() |
void |
action(ActionCode actionCode,
Object param) |
void |
addHeader(String name,
String value) |
boolean |
containsHeader(String name)
Warning: This method always returns
false |
void |
doWrite(ByteChunk chunk)
Write a chunk of bytes.
|
void |
finish() |
long |
getBytesWritten() |
String |
getCharacterEncoding() |
String |
getContentLanguage()
Return the content language.
|
int |
getContentLength() |
long |
getContentLengthLong() |
String |
getContentType() |
Exception |
getErrorException()
Get the Exception that occurred during request
processing.
|
String |
getErrorURI()
Get the request URI that caused the original error.
|
boolean |
getFlushLeftovers() |
ActionHook |
getHook() |
int |
getLastWrite() |
Locale |
getLocale() |
String |
getMessage()
Get the status message.
|
MimeHeaders |
getMimeHeaders() |
Object |
getNote(int pos) |
OutputBuffer |
getOutputBuffer() |
Request |
getRequest() |
long |
getSendfileEnd() |
String |
getSendfilePath() |
long |
getSendfileStart() |
int |
getStatus() |
boolean |
isCommitted() |
boolean |
isExceptionPresent() |
void |
recycle() |
void |
reset() |
void |
sendHeaders()
Signal that we're done with the headers, and body will follow.
|
void |
setBytesWritten(long bytesWritten) |
void |
setCharacterEncoding(String charset) |
void |
setCommitted(boolean v) |
void |
setContentLength(int contentLength) |
void |
setContentLength(long contentLength) |
void |
setContentType(String type)
Sets the content type.
|
void |
setErrorException(Exception ex)
Set the error Exception that occurred during
request processing.
|
void |
setErrorURI(String uri)
Set request URI that caused an error during
request processing.
|
void |
setFlushLeftovers(boolean flushLeftovers) |
void |
setHeader(String name,
String value) |
void |
setHook(ActionHook hook) |
void |
setLastWrite(int lastWrite) |
void |
setLocale(Locale locale)
Called explicitely by user to set the Content-Language and
the default encoding
|
void |
setMessage(String message)
Set the status message.
|
void |
setNote(int pos,
Object value) |
void |
setOutputBuffer(OutputBuffer outputBuffer) |
void |
setRequest(Request req) |
void |
setSendfileEnd(long sendfileEnd) |
void |
setSendfilePath(String sendfilePath) |
void |
setSendfileStart(long sendfileStart) |
void |
setStatus(int status)
Set the response status
|
protected int status
protected String message
protected MimeHeaders headers
protected OutputBuffer outputBuffer
protected Object[] notes
protected boolean commited
public ActionHook hook
protected String contentType
protected String contentLanguage
protected String characterEncoding
protected long contentLength
protected Exception errorException
protected boolean charsetSet
protected String errorURI
protected Request req
protected int lastWrite
protected boolean flushLeftovers
protected String sendfilePath
protected long sendfileStart
protected long sendfileEnd
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, Object value)
public final Object getNote(int pos)
public void action(ActionCode actionCode, Object param)
public boolean getFlushLeftovers()
public void setFlushLeftovers(boolean flushLeftovers)
public int getLastWrite()
public void setLastWrite(int lastWrite)
public int getStatus()
public void setStatus(int status)
public String getMessage()
public void setMessage(String message)
public boolean isCommitted()
public void setCommitted(boolean v)
public void setErrorException(Exception ex)
public Exception getErrorException()
public boolean isExceptionPresent()
public void setErrorURI(String uri)
public String getErrorURI()
public void reset() throws IllegalStateException
IllegalStateException
public void finish() throws IOException
IOException
public void acknowledge() throws IOException
IOException
public boolean containsHeader(String name)
false for Content-Type
and Content-Length.
public void sendHeaders() throws IOException
IOException
public Locale getLocale()
public void setLocale(Locale locale)
public String getContentLanguage()
public void setCharacterEncoding(String charset)
public String getCharacterEncoding()
public void setContentType(String type)
type
- the content typepublic String getContentType()
public void setContentLength(int contentLength)
public void setContentLength(long contentLength)
public int getContentLength()
public long getContentLengthLong()
public String getSendfilePath()
public void setSendfilePath(String sendfilePath)
public long getSendfileStart()
public void setSendfileStart(long sendfileStart)
public long getSendfileEnd()
public void setSendfileEnd(long sendfileEnd)
public void doWrite(ByteChunk chunk) throws IOException
IOException
public void recycle()
public long getBytesWritten()
public void setBytesWritten(long bytesWritten)
Copyright © 2016 JBoss by Red Hat. All rights reserved.