org.apache.accumulo.server.security.handler
Class ZKPermHandler

java.lang.Object
  extended by org.apache.accumulo.server.security.handler.ZKPermHandler
All Implemented Interfaces:
PermissionHandler

public class ZKPermHandler
extends Object
implements PermissionHandler


Constructor Summary
ZKPermHandler()
           
 
Method Summary
 void cleanTablePermissions(String table)
          Cleans up the permissions for a table.
 void cleanUser(String user)
          Deletes a user
static PermissionHandler getInstance()
           
 void grantSystemPermission(String user, SystemPermission permission)
          Gives the user the given system permission
 void grantTablePermission(String user, String table, TablePermission permission)
          Gives the user the given table permission
 boolean hasCachedSystemPermission(String user, SystemPermission permission)
          Used to get the system permission for the user, with caching due to high frequency operation.
 boolean hasCachedTablePermission(String user, String table, TablePermission permission)
          Used to get the table permission of a user for a table, with caching.
 boolean hasSystemPermission(String user, SystemPermission permission)
          Used to get the system permission for the user
 boolean hasTablePermission(String user, String table, TablePermission permission)
          Used to get the table permission of a user for a table
 void initialize(String instanceId, boolean initialize)
          Sets up the permission handler for a new instance of Accumulo
 void initializeSecurity(TCredentials itw, String rootuser)
          Used to initialize security for the root user
 void initTable(String table)
          Initializes a new user
 void initUser(String user)
          Initializes a new user
 void revokeSystemPermission(String user, SystemPermission permission)
          Denies the user the given system permission
 void revokeTablePermission(String user, String table, TablePermission permission)
          Denies the user the given table permission.
 boolean validSecurityHandlers(Authenticator authent, Authorizor author)
          Used to validate that the Authorizor, Authenticator, and permission handler can coexist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZKPermHandler

public ZKPermHandler()
Method Detail

getInstance

public static PermissionHandler getInstance()

initialize

public void initialize(String instanceId,
                       boolean initialize)
Description copied from interface: PermissionHandler
Sets up the permission handler for a new instance of Accumulo

Specified by:
initialize in interface PermissionHandler

hasTablePermission

public boolean hasTablePermission(String user,
                                  String table,
                                  TablePermission permission)
                           throws TableNotFoundException
Description copied from interface: PermissionHandler
Used to get the table permission of a user for a table

Specified by:
hasTablePermission in interface PermissionHandler
Throws:
TableNotFoundException

hasCachedTablePermission

public boolean hasCachedTablePermission(String user,
                                        String table,
                                        TablePermission permission)
                                 throws AccumuloSecurityException,
                                        TableNotFoundException
Description copied from interface: PermissionHandler
Used to get the table permission of a user for a table, with caching. This method is for high frequency operations

Specified by:
hasCachedTablePermission in interface PermissionHandler
Throws:
AccumuloSecurityException
TableNotFoundException

grantSystemPermission

public void grantSystemPermission(String user,
                                  SystemPermission permission)
                           throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Gives the user the given system permission

Specified by:
grantSystemPermission in interface PermissionHandler
Throws:
AccumuloSecurityException

grantTablePermission

public void grantTablePermission(String user,
                                 String table,
                                 TablePermission permission)
                          throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Gives the user the given table permission

Specified by:
grantTablePermission in interface PermissionHandler
Throws:
AccumuloSecurityException

revokeSystemPermission

public void revokeSystemPermission(String user,
                                   SystemPermission permission)
                            throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Denies the user the given system permission

Specified by:
revokeSystemPermission in interface PermissionHandler
Throws:
AccumuloSecurityException

revokeTablePermission

public void revokeTablePermission(String user,
                                  String table,
                                  TablePermission permission)
                           throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Denies the user the given table permission.

Specified by:
revokeTablePermission in interface PermissionHandler
Throws:
AccumuloSecurityException

cleanTablePermissions

public void cleanTablePermissions(String table)
                           throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Cleans up the permissions for a table. Used when a table gets deleted.

Specified by:
cleanTablePermissions in interface PermissionHandler
Throws:
AccumuloSecurityException

initializeSecurity

public void initializeSecurity(TCredentials itw,
                               String rootuser)
                        throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Used to initialize security for the root user

Specified by:
initializeSecurity in interface PermissionHandler
Throws:
AccumuloSecurityException

initUser

public void initUser(String user)
              throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Initializes a new user

Specified by:
initUser in interface PermissionHandler
Parameters:
user -
Throws:
AccumuloSecurityException

cleanUser

public void cleanUser(String user)
               throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Deletes a user

Specified by:
cleanUser in interface PermissionHandler
Throws:
AccumuloSecurityException

hasSystemPermission

public boolean hasSystemPermission(String user,
                                   SystemPermission permission)
                            throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Used to get the system permission for the user

Specified by:
hasSystemPermission in interface PermissionHandler
Throws:
AccumuloSecurityException

hasCachedSystemPermission

public boolean hasCachedSystemPermission(String user,
                                         SystemPermission permission)
                                  throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Used to get the system permission for the user, with caching due to high frequency operation. NOTE: At this time, this method is unused but is included just in case we need it in the future.

Specified by:
hasCachedSystemPermission in interface PermissionHandler
Throws:
AccumuloSecurityException

validSecurityHandlers

public boolean validSecurityHandlers(Authenticator authent,
                                     Authorizor author)
Description copied from interface: PermissionHandler
Used to validate that the Authorizor, Authenticator, and permission handler can coexist

Specified by:
validSecurityHandlers in interface PermissionHandler

initTable

public void initTable(String table)
               throws AccumuloSecurityException
Description copied from interface: PermissionHandler
Initializes a new user

Specified by:
initTable in interface PermissionHandler
Throws:
AccumuloSecurityException


Copyright © 2013 Apache Accumulo Project. All Rights Reserved.