Class DelegationPrivilege


  • public class DelegationPrivilege
    extends Object
    The DelegationPrivilege class represents an access control policy on a set of resources in a realm. It consists of a name, a set of DelegationPermission, and a set of subjects. The name is the name of the privilege. The DelegationPermission defines the resource to which the delegation privilege applies to. The subject set defines to whom the delegation privilege applies.
    • Constructor Detail

      • DelegationPrivilege

        public DelegationPrivilege​(String name,
                                   Set permissions,
                                   Set subjects)
                            throws DelegationException
        Constructor for DelegationPrivilege. Constructs a delegation privilege object with a name, a set of DelegationPermission, and a set of subjects.
        Parameters:
        name - The name of the privilege
        permissions - The set of DelegationPermission that the privilege contains.
        subjects - The set of subjects that the privilege applies to
        Throws:
        DelegationException - if any input value is incorrect.
      • DelegationPrivilege

        public DelegationPrivilege​(String name,
                                   Set subjects,
                                   String orgName)
                            throws DelegationException
        Constructor for DelegationPrivilege.
        Parameters:
        name - The name of the privilege
        subjects - The set of subjects the privilege applies to
        orgName - The name of the realm where the privilege is defined
        Throws:
        DelegationException - if unable to create DelegationPrivilege instance.
    • Method Detail

      • getName

        public String getName()
        Returns the privilege name in the privilege
        Returns:
        the privilege name in the privilege
      • setName

        public void setName​(String name)
                     throws DelegationException
        Sets the privilege name in the privilege
        Parameters:
        name - The privilege name in the delegation privilege
        Throws:
        DelegationException - if name already exists in the realm
      • getPermissions

        public Set getPermissions()
        Returns the DelegationPermissions in the privilege
        Returns:
        the DelegationPermissions in the privilege
      • setPermissions

        public void setPermissions​(Set permissions)
                            throws DelegationException
        Sets the DelegationPermissions in the privilege
        Parameters:
        permissions - The DelegationPermissions in the delegation privilege
        Throws:
        DelegationException - if unable to set DelegationPermission
      • getSubjects

        public Set getSubjects()
        Returns the subjects in the privilege
        Returns:
        the subjects in the privilege
      • setSubjects

        public void setSubjects​(Set names)
                         throws DelegationException
        Sets the subject names in the privilege
        Parameters:
        names - The subject names in the delegation privilege
        Throws:
        DelegationException - if unable to set subjects
      • toString

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