Class ACLEntryImpl

  • All Implemented Interfaces:
    Serializable, ACLEntry

    @Entity
    public class ACLEntryImpl
    extends Object
    implements ACLEntry, Serializable

    This class represents an entry in the Access Control List (ACL), and associates a permission to an identity. This implementation only stores permissions of type BitMaskPermission, and can also only check permissions of that type.

    Author:
    Stefan Guilhen
    See Also:
    Serialized Form
    • Constructor Detail

      • ACLEntryImpl

        public ACLEntryImpl​(BitMaskPermission permission,
                            Identity identity)

        Builds an instance of ACLEntryImpl with the specified permission and identity.

        Parameters:
        permission - the ACLPermission granted to the associated identity.
        identity - the Identity for which the permission is being granted.
      • ACLEntryImpl

        public ACLEntryImpl​(BitMaskPermission permission,
                            String identityOrRole)

        Builds an instance of ACLEntryImpl with the specified permission and identity/role name.

        Parameters:
        permission - the ACLPermission granted to the associated identity.
        identityOrRole - a String representing the identity or role name.
    • Method Detail

      • getACLEntryId

        public long getACLEntryId()

        Obtains the persistent id of this ACLEntryImpl.

        Returns:
        a long representing the persistent id this entry.
      • setAcl

        public void setAcl​(ACLImpl acl)
      • getIdentityOrRole

        public String getIdentityOrRole()
        Description copied from interface: ACLEntry

        Obtains the identity or role for which a permission has been assigned in this entry.

        Specified by:
        getIdentityOrRole in interface ACLEntry
        Returns:
        a String representing the identity or role name.
      • getIdentity

        public Identity getIdentity()
        Description copied from interface: ACLEntry

        Obtains the Identity for which a permission has been assigned in this entry.

        Specified by:
        getIdentity in interface ACLEntry
        Returns:
        a reference to the Identity contained in this entry.
      • getPermission

        public ACLPermission getPermission()
        Description copied from interface: ACLEntry

        Obtains the Permission object held by this entry.

        Specified by:
        getPermission in interface ACLEntry
        Returns:
        a reference to the Permission contained in this entry.
      • checkPermission

        public boolean checkPermission​(ACLPermission permission)
        Description copied from interface: ACLEntry

        Checks if the specified permission is part of the this entry's permission.

        Specified by:
        checkPermission in interface ACLEntry
        Parameters:
        permission - the ACLPermission to be checked for.
        Returns:
        true if the permission is part of this entry's permission; false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object