Class ResponseWrapper


  • class ResponseWrapper
    extends Response
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ResponseWrapper()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String body()
      returns the body
      void body​(java.lang.String body)
      Sets the body
      void cookie​(java.lang.String name, java.lang.String value)
      Adds not persistent cookie to the response.
      void cookie​(java.lang.String name, java.lang.String value, int maxAge)
      Adds cookie to the response.
      void cookie​(java.lang.String name, java.lang.String value, int maxAge, boolean secured)
      Adds cookie to the response.
      void cookie​(java.lang.String path, java.lang.String name, java.lang.String value, int maxAge, boolean secured)
      Adds cookie to the response.
      void cookie​(java.lang.String path, java.lang.String name, java.lang.String value, int maxAge, boolean secured, boolean httpOnly)
      Adds cookie to the response.
      void cookie​(java.lang.String domain, java.lang.String path, java.lang.String name, java.lang.String value, int maxAge, boolean secured, boolean httpOnly)
      Adds cookie to the response.
      (package private) static ResponseWrapper create()  
      boolean equals​(java.lang.Object obj)  
      (package private) Response getDelegate()  
      int hashCode()  
      void header​(java.lang.String header, java.lang.String value)
      Adds/Sets a response header
      (package private) boolean isRedirected()  
      javax.servlet.http.HttpServletResponse raw()  
      void redirect​(java.lang.String location)
      Trigger a browser redirect
      void redirect​(java.lang.String location, int httpStatusCode)
      Trigger a browser redirect with specific http 3XX status code.
      void removeCookie​(java.lang.String name)
      Removes the cookie.
      void removeCookie​(java.lang.String path, java.lang.String name)
      Removes the cookie with given path and name.
      void setDelegate​(Response delegate)  
      int status()
      Returns the status code
      void status​(int statusCode)
      Sets the status code for the
      java.lang.String toString()  
      java.lang.String type()
      Returns the content type
      void type​(java.lang.String contentType)
      Sets the content type for the response
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • redirected

        private boolean redirected
    • Constructor Detail

      • ResponseWrapper

        private ResponseWrapper()
    • Method Detail

      • setDelegate

        public void setDelegate​(Response delegate)
      • status

        public void status​(int statusCode)
        Description copied from class: Response
        Sets the status code for the
        Overrides:
        status in class Response
        Parameters:
        statusCode - the status code
      • status

        public int status()
        Description copied from class: Response
        Returns the status code
        Overrides:
        status in class Response
        Returns:
        the status code
      • body

        public void body​(java.lang.String body)
        Description copied from class: Response
        Sets the body
        Overrides:
        body in class Response
        Parameters:
        body - the body
      • body

        public java.lang.String body()
        Description copied from class: Response
        returns the body
        Overrides:
        body in class Response
        Returns:
        the body
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • raw

        public javax.servlet.http.HttpServletResponse raw()
        Overrides:
        raw in class Response
        Returns:
        the raw response object handed in by Jetty
      • redirect

        public void redirect​(java.lang.String location)
        Description copied from class: Response
        Trigger a browser redirect
        Overrides:
        redirect in class Response
        Parameters:
        location - Where to redirect
      • redirect

        public void redirect​(java.lang.String location,
                             int httpStatusCode)
        Description copied from class: Response
        Trigger a browser redirect with specific http 3XX status code.
        Overrides:
        redirect in class Response
        Parameters:
        location - Where to redirect permanently
        httpStatusCode - the http status code
      • isRedirected

        boolean isRedirected()
        Returns:
        true if redirected has been done
      • header

        public void header​(java.lang.String header,
                           java.lang.String value)
        Description copied from class: Response
        Adds/Sets a response header
        Overrides:
        header in class Response
        Parameters:
        header - the header
        value - the value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • type

        public void type​(java.lang.String contentType)
        Description copied from class: Response
        Sets the content type for the response
        Overrides:
        type in class Response
        Parameters:
        contentType - the content type
      • type

        public java.lang.String type()
        Description copied from class: Response
        Returns the content type
        Overrides:
        type in class Response
        Returns:
        the content type
      • cookie

        public void cookie​(java.lang.String name,
                           java.lang.String value)
        Description copied from class: Response
        Adds not persistent cookie to the response. Can be invoked multiple times to insert more than one cookie.
        Overrides:
        cookie in class Response
        Parameters:
        name - name of the cookie
        value - value of the cookie
      • cookie

        public void cookie​(java.lang.String name,
                           java.lang.String value,
                           int maxAge)
        Description copied from class: Response
        Adds cookie to the response. Can be invoked multiple times to insert more than one cookie.
        Overrides:
        cookie in class Response
        Parameters:
        name - name of the cookie
        value - value of the cookie
        maxAge - max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie)
      • cookie

        public void cookie​(java.lang.String name,
                           java.lang.String value,
                           int maxAge,
                           boolean secured)
        Description copied from class: Response
        Adds cookie to the response. Can be invoked multiple times to insert more than one cookie.
        Overrides:
        cookie in class Response
        Parameters:
        name - name of the cookie
        value - value of the cookie
        maxAge - max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie)
        secured - if true : cookie will be secured
      • cookie

        public void cookie​(java.lang.String path,
                           java.lang.String name,
                           java.lang.String value,
                           int maxAge,
                           boolean secured)
        Description copied from class: Response
        Adds cookie to the response. Can be invoked multiple times to insert more than one cookie.
        Overrides:
        cookie in class Response
        Parameters:
        path - path of the cookie
        name - name of the cookie
        value - value of the cookie
        maxAge - max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie)
        secured - if true : cookie will be secured
      • cookie

        public void cookie​(java.lang.String path,
                           java.lang.String name,
                           java.lang.String value,
                           int maxAge,
                           boolean secured,
                           boolean httpOnly)
        Description copied from class: Response
        Adds cookie to the response. Can be invoked multiple times to insert more than one cookie.
        Overrides:
        cookie in class Response
        Parameters:
        path - path of the cookie
        name - name of the cookie
        value - value of the cookie
        maxAge - max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie)
        secured - if true : cookie will be secured
        httpOnly - if true: cookie will be marked as http only
      • cookie

        public void cookie​(java.lang.String domain,
                           java.lang.String path,
                           java.lang.String name,
                           java.lang.String value,
                           int maxAge,
                           boolean secured,
                           boolean httpOnly)
        Description copied from class: Response
        Adds cookie to the response. Can be invoked multiple times to insert more than one cookie.
        Overrides:
        cookie in class Response
        Parameters:
        domain - domain of the cookie
        path - path of the cookie
        name - name of the cookie
        value - value of the cookie
        maxAge - max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie)
        secured - if true : cookie will be secured
        httpOnly - if true: cookie will be marked as http only
      • removeCookie

        public void removeCookie​(java.lang.String name)
        Description copied from class: Response
        Removes the cookie.
        Overrides:
        removeCookie in class Response
        Parameters:
        name - name of the cookie
      • removeCookie

        public void removeCookie​(java.lang.String path,
                                 java.lang.String name)
        Description copied from class: Response
        Removes the cookie with given path and name.
        Overrides:
        removeCookie in class Response
        Parameters:
        path - path of the cookie
        name - name of the cookie