.. java:import:: io.netty.buffer ByteBuf .. java:import:: io.netty.handler.codec.http DefaultFullHttpRequest .. java:import:: io.aalam.common.router RouteMatch .. java:import:: java.util Map .. java:import:: java.util List .. java:import:: java.lang String .. java:import:: java.util HashSet HttpRequest =========== .. java:package:: io.aalam.common :noindex: .. java:type:: public class HttpRequest extends DefaultFullHttpRequest Class to access the request details. This class inherits from netty's DefaultFullHttpRequest **See also:** :java:ref:`DefaultFullHttpRequest` Fields ------ auth ^^^^ .. java:field:: Auth auth :outertype: HttpRequest dbSession ^^^^^^^^^ .. java:field:: int dbSession :outertype: HttpRequest params ^^^^^^ .. java:field:: Map> params :outertype: HttpRequest path ^^^^ .. java:field:: String path :outertype: HttpRequest routeMatch ^^^^^^^^^^ .. java:field:: RouteMatch routeMatch :outertype: HttpRequest staticFileName ^^^^^^^^^^^^^^ .. java:field:: String staticFileName :outertype: HttpRequest staticUrlResource ^^^^^^^^^^^^^^^^^ .. java:field:: String staticUrlResource :outertype: HttpRequest userPermissions ^^^^^^^^^^^^^^^ .. java:field:: HashSet userPermissions :outertype: HttpRequest Constructors ------------ HttpRequest ^^^^^^^^^^^ .. java:constructor:: public HttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, ByteBuf content) :outertype: HttpRequest Application code will not have any use with the constructors as the application code will always process on an initialized request object. HttpRequest ^^^^^^^^^^^ .. java:constructor:: public HttpRequest(FullHttpRequest req) :outertype: HttpRequest Methods ------- auth ^^^^ .. java:method:: public Auth auth() :outertype: HttpRequest Returns the auth object of this request. getStaticFile ^^^^^^^^^^^^^ .. java:method:: public String getStaticFile() :outertype: HttpRequest Get the static file set in this request :return: The resource's absolute file path getStaticUrlResource ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public String getStaticUrlResource() :outertype: HttpRequest Get the static resource set in this request :return: The resource name methodName ^^^^^^^^^^ .. java:method:: public String methodName() :outertype: HttpRequest Get the HTTP method :return: String name of the method params ^^^^^^ .. java:method:: public Map> params() :outertype: HttpRequest Returns the URL parameters. :return: Map of string to list of strings - with the key being the parameter name and value being the parameter value. path ^^^^ .. java:method:: public String path() :outertype: HttpRequest Returns the URL path, example, for url GET /aalam/base/users?param1=value¶m2=value, the path will be /aalam/base/users :return: String value of the path routeMatch ^^^^^^^^^^ .. java:method:: public RouteMatch routeMatch() :outertype: HttpRequest Application will have no use with this method. this method will be used by the framework internally. setAnonymousAuth ^^^^^^^^^^^^^^^^ .. java:method:: public void setAnonymousAuth() :outertype: HttpRequest This method will be used by the framework internally. setCookieAuth ^^^^^^^^^^^^^ .. java:method:: public void setCookieAuth(String email, Integer userId) :outertype: HttpRequest This method will be used by the framework internally. setCookieAuth ^^^^^^^^^^^^^ .. java:method:: public void setCookieAuth(String email) :outertype: HttpRequest This method will be used by the framework internally. setExternalAuth ^^^^^^^^^^^^^^^ .. java:method:: public void setExternalAuth(String from) :outertype: HttpRequest This method will be used by the framework internally. setExternalAuth ^^^^^^^^^^^^^^^ .. java:method:: public void setExternalAuth(String from, String userEmail, Integer id) :outertype: HttpRequest This method will be used by the framework internally. setInternalAuth ^^^^^^^^^^^^^^^ .. java:method:: public void setInternalAuth(String from, String userEmail) :outertype: HttpRequest This method will be used by the framework internally. setRouteMatch ^^^^^^^^^^^^^ .. java:method:: public void setRouteMatch(RouteMatch obj) :outertype: HttpRequest Application will have no use with this method. this method will be used by the framework internally. setStaticInfo ^^^^^^^^^^^^^ .. java:method:: public void setStaticInfo(String resource, String file) :outertype: HttpRequest Though applications can pre-inform the static URL and the way to access the static data through build plugin, there might be some situation which would want to send a static file on a non-static URL. For example, if an application has a static-url prefix as `/aalam/base/s/`. Suppose the application wants to serve a static file in a URL that does not have a prefix `/aalam/base/s/`, or if the file is not on the usual place that the framework can find, it can inform the framework about this static resource through this method This method needs to be called in the action handler. By doing so, the framework will take care of sending the response. :param resource: A unique name of this resource. This name should not clash with any of the other static resources. :param file: The path to the resource setTokenAuth ^^^^^^^^^^^^ .. java:method:: public void setTokenAuth(String appId) :outertype: HttpRequest This method will be used by the framework internally. setUserPermissions ^^^^^^^^^^^^^^^^^^ .. java:method:: public void setUserPermissions(HashSet permissions) :outertype: HttpRequest Application will have no use with this method. this method will be used by the framework internally. userPermissions ^^^^^^^^^^^^^^^ .. java:method:: public HashSet userPermissions() :outertype: HttpRequest Get the permissions of the user initiating this request :return: Set of permission ids.