Class AuthzToken

java.lang.Object
org.dogtagpki.server.authorization.AuthzToken
All Implemented Interfaces:
IAttrSet, Serializable

public class AuthzToken extends Object implements IAttrSet
Authorization token returned by Authorization Managers. Upon return, it contains the name of the authorization manager that create the AuthzToken, the plugin name of the authorization manager, time of authorization happened, name of the resource, type of operation performed on the resource.

Version:
$Revision$, $Date$
See Also:
  • Field Details

    • TOKEN_AUTHZMGR_IMPL_NAME

      public static final String TOKEN_AUTHZMGR_IMPL_NAME
      Plugin name of the authorization manager that created the AuthzToken as a string.
      See Also:
    • TOKEN_AUTHZMGR_INST_NAME

      public static final String TOKEN_AUTHZMGR_INST_NAME
      Name of the authorization manager that created the AuthzToken as a string.
      See Also:
    • TOKEN_AUTHZTIME

      public static final String TOKEN_AUTHZTIME
      Time of authorization as a java.util.Date
      See Also:
    • TOKEN_AUTHZ_RESOURCE

      public static final String TOKEN_AUTHZ_RESOURCE
      name of the resource
      See Also:
    • TOKEN_AUTHZ_OPERATION

      public static final String TOKEN_AUTHZ_OPERATION
      name of the operation
      See Also:
    • TOKEN_AUTHZ_STATUS

      public static final String TOKEN_AUTHZ_STATUS
      See Also:
    • AUTHZ_STATUS_SUCCESS

      public static final String AUTHZ_STATUS_SUCCESS
      Constant for the success status of the authorization evaluation.
      See Also:
  • Constructor Details

    • AuthzToken

      public AuthzToken(IAuthzManager authzMgr)
      Constructs an instance of a authorization token. The token by default contains the following attributes:
              "authzMgrInstName" - The authorization manager instance name.
              "authzMgrImplName" - The authorization manager plugin name.
              "authzTime" - The - The time of authorization.
       
      Parameters:
      authzMgr - The authorization manager that created this Token.
  • Method Details

    • get

      public Object get(String attrName)
      Get the value of an attribute in the AuthzToken
      Specified by:
      get in interface IAttrSet
      Parameters:
      attrName - The attribute name
      Returns:
      The value of attrName if any.
    • set

      public void set(String attrName, Object value)
      Used by an Authorization manager to set an attribute and value in the AuthzToken.
      Specified by:
      set in interface IAttrSet
      Parameters:
      attrName - The name of the attribute
      value - The value of the attribute to set.
    • delete

      public void delete(String attrName)
      Removes an attribute in the AuthzToken
      Specified by:
      delete in interface IAttrSet
      Parameters:
      attrName - The name of the attribute to remove.
    • getElements

      public Enumeration<String> getElements()
      Enumerate all attribute names in the AuthzToken.
      Specified by:
      getElements in interface IAttrSet
      Returns:
      Enumeration of all attribute names in this AuthzToken.
    • getVals

      public Enumeration<Object> getVals()
      Enumerate all attribute values in the AuthzToken.
      Returns:
      Enumeration of all attribute names in this AuthzToken.
    • getAuthzManagerInstName

      public String getAuthzManagerInstName()
      Gets the name of the authorization manager instance that created this token.
      Returns:
      The name of the authorization manager instance that created this token.
    • getAuthzManagerImplName

      public String getAuthzManagerImplName()
      Gets the plugin name of the authorization manager that created this token.
      Returns:
      The plugin name of the authorization manager that created this token.
    • getAuthzTime

      public Date getAuthzTime()
      Gets the time of authorization.
      Returns:
      The time of authorization