Class DelegationPermission


  • public class DelegationPermission
    extends Object
    The DelegationPermission class represents an access control permission on a resource in a realm. It consists of a realm name, a service name, a version number, a config type, a subconfig name, and a set of actions that a user with the permission can perform. Additionally it also contains a Map that can be used for future extensions.
    • Constructor Detail

      • DelegationPermission

        public DelegationPermission()
        Default constructor for DelegationPermission.
      • DelegationPermission

        public DelegationPermission​(String orgName,
                                    String serviceName,
                                    String version,
                                    String configType,
                                    String subConfigName,
                                    Set actions,
                                    Map extensions)
                             throws DelegationException
        Constructor for DelegationPermission. Constructs a delegation permission object with a realm name, a service name, a service version number, a config type, a subconfig name, a set of actions, and a Map for extensions.
        Parameters:
        orgName - The realm name in the delegation permission
        serviceName - The service name in the delegation permission
        version - The service version in the delegation permission
        configType - The config type in the delegation permission
        subConfigName - The subconfig name in the delegation permission
        actions - The action names in the delegation permission
        extensions - a placeholder for future extensions
        Throws:
        DelegationException - if unable to create the DelegationPermission object.
      • DelegationPermission

        public DelegationPermission​(String orgName,
                                    String serviceName,
                                    String version,
                                    String configType,
                                    String subConfigName,
                                    Set actions,
                                    Map extensions,
                                    org.forgerock.util.Function<String,​String,​org.forgerock.util.promise.NeverThrowsException> orgNameToDNFunc)
                             throws DelegationException
        Constructor for DelegationPermission. Constructs a delegation permission object with a realm name, a service name, a service version number, a config type, a subconfig name, a set of actions, and a Map for extensions.
        Parameters:
        orgName - The realm name in the delegation permission
        serviceName - The service name in the delegation permission
        version - The service version in the delegation permission
        configType - The config type in the delegation permission
        subConfigName - The subconfig name in the delegation permission
        actions - The action names in the delegation permission
        extensions - a placeholder for future extensions
        Throws:
        DelegationException - if unable to create the DelegationPermission object.
    • Method Detail

      • getOrganizationName

        public String getOrganizationName()
        Returns the realm name in the permission
        Returns:
        String representing the realm name in the permission
      • setOrganizationName

        public void setOrganizationName​(String name)
                                 throws DelegationException
        Sets the realm name in the permission
        Parameters:
        name - String representing the realm name in the DelegationPermission.
        Throws:
        DelegationException - if name is invalid
      • getServiceName

        public String getServiceName()
        Returns the service name in the permission
        Returns:
        String representing the service name in the DelegationPermission
      • setServiceName

        public void setServiceName​(String name)
                            throws DelegationException
        Sets the service name in the permission
        Parameters:
        name - The service name in the delegation permission
        Throws:
        DelegationException - if name is invalid
      • getVersion

        public String getVersion()
        Returns the service version in the permission
        Returns:
        the service version in the permission
      • setVersion

        public void setVersion​(String version)
                        throws DelegationException
        Sets the service version in the permission
        Parameters:
        version - The service version in the delegation permission
        Throws:
        DelegationException - if version is invalid
      • getConfigType

        public String getConfigType()
        Returns the config type in the permission
        Returns:
        the config type in the permission
      • setConfigType

        public void setConfigType​(String configType)
                           throws DelegationException
        Sets the config type in the permission
        Parameters:
        configType - The config type in the delegation permission
        Throws:
        DelegationException - if config type is invalid
      • getSubConfigName

        public String getSubConfigName()
        Returns the subconfig name in the permission
        Returns:
        the subconfig name in the permission
      • setSubConfigName

        public void setSubConfigName​(String name)
                              throws DelegationException
        Sets the subconfig name in the permission
        Parameters:
        name - The subconfig name in the delegation permission
        Throws:
        DelegationException - if subconfig name is invalid
      • getActions

        public Set getActions()
        Returns the action names in the permission
        Returns:
        the action names in the permission
      • setActions

        public void setActions​(Set actions)
                        throws DelegationException
        Sets the action names in the permission
        Parameters:
        actions - The action names in the delegation permission
        Throws:
        DelegationException - if an action name is invalid
      • getExtensions

        public Map getExtensions()
        Returns the extensions in the permission
        Returns:
        the extensions in the permission
      • setExtensions

        public void setExtensions​(Map extensions)
                           throws DelegationException
        Sets the extensions in the permission
        Parameters:
        extensions - The extensions in the delegation permission
        Throws:
        DelegationException - if some info in extensions is invalid
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Returns the String representation of this object.
        Overrides:
        toString in class Object
        Returns:
        the String representation of the DelegationPermission object.