Class Authorizer

    • Constructor Detail

      • Authorizer

        public Authorizer()
        Default constructor.
      • Authorizer

        public Authorizer​(java.lang.String identifier)
        Constructor.
        Parameters:
        identifier - The identifier unique within an application.
    • Method Detail

      • authorize

        protected abstract boolean authorize​(Request request,
                                             Response response)
        Attempts to authorize the request.
        Parameters:
        request - The request sent.
        response - The response to update.
        Returns:
        True if the authorization succeeded.
      • authorized

        protected int authorized​(Request request,
                                 Response response)
        Invoked upon successful authorization. Returns Filter.CONTINUE by default.
        Parameters:
        request - The request sent.
        response - The response to update.
        Returns:
        The filter continuation code.
      • getIdentifier

        public java.lang.String getIdentifier()
        Returns the identifier unique within an application.
        Returns:
        The identifier unique within an application.
      • setIdentifier

        public void setIdentifier​(java.lang.String identifier)
        Sets the identifier unique within an application.
        Parameters:
        identifier - The identifier unique within an application.
      • unauthorized

        protected int unauthorized​(Request request,
                                   Response response)
        Invoked upon failed authorization. Sets the status to Status.CLIENT_ERROR_FORBIDDEN and returns Filter.STOP by default.
        Parameters:
        request - The request sent.
        response - The response to update.
        Returns:
        The filter continuation code.