org.apache.hadoop.hbase.security.access
Class UserPermission

java.lang.Object
  extended by org.apache.hadoop.io.VersionedWritable
      extended by org.apache.hadoop.hbase.security.access.Permission
          extended by org.apache.hadoop.hbase.security.access.TablePermission
              extended by org.apache.hadoop.hbase.security.access.UserPermission
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class UserPermission
extends TablePermission

Represents an authorization for access over the given table, column family plus qualifier, for the given user.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.security.access.Permission
Permission.Action
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.security.access.Permission
ACTION_BY_CODE, actions, VERSION
 
Constructor Summary
UserPermission()
          Nullary constructor for Writable, do not use
UserPermission(byte[] user, byte[] actionCodes)
          Creates a new instance for the given user, matching the actions with the given codes.
UserPermission(byte[] user, Permission.Action... assigned)
          Creates a new instance for the given user.
UserPermission(byte[] user, String namespace, byte[] actionCodes)
          Creates a new instance for the given user, matching the actions with the given codes.
UserPermission(byte[] user, String namespace, Permission.Action... assigned)
          Creates a new instance for the given user.
UserPermission(byte[] user, TableName table, byte[] family, byte[] qualifier, byte[] actionCodes)
          Creates a new instance for the given user, table, column family and qualifier, matching the actions with the given codes.
UserPermission(byte[] user, TableName table, byte[] family, byte[] qualifier, Permission.Action... assigned)
          Creates a new permission for the given user, table, column family and column qualifier.
UserPermission(byte[] user, TableName table, byte[] family, Permission.Action... assigned)
          Creates a new instance for the given user, table and column family.
UserPermission(byte[] user, TablePermission perm)
          Creates a new instance for the given user, table, column family and qualifier, matching the actions with the given codes.
 
Method Summary
 boolean equals(Object obj)
           
 byte[] getUser()
           
 int hashCode()
           
 boolean isGlobal()
          Returns true if this permission describes a global user permission.
 void readFields(DataInput in)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.hadoop.hbase.security.access.TablePermission
getFamily, getNamespace, getQualifier, getTableName, hasFamily, hasNamespace, hasQualifier, hasTable, implies, implies, implies, matchesFamily, matchesFamilyQualifier
 
Methods inherited from class org.apache.hadoop.hbase.security.access.Permission
getActions, getVersion, implies
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserPermission

public UserPermission()
Nullary constructor for Writable, do not use


UserPermission

public UserPermission(byte[] user,
                      Permission.Action... assigned)
Creates a new instance for the given user.

Parameters:
user - the user
assigned - the list of allowed actions

UserPermission

public UserPermission(byte[] user,
                      byte[] actionCodes)
Creates a new instance for the given user, matching the actions with the given codes.

Parameters:
user - the user
actionCodes - the list of allowed action codes

UserPermission

public UserPermission(byte[] user,
                      String namespace,
                      Permission.Action... assigned)
Creates a new instance for the given user.

Parameters:
user - the user
namespace -
assigned - the list of allowed actions

UserPermission

public UserPermission(byte[] user,
                      String namespace,
                      byte[] actionCodes)
Creates a new instance for the given user, matching the actions with the given codes.

Parameters:
user - the user
namespace -
actionCodes - the list of allowed action codes

UserPermission

public UserPermission(byte[] user,
                      TableName table,
                      byte[] family,
                      Permission.Action... assigned)
Creates a new instance for the given user, table and column family.

Parameters:
user - the user
table - the table
family - the family, can be null if action is allowed over the entire table
assigned - the list of allowed actions

UserPermission

public UserPermission(byte[] user,
                      TableName table,
                      byte[] family,
                      byte[] qualifier,
                      Permission.Action... assigned)
Creates a new permission for the given user, table, column family and column qualifier.

Parameters:
user - the user
table - the table
family - the family, can be null if action is allowed over the entire table
qualifier - the column qualifier, can be null if action is allowed over the entire column family
assigned - the list of allowed actions

UserPermission

public UserPermission(byte[] user,
                      TableName table,
                      byte[] family,
                      byte[] qualifier,
                      byte[] actionCodes)
Creates a new instance for the given user, table, column family and qualifier, matching the actions with the given codes.

Parameters:
user - the user
table - the table
family - the family, can be null if action is allowed over the entire table
qualifier - the column qualifier, can be null if action is allowed over the entire column family
actionCodes - the list of allowed action codes

UserPermission

public UserPermission(byte[] user,
                      TablePermission perm)
Creates a new instance for the given user, table, column family and qualifier, matching the actions with the given codes.

Parameters:
user - the user
perm - a TablePermission
Method Detail

getUser

public byte[] getUser()

isGlobal

public boolean isGlobal()
Returns true if this permission describes a global user permission.


equals

public boolean equals(Object obj)
Overrides:
equals in class TablePermission

hashCode

public int hashCode()
Overrides:
hashCode in class TablePermission

toString

public String toString()
Overrides:
toString in class TablePermission

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Overrides:
readFields in class TablePermission
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Overrides:
write in class TablePermission
Throws:
IOException


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.