Class RemoteHttpServletResponse

  • All Implemented Interfaces:
    jakarta.servlet.http.HttpServletResponse, jakarta.servlet.ServletResponse, Serializable

    public class RemoteHttpServletResponse
    extends RemoteServletResponse
    implements jakarta.servlet.http.HttpServletResponse, Serializable
    Encapsulates a HttpServletResponse and makes that state that is serializable transferable.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long serialVersionUID  
      • 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_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 Summary

      Constructors 
      Constructor Description
      RemoteHttpServletResponse()
      Used by deserialization.
      RemoteHttpServletResponse​(jakarta.servlet.http.HttpServletResponse response)
      Creates a new RemoteHttpServletResponse encapsulating a normal response
    • Constructor Detail

      • RemoteHttpServletResponse

        public RemoteHttpServletResponse​(jakarta.servlet.http.HttpServletResponse response)
        Creates a new RemoteHttpServletResponse encapsulating a normal response
        Parameters:
        response - The response to be encapsulated.
      • RemoteHttpServletResponse

        public RemoteHttpServletResponse()
        Used by deserialization.
    • Method Detail

      • addCookie

        public void addCookie​(jakarta.servlet.http.Cookie cookie)
        The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object. Serialized. Updates the underlying response if available.
        Specified by:
        addCookie in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        cookie - The cookie to add to the request.
      • getCookies

        public Set<RemoteCookie> getCookies()
        Returns the cookies associated with the request. Serialized.
        Returns:
        A Set containing the cookies.
      • containsHeader

        public boolean containsHeader​(String name)
        The default behavior of this method is to call containsHeader(String name) on the wrapped response object. Serialized.
        Specified by:
        containsHeader in interface jakarta.servlet.http.HttpServletResponse
        Returns:
        true if the header is set, false otherwise.
      • encodeURL

        public String encodeURL​(String url)
        The default behavior of this method is to call encodeURL(String url) on the wrapped response object. Not Serialized.
        Specified by:
        encodeURL in interface jakarta.servlet.http.HttpServletResponse
        Returns:
        The encoded URL, null if not available.
      • encodeRedirectURL

        public String encodeRedirectURL​(String url)
        The default behavior of this method is to return encodeRedirectURL(String url) on the wrapped response object. Not serialized.
        Specified by:
        encodeRedirectURL in interface jakarta.servlet.http.HttpServletResponse
        Returns:
        Encoded redirect URL, null if not available.
      • encodeUrl

        public String encodeUrl​(String url)
        The default behavior of this method is to call encodeUrl(String url) on the wrapped response object. Not Serialized.
        Specified by:
        encodeUrl in interface jakarta.servlet.http.HttpServletResponse
        Returns:
        The encoded URL, null if unavailable.
      • encodeRedirectUrl

        public String encodeRedirectUrl​(String url)
        The default behavior of this method is to return encodeRedirectUrl(String url) on the wrapped response object. Not Serialized.
        Specified by:
        encodeRedirectUrl in interface jakarta.servlet.http.HttpServletResponse
        Returns:
        The encoded redirect URL, null if not available.
      • sendError

        public void sendError​(int sc,
                              String msg)
                       throws IOException
        The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object. Not serialized.
        Specified by:
        sendError in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        sc - The error code
        msg - The error message
        Throws:
        IOException - If the error code cannot be set.
      • sendError

        public void sendError​(int sc)
                       throws IOException
        The default behavior of this method is to call sendError(int sc) on the wrapped response object. Not serialized.
        Specified by:
        sendError in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        sc - The error code
        Throws:
        IOException - If the error code cannot be set.
      • sendRedirect

        public void sendRedirect​(String location)
                          throws IOException
        The default behavior of this method is to return sendRedirect(String location) on the wrapped response object. Not serialized.
        Specified by:
        sendRedirect in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        location - The location of the 302 redirect.
        Throws:
        IOException - If the redirect cannot be set.
      • setDateHeader

        public void setDateHeader​(String name,
                                  long date)
        The default behavior of this method is to call setDateHeader(String name, long date) on the wrapped response object. Serialized.
        Specified by:
        setDateHeader in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        name - The name of the date header
        date - The date expressed in seconds.
      • addDateHeader

        public void addDateHeader​(String name,
                                  long date)
        The default behavior of this method is to call addDateHeader(String name, long date) on the wrapped response object. Serialized.
        Specified by:
        addDateHeader in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        name - The name of the date header to add
        date - The value of the date expressed in seconds.
      • getDateHeaders

        public Map<String,​Set<Long>> getDateHeaders()
        The Map of set date headers. Serialized.
        Returns:
        The Map of date headers.
      • setHeader

        public void setHeader​(String name,
                              String value)
        The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object. Serialized.
        Specified by:
        setHeader in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        name - The name of the header
        value - The value of the header
      • addHeader

        public void addHeader​(String name,
                              String value)
        The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object. Serialized.
        Specified by:
        addHeader in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        name - The name of the header
        value - The value of the header
      • getHeaders

        public Map<String,​List<String>> getHeaders()
        The Map of the set headers. Serialized.
        Returns:
        Map of set headers.
      • setIntHeader

        public void setIntHeader​(String name,
                                 int value)
        The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object. Serialized.
        Specified by:
        setIntHeader in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        name - The name of the header
        value - The value of the header
      • addIntHeader

        public void addIntHeader​(String name,
                                 int value)
        The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object. Serialized.
        Specified by:
        addIntHeader in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        name - The name of the header
        value - The value of the header
      • setStatus

        public void setStatus​(int sc)
        The default behavior of this method is to call setStatus(int sc) on the wrapped response object. Not Serialized.
        Specified by:
        setStatus in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        sc - The status code of the response
      • setStatus

        public void setStatus​(int sc,
                              String sm)
        The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object. Not Serialized.
        Specified by:
        setStatus in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        sc - The status code of the response
      • getStatus

        public int getStatus()
        Specified by:
        getStatus in interface jakarta.servlet.http.HttpServletResponse
      • getHeader

        public String getHeader​(String s)
        Specified by:
        getHeader in interface jakarta.servlet.http.HttpServletResponse
      • getHeaders

        public Collection<String> getHeaders​(String s)
        Specified by:
        getHeaders in interface jakarta.servlet.http.HttpServletResponse
      • getHeaderNames

        public Collection<String> getHeaderNames()
        Specified by:
        getHeaderNames in interface jakarta.servlet.http.HttpServletResponse