Package net.shibboleth.sp.messaging
Class RemotedHttpServletResponse
java.lang.Object
net.shibboleth.sp.messaging.RemotedHttpServletResponse
- All Implemented Interfaces:
HttpServletResponse,ServletResponse
@NotThreadSafe
public class RemotedHttpServletResponse
extends Object
implements HttpServletResponse
Uses a
DDF object to reflect an HTTP response back to a remote caller.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classA pseudoServletOutputStreamto catch output.private static final classWrapper allowing use of containers of arrays. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intSize of each character buffer for output.private booleanTracks committing of response.static final StringField holding response body data.static final StringField holding header collection.private final DDFUnderlying object for remoted data.A materialized output stream.static final StringField holding redirect location.static final StringField holding response.static final StringField holding response body status.static final StringField holding name ofDDFstructure containing response.Fields inherited from interface jakarta.servlet.http.HttpServletResponse
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_MISDIRECTED_REQUEST, 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_PERMANENT_REDIRECT, 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_UNPROCESSABLE_CONTENT, SC_UNSUPPORTED_MEDIA_TYPE, SC_UPGRADE_REQUIRED, SC_USE_PROXY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddDateHeader(String name, long date) voidvoidaddIntHeader(String name, int value) booleancontainsHeader(String name) encodeRedirectURL(String url) voidintgetDDF()Gets the underlying object containing the response data.private DDFGet the list node to which headers should be added.getHeaders(String name) intbooleanvoidreset()voidvoidsendError(int sc) voidvoidsendRedirect(byte[] location) Issues a redirect recongizing as Java does not that URLs are not in fact Unicode-safe.voidsendRedirect(String location) voidsendRedirect(String location, int sc, boolean clearBuffer) voidsetBufferSize(int size) voidsetCharacterEncoding(String charset) voidsetContentLength(int len) voidsetContentLengthLong(long len) voidsetContentType(String type) voidsetDateHeader(String name, long date) voidvoidsetIntHeader(String name, int value) voidvoidsetStatus(int sc) private voidunsetHeader(String name) Removes any existing header(s) of this type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.http.HttpServletResponse
getTrailerFields, sendRedirect, sendRedirect, setTrailerFieldsMethods inherited from interface jakarta.servlet.ServletResponse
setCharacterEncoding
-
Field Details
-
STRUCTURE_NAME
Field holding name ofDDFstructure containing response.- See Also:
-
REDIRECT
Field holding redirect location.- See Also:
-
RESPONSE
Field holding response.- See Also:
-
DATA
Field holding response body data.- See Also:
-
STATUS
Field holding response body status.- See Also:
-
HEADERS
Field holding header collection.- See Also:
-
obj
Underlying object for remoted data. -
bufferSize
private int bufferSizeSize of each character buffer for output. -
committed
private boolean committedTracks committing of response. -
outputStream
A materialized output stream.
-
-
Constructor Details
-
RemotedHttpServletResponse
Constructor.- Parameters:
ddf- object to capture response
-
-
Method Details
-
getDDF
Gets the underlying object containing the response data.- Returns:
- remoted data object
-
getCharacterEncoding
- Specified by:
getCharacterEncodingin interfaceServletResponse
-
getContentType
- Specified by:
getContentTypein interfaceServletResponse
-
getOutputStream
- Specified by:
getOutputStreamin interfaceServletResponse- Throws:
IOException
-
getWriter
- Specified by:
getWriterin interfaceServletResponse- Throws:
IOException
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfaceServletResponse
-
setContentLength
public void setContentLength(int len) - Specified by:
setContentLengthin interfaceServletResponse
-
setContentLengthLong
public void setContentLengthLong(long len) - Specified by:
setContentLengthLongin interfaceServletResponse
-
setContentType
- Specified by:
setContentTypein interfaceServletResponse
-
setBufferSize
public void setBufferSize(int size) - Specified by:
setBufferSizein interfaceServletResponse
-
getBufferSize
public int getBufferSize()- Specified by:
getBufferSizein interfaceServletResponse
-
flushBuffer
- Specified by:
flushBufferin interfaceServletResponse- Throws:
IOException
-
resetBuffer
public void resetBuffer()- Specified by:
resetBufferin interfaceServletResponse
-
isCommitted
public boolean isCommitted()- Specified by:
isCommittedin interfaceServletResponse
-
reset
public void reset()- Specified by:
resetin interfaceServletResponse
-
setLocale
- Specified by:
setLocalein interfaceServletResponse
-
getLocale
- Specified by:
getLocalein interfaceServletResponse
-
addCookie
- Specified by:
addCookiein interfaceHttpServletResponse
-
containsHeader
- Specified by:
containsHeaderin interfaceHttpServletResponse
-
encodeURL
- Specified by:
encodeURLin interfaceHttpServletResponse
-
encodeRedirectURL
- Specified by:
encodeRedirectURLin interfaceHttpServletResponse
-
sendError
- Specified by:
sendErrorin interfaceHttpServletResponse- Throws:
IOException
-
sendError
- Specified by:
sendErrorin interfaceHttpServletResponse- Throws:
IOException
-
sendRedirect
- Specified by:
sendRedirectin interfaceHttpServletResponse- Throws:
IOException
-
sendRedirect
- Specified by:
sendRedirectin interfaceHttpServletResponse- Throws:
IOException
-
sendRedirect
public void sendRedirect(byte[] location) Issues a redirect recongizing as Java does not that URLs are not in fact Unicode-safe.- Parameters:
location- raw location bytes
-
setDateHeader
- Specified by:
setDateHeaderin interfaceHttpServletResponse
-
addDateHeader
- Specified by:
addDateHeaderin interfaceHttpServletResponse
-
setHeader
- Specified by:
setHeaderin interfaceHttpServletResponse
-
addHeader
- Specified by:
addHeaderin interfaceHttpServletResponse
-
setIntHeader
- Specified by:
setIntHeaderin interfaceHttpServletResponse
-
addIntHeader
- Specified by:
addIntHeaderin interfaceHttpServletResponse
-
setStatus
public void setStatus(int sc) - Specified by:
setStatusin interfaceHttpServletResponse
-
getStatus
public int getStatus()- Specified by:
getStatusin interfaceHttpServletResponse
-
getHeader
- Specified by:
getHeaderin interfaceHttpServletResponse
-
getHeaders
- Specified by:
getHeadersin interfaceHttpServletResponse
-
getHeaderNames
- Specified by:
getHeaderNamesin interfaceHttpServletResponse
-
unsetHeader
Removes any existing header(s) of this type.- Parameters:
name- name of header to remove
-
getHeaderList
Get the list node to which headers should be added.- Returns:
- a pre-existing list or a new one for mutation.
-