Interface IServerBridgeResponse


  • public interface IServerBridgeResponse
    • Method Detail

      • setStatus

        void setStatus​(int p_iStatus)
        Set the HTTP status and message.
        Parameters:
        p_iStatus - The HTTP status code.
      • getStatus

        int getStatus()
        Get the HTTP status.
        Returns:
        The HTTP status.
      • sendError

        void sendError​(int p_iStatus)
                throws IOException
        Sends an error response to the client using the specified HTTP status code and clears the output buffer.
        Parameters:
        p_iStatus - The HTTP status code.
        Throws:
        IOException - If an I/O error occurs.
        See Also:
        HttpServletResponse.sendError(int)
      • sendError

        void sendError​(int p_iStatus,
                       String p_strMsg)
                throws IOException
        Sends an error response to the client using the specified HTTP status code and clears the output buffer.

        For more information see HttpServletResponse.sendError(int, String)

        Parameters:
        p_iStatus - The HTTP status code.
        p_strMsg - The message to be be included in the error page.
        Throws:
        IOException - If an I/O error occurs.
        See Also:
        HttpServletResponse.sendError(int, String)
      • sendRedirect

        void sendRedirect​(String p_strLocation)
                   throws IOException
        Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the servlet container must convert the relative URL to an absolute URL before sending the response to the client. If the location is relative without a leading '/' the container interprets it as relative to the current request URI. If the location is relative with a leading '/' the container interprets it as relative to the servlet container root.
        Parameters:
        p_strLocation - The redirect location URL.
        Throws:
        IOException - If an I/O error occurred.
        IllegalStateException - If the response was committed or if a partial URL is given and cannot be converted into a valid URL
      • isCommitted

        boolean isCommitted()
        Returns a boolean indicating if the response has been committed. A committed response has already had its status code and headers written.
        Returns:
        A boolean indicating if the response has been committed.
        See Also:
        resetBuffer(), reset()
      • resetBuffer

        void resetBuffer()
        Clears the content of the underlying buffer in the response without clearing headers or status code. If the response has been committed, this method throws an IllegalStateException.
        Throws:
        IllegalStateException - If the response has already been committed.
        See Also:
        isCommitted()
      • reset

        void reset()
        Clears any data that exists in the response buffer as well as the status code and headers. Possibly set ignore-write flags on output streams are also reset to false.

        If the response has been committed, this method throws an IllegalStateException.

        Throws:
        IllegalStateException - If the response has already been committed.
        See Also:
        isCommitted()
      • setHeaderValue

        void setHeaderValue​(String p_strKey,
                            String p_strValue)
        Set one name-value pair into the header map.
        Parameters:
        p_strKey - The header key.
        p_strValue - The header value.
      • getHeaderValue

        String getHeaderValue​(String p_strKey)
        Get a header info value to a specified key.
        Parameters:
        p_strKey - The header info key.
        Returns:
        The header value.
      • getHeaderValueMap

        Map<String,​String> getHeaderValueMap()
        Get an unmodifiable reference to the internal header map.

        Note: This method is for internal use only. It must not be used in scripts.

        Returns:
        An unmodifiable header map.
      • addCookie

        void addCookie​(de.uplanet.net.http.ICookie p_cookie)
        Add a cookie to the response or replace a cookie in the response.

        An already existing cookie is being replaced if it is considered equal according to RFC 2965, 3.3.3, ie.

        • it comes from same domain (case-insensitive),
        • has the same name (case-insensitive),
        • and has the same path (case-sensitive).

        Parameters:
        p_cookie - The cookie to be added.
      • getCookieList

        List<de.uplanet.net.http.ICookie> getCookieList()
        Get a reference to the internal cookie list.

        Note: This method is for internal use only. It must not be used in scripts.

        Returns:
        The cookie list.
      • getWriter

        Writer getWriter()
                  throws IOException
        Get a writer to the underlying output stream with the given charset.
        Returns:
        The writer.
        Throws:
        IOException
      • setCharacterEncoding

        void setCharacterEncoding​(String p_strCharsetName)
        Sets the character encoding of the response being sent to the client.
        Parameters:
        p_strCharsetName - The name of the character encoding to be set.
      • getCharacterEncoding

        String getCharacterEncoding()
        Returns the name of the character encoding used for the body sent in this response.
        Returns:
        The name of the character encoding