Package alluxio.security.authorization
Class Mode
- java.lang.Object
-
- alluxio.security.authorization.Mode
-
@PublicApi @NotThreadSafe public final class Mode extends java.lang.Object
POSIX style file/directory access mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Mode.Bits
Mode bits.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Mode
and(Mode mode1, Mode mode2)
static Mode
createFullAccess()
Creates the "full access" mode.static Mode
createNoAccess()
Creates the "no access" mode.static Mode
defaults()
Gets the default mode.boolean
equals(java.lang.Object obj)
static Mode.Bits
extractGroupBits(short mode)
static Mode.Bits
extractOtherBits(short mode)
static Mode.Bits
extractOwnerBits(short mode)
static Mode
fromProto(alluxio.grpc.PMode pMode)
CreatesMode
from protoPMode
.void
fromShort(short n)
SetsMode
bits using a digital representation.Mode.Bits
getGroupBits()
Mode.Bits
getOtherBits()
Mode.Bits
getOwnerBits()
int
hashCode()
void
setGroupBits(Mode.Bits bits)
Sets group bits.void
setOtherBits(Mode.Bits bits)
Sets other bits.void
setOwnerBits(Mode.Bits bits)
Sets owner bits.alluxio.grpc.PMode
toProto()
short
toShort()
Encodes the object as a short.java.lang.String
toString()
-
-
-
Method Detail
-
createNoAccess
public static Mode createNoAccess()
Creates the "no access" mode.- Returns:
- the none
Mode
-
createFullAccess
public static Mode createFullAccess()
Creates the "full access" mode.- Returns:
- the none
Mode
-
and
public static Mode and(Mode mode1, Mode mode2)
- Parameters:
mode1
- first mode of the and operationmode2
- second mode of the and operation- Returns:
- the AND result of the two Modes
-
extractOwnerBits
public static Mode.Bits extractOwnerBits(short mode)
-
setOwnerBits
public void setOwnerBits(Mode.Bits bits)
Sets owner bits.- Parameters:
bits
- the owner bits to set
-
extractGroupBits
public static Mode.Bits extractGroupBits(short mode)
-
setGroupBits
public void setGroupBits(Mode.Bits bits)
Sets group bits.- Parameters:
bits
- the group bits to set
-
extractOtherBits
public static Mode.Bits extractOtherBits(short mode)
-
setOtherBits
public void setOtherBits(Mode.Bits bits)
Sets other bits.- Parameters:
bits
- the other bits to set
-
fromShort
public void fromShort(short n)
SetsMode
bits using a digital representation.- Parameters:
n
- the digital representation of aMode
-
toShort
public short toShort()
Encodes the object as a short.- Returns:
- the digital representation of this
Mode
-
equals
public boolean equals(java.lang.Object obj)
- 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
-
fromProto
public static Mode fromProto(alluxio.grpc.PMode pMode)
CreatesMode
from protoPMode
.- Parameters:
pMode
- proto mode- Returns:
- created mode
-
toProto
public alluxio.grpc.PMode toProto()
- Returns:
- proto representation of this mode instance
-
-