Class AclActions

  • All Implemented Interfaces:
    java.io.Serializable

    @NotThreadSafe
    public final class AclActions
    extends java.lang.Object
    implements java.io.Serializable
    Permitted actions of an entry in AccessControlList.
    See Also:
    Serialized Form
    • Constructor Detail

      • AclActions

        public AclActions()
        Creates a new instance where no action is permitted.
      • AclActions

        public AclActions​(AclActions actions)
        Creates a copy of actions.
        Parameters:
        actions - the actions to be copied from
      • AclActions

        public AclActions​(java.util.Set<AclAction> actions)
        Creats a new instance with initial permitted actions.
        Parameters:
        actions - the initial setEntry of permitted actions which is copied from
    • Method Detail

      • getActions

        public java.util.Set<AclAction> getActions()
        Returns:
        an immutable copy of permitted actions
      • updateByModeBits

        public void updateByModeBits​(Mode.Bits bits)
        Updates permitted actions based on the mode bits. For example, if bits imply READ, then READ is added to permitted actions, otherwise, READ is removed from permitted actions. Same logic applies to WRITE and EXECUTE.
        Parameters:
        bits - the mode bits
      • add

        public void add​(AclAction action)
        Adds a permitted action.
        Parameters:
        action - the permitted action
      • merge

        public void merge​(AclActions actions)
        Merges the actions. (Or operation)
        Parameters:
        actions - the actions to be merged from
      • mask

        public void mask​(AclActions actions)
        Mask the actions. (And operation)
        Parameters:
        actions - the acl mask
      • contains

        public boolean contains​(AclAction action)
        Parameters:
        action - the action to be checked
        Returns:
        whether the action is contained in the permitted actions
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toCliString

        public java.lang.String toCliString()
        Returns:
        the string representation for the CLI
      • toModeBits

        public Mode.Bits toModeBits()
        Returns:
        the representation of the permitted actions in the format of Mode.Bits