Package alluxio.security.authorization
Class AclActions
- java.lang.Object
-
- alluxio.security.authorization.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 inAccessControlList
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AclActions()
Creates a new instance where no action is permitted.AclActions(AclActions actions)
Creates a copy of actions.AclActions(java.util.Set<AclAction> actions)
Creats a new instance with initial permitted actions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(AclAction action)
Adds a permitted action.boolean
contains(AclAction action)
boolean
equals(java.lang.Object o)
java.util.Set<AclAction>
getActions()
int
hashCode()
void
mask(AclActions actions)
Mask the actions.void
merge(AclActions actions)
Merges the actions.java.lang.String
toCliString()
Mode.Bits
toModeBits()
java.lang.String
toString()
void
updateByModeBits(Mode.Bits bits)
Updates permitted actions based on the mode bits.
-
-
-
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 classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toCliString
public java.lang.String toCliString()
- Returns:
- the string representation for the CLI
-
-