cloud.piranha.api.WebApplicationResponse
, javax.servlet.http.HttpServletResponse
, javax.servlet.ServletResponse
DefaultWebApplicationServerResponse
public class DefaultWebApplicationResponse
extends javax.servlet.ServletOutputStream
implements cloud.piranha.api.WebApplicationResponse
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
bodyOnly |
Stores the body only flag.
|
protected byte[] |
buffer |
Stores the buffer.
|
protected java.lang.String |
characterEncoding |
Stores the character encoding.
|
protected boolean |
characterEncodingSet |
Stores if the character encoding has been set manually.
|
protected boolean |
committed |
Stores the committed flag.
|
protected long |
contentLength |
Stores the content length.
|
protected java.lang.String |
contentType |
Stores the content type.
|
protected boolean |
contentTypeSet |
Stores if the content type has been set manually.
|
protected java.util.List<javax.servlet.http.Cookie> |
cookies |
Stores the cookies.
|
protected boolean |
gotOutput |
Stores if we acquired the output stream.
|
protected boolean |
gotWriter |
Stores if we acquired the writer.
|
protected DefaultHttpHeaderManager |
headerManager |
Stores the header manager.
|
protected int |
index |
Stores the index.
|
protected java.util.Locale |
locale |
Stores the locale.
|
protected java.io.OutputStream |
outputStream |
Stores the output stream.
|
protected int |
status |
Stores the status code.
|
protected java.lang.String |
statusMessage |
Stores the status message.
|
protected cloud.piranha.api.WebApplication |
webApplication |
Stores the web application.
|
protected java.io.PrintWriter |
writer |
Stores the writer.
|
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
Constructor | Description |
---|---|
DefaultWebApplicationResponse() |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addCookie(javax.servlet.http.Cookie cookie) |
Add the cookie.
|
void |
addDateHeader(java.lang.String name,
long date) |
Add the date header.
|
void |
addHeader(java.lang.String name,
java.lang.String value) |
Add the header.
|
void |
addIntHeader(java.lang.String name,
int value) |
Add the integer header.
|
void |
close() |
Close the output stream.
|
boolean |
containsHeader(java.lang.String name) |
Contains the given header.
|
java.lang.String |
encodeRedirectUrl(java.lang.String url) |
Deprecated.
|
java.lang.String |
encodeRedirectURL(java.lang.String url) |
Encode the redirect URL.
|
java.lang.String |
encodeUrl(java.lang.String url) |
Deprecated.
|
java.lang.String |
encodeURL(java.lang.String url) |
Encode the URL.
|
void |
flush() |
Flush the output stream.
|
void |
flushBuffer() |
Flush the buffer.
|
int |
getBufferSize() |
Get the buffer size.
|
java.lang.String |
getCharacterEncoding() |
Get the character encoding.
|
long |
getContentLength() |
Get the content length.
|
java.lang.String |
getContentType() |
Get the content type.
|
java.util.Collection<javax.servlet.http.Cookie> |
getCookies() |
Get the cookies.
|
java.lang.String |
getHeader(java.lang.String name) |
Get the header.
|
java.util.Collection<java.lang.String> |
getHeaderNames() |
Get the header names.
|
java.util.Collection<java.lang.String> |
getHeaders(java.lang.String name) |
Get the headers.
|
java.util.Locale |
getLocale() |
Get the locale.
|
javax.servlet.ServletOutputStream |
getOutputStream() |
Get the output stream.
|
int |
getStatus() |
Get the status.
|
java.lang.String |
getStatusMessage() |
Get the status message.
|
java.io.OutputStream |
getUnderlyingOutputStream() |
Get the underlying output stream.
|
cloud.piranha.api.WebApplication |
getWebApplication() |
Get the web application.
|
java.io.PrintWriter |
getWriter() |
Get the writer.
|
boolean |
isBodyOnly() |
Is body only.
|
boolean |
isCommitted() |
Is committed.
|
boolean |
isReady() |
Is the output stream ready?
|
void |
reset() |
Reset the response.
|
void |
resetBuffer() |
Reset the buffer.
|
void |
sendError(int status) |
Send an error.
|
void |
sendError(int status,
java.lang.String statusMessage) |
Send the error.
|
void |
sendRedirect(java.lang.String location) |
Send the redirect.
|
void |
setBodyOnly(boolean bodyOnly) |
Set the body only flag.
|
void |
setBufferSize(int bufferSize) |
Set the buffer size.
|
void |
setCharacterEncoding(java.lang.String characterEncoding) |
Set the character encoding.
|
void |
setCommitted(boolean committed) |
Set the committed.
|
void |
setContentLength(int contentLength) |
Set the content length.
|
void |
setContentLengthLong(long contentLength) |
Set the content length.
|
void |
setContentType(java.lang.String type) |
Set the content type.
|
void |
setDateHeader(java.lang.String name,
long date) |
Set the date header.
|
void |
setHeader(java.lang.String name,
java.lang.String value) |
Set the header.
|
void |
setIntHeader(java.lang.String name,
int value) |
Set the int header.
|
void |
setLocale(java.util.Locale locale) |
Set the locale.
|
void |
setOutputStream(javax.servlet.ServletOutputStream outputStream) |
Set the output stream.
|
void |
setStatus(int status) |
Set the status.
|
void |
setStatus(int status,
java.lang.String statusMessage) |
Deprecated.
|
void |
setUnderlyingOutputStream(java.io.OutputStream outputStream) |
Set the underlying output stream.
|
void |
setWebApplication(cloud.piranha.api.WebApplication webApplication) |
Set the web application.
|
void |
setWriteListener(javax.servlet.WriteListener listener) |
Set the write listener.
|
protected void |
verifyNotCommitted(java.lang.String methodName) |
Verify we are not committed.
|
void |
write(int integer) |
Write the integer.
|
getTrailerFields, setTrailerFields
protected boolean bodyOnly
protected byte[] buffer
protected java.lang.String characterEncoding
protected boolean characterEncodingSet
protected boolean committed
protected long contentLength
protected java.lang.String contentType
protected boolean contentTypeSet
protected java.util.List<javax.servlet.http.Cookie> cookies
protected boolean gotOutput
protected boolean gotWriter
protected DefaultHttpHeaderManager headerManager
protected int index
protected java.util.Locale locale
protected java.io.PrintWriter writer
protected java.io.OutputStream outputStream
protected int status
protected java.lang.String statusMessage
protected cloud.piranha.api.WebApplication webApplication
public DefaultWebApplicationResponse()
public void addCookie(javax.servlet.http.Cookie cookie)
addCookie
in interface javax.servlet.http.HttpServletResponse
cookie
- the cookie.public void addDateHeader(java.lang.String name, long date)
addDateHeader
in interface javax.servlet.http.HttpServletResponse
name
- the header name.date
- the header date value.public void addHeader(java.lang.String name, java.lang.String value)
addHeader
in interface javax.servlet.http.HttpServletResponse
name
- the name.value
- the value.public void addIntHeader(java.lang.String name, int value)
addIntHeader
in interface javax.servlet.http.HttpServletResponse
name
- the name of the header.value
- the value of the header.public boolean containsHeader(java.lang.String name)
containsHeader
in interface javax.servlet.http.HttpServletResponse
name
- the header name.public java.lang.String encodeRedirectURL(java.lang.String url)
encodeRedirectURL
in interface javax.servlet.http.HttpServletResponse
url
- the url.public java.lang.String encodeRedirectUrl(java.lang.String url)
encodeRedirectUrl
in interface javax.servlet.http.HttpServletResponse
url
- the url.public java.lang.String encodeURL(java.lang.String url)
encodeURL
in interface javax.servlet.http.HttpServletResponse
url
- the URL.public java.lang.String encodeUrl(java.lang.String url)
encodeUrl
in interface javax.servlet.http.HttpServletResponse
url
- the url.public void flushBuffer() throws java.io.IOException
flushBuffer
in interface javax.servlet.ServletResponse
java.io.IOException
- when an I/O error occurs.public java.lang.String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletResponse
public int getBufferSize()
getBufferSize
in interface javax.servlet.ServletResponse
public long getContentLength()
public java.lang.String getContentType()
getContentType
in interface javax.servlet.ServletResponse
public java.lang.String getHeader(java.lang.String name)
getHeader
in interface javax.servlet.http.HttpServletResponse
name
- the header name.public java.util.Collection<java.lang.String> getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletResponse
public java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
getHeaders
in interface javax.servlet.http.HttpServletResponse
name
- the name of the header.public java.util.Locale getLocale()
getLocale
in interface javax.servlet.ServletResponse
public javax.servlet.ServletOutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface javax.servlet.ServletResponse
java.io.IOException
- when an I/O error occurs.public int getStatus()
getStatus
in interface javax.servlet.http.HttpServletResponse
public java.lang.String getStatusMessage()
public cloud.piranha.api.WebApplication getWebApplication()
public java.io.PrintWriter getWriter() throws java.io.IOException
getWriter
in interface javax.servlet.ServletResponse
java.io.IOException
- when an I/O error occurs.public boolean isBodyOnly()
public boolean isCommitted()
isCommitted
in interface javax.servlet.ServletResponse
public void reset()
reset
in interface javax.servlet.ServletResponse
public void resetBuffer()
resetBuffer
in interface javax.servlet.ServletResponse
public void sendError(int status) throws java.io.IOException
sendError
in interface javax.servlet.http.HttpServletResponse
status
- the error code.java.io.IOException
- when an I/O error occurs.public void sendError(int status, java.lang.String statusMessage) throws java.io.IOException
sendError
in interface javax.servlet.http.HttpServletResponse
status
- the status code.statusMessage
- the message.java.io.IOException
- when an I/O error occurs.public void sendRedirect(java.lang.String location) throws java.io.IOException
sendRedirect
in interface javax.servlet.http.HttpServletResponse
location
- the location.java.io.IOException
- when an I/O error occurs.public void setBodyOnly(boolean bodyOnly)
bodyOnly
- flag.public void setBufferSize(int bufferSize)
setBufferSize
in interface javax.servlet.ServletResponse
bufferSize
- the buffer size.public void setCharacterEncoding(java.lang.String characterEncoding)
setCharacterEncoding
in interface javax.servlet.ServletResponse
characterEncoding
- the character encoding.public void setCommitted(boolean committed)
committed
- the committed flag.public void setContentLength(int contentLength)
setContentLength
in interface javax.servlet.ServletResponse
contentLength
- the content length.public void setContentLengthLong(long contentLength)
setContentLengthLong
in interface javax.servlet.ServletResponse
contentLength
- the content length.public void setContentType(java.lang.String type)
setContentType
in interface javax.servlet.ServletResponse
type
- the content type.public void setDateHeader(java.lang.String name, long date)
setDateHeader
in interface javax.servlet.http.HttpServletResponse
name
- the header name.date
- the date.public void setHeader(java.lang.String name, java.lang.String value)
setHeader
in interface javax.servlet.http.HttpServletResponse
name
- the name.value
- the value.public void setIntHeader(java.lang.String name, int value)
setIntHeader
in interface javax.servlet.http.HttpServletResponse
name
- the header name.value
- the header value.public void setLocale(java.util.Locale locale)
setLocale
in interface javax.servlet.ServletResponse
locale
- the locale.public void setOutputStream(javax.servlet.ServletOutputStream outputStream)
outputStream
- the output stream.public void setStatus(int status)
setStatus
in interface javax.servlet.http.HttpServletResponse
status
- the status code.public void setStatus(int status, java.lang.String statusMessage)
setStatus
in interface javax.servlet.http.HttpServletResponse
status
- the status.statusMessage
- the messagepublic void setWebApplication(cloud.piranha.api.WebApplication webApplication)
webApplication
- the web application.protected void verifyNotCommitted(java.lang.String methodName)
methodName
- the method we are checking for.public java.util.Collection<javax.servlet.http.Cookie> getCookies()
getCookies
in interface cloud.piranha.api.WebApplicationResponse
public java.io.OutputStream getUnderlyingOutputStream()
getUnderlyingOutputStream
in interface cloud.piranha.api.WebApplicationResponse
public void setUnderlyingOutputStream(java.io.OutputStream outputStream)
setUnderlyingOutputStream
in interface cloud.piranha.api.WebApplicationResponse
outputStream
- the underlying output stream.public void close() throws java.io.IOException
close
in class java.io.OutputStream
java.io.IOException
- when an I/O error occurs.public void flush() throws java.io.IOException
flush
in class java.io.OutputStream
java.io.IOException
- when an I/O error occurs.public boolean isReady()
isReady
in class javax.servlet.ServletOutputStream
public void setWriteListener(javax.servlet.WriteListener listener)
setWriteListener
in class javax.servlet.ServletOutputStream
listener
- the write listener.public void write(int integer) throws java.io.IOException
write
in class java.io.OutputStream
integer
- the integer.java.io.IOException
- when an I/O error occurs.Copyright © 2020 Piranha Cloud. All rights reserved.