org.apache.accumulo.core.client.mock
Class MockSecurityOperations

java.lang.Object
  extended by org.apache.accumulo.core.client.admin.SecurityOperations
      extended by org.apache.accumulo.core.client.mock.MockSecurityOperations

public class MockSecurityOperations
extends SecurityOperations


Method Summary
 boolean authenticateUser(java.lang.String name, byte[] password)
          Verify a username/password combination is valid
 void changeUserAuthorizations(java.lang.String name, Authorizations authorizations)
          Set the user's record-level authorizations
 void changeUserPassword(java.lang.String name, byte[] password)
          Set the user's password
 void createUser(java.lang.String user, byte[] password, Authorizations authorizations)
          Create a user
 void dropUser(java.lang.String user)
          Delete a user
 Authorizations getUserAuthorizations(java.lang.String name)
          Retrieves the user's authorizations for scanning
 void grantSystemPermission(java.lang.String name, SystemPermission permission)
          Grant a user a system permission
 void grantTablePermission(java.lang.String name, java.lang.String tableName, TablePermission permission)
          Grant a user a specific permission for a specific table
 boolean hasSystemPermission(java.lang.String name, SystemPermission perm)
          Verify the user has a particular system permission
 boolean hasTablePermission(java.lang.String name, java.lang.String tableName, TablePermission perm)
          Verify the user has a particular table permission
 java.util.Set<java.lang.String> listUsers()
          Return a list of users in accumulo
 void revokeSystemPermission(java.lang.String name, SystemPermission permission)
          Revoke a system permission from a user
 void revokeTablePermission(java.lang.String name, java.lang.String tableName, TablePermission permission)
          Revoke a table permission for a specific user on a specific table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createUser

public void createUser(java.lang.String user,
                       byte[] password,
                       Authorizations authorizations)
                throws AccumuloException,
                       AccumuloSecurityException
Description copied from class: SecurityOperations
Create a user

Overrides:
createUser in class SecurityOperations
Parameters:
user - the name of the user to create
password - the plaintext password for the user
authorizations - the authorizations that the user has for scanning
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to create a user

dropUser

public void dropUser(java.lang.String user)
              throws AccumuloException,
                     AccumuloSecurityException
Description copied from class: SecurityOperations
Delete a user

Overrides:
dropUser in class SecurityOperations
Parameters:
user - the user name to delete
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to delete a user

authenticateUser

public boolean authenticateUser(java.lang.String name,
                                byte[] password)
                         throws AccumuloException,
                                AccumuloSecurityException
Description copied from class: SecurityOperations
Verify a username/password combination is valid

Overrides:
authenticateUser in class SecurityOperations
Parameters:
name - the name of the user to authenticate
password - the plaintext password for the user
Returns:
true if the user asking is allowed to know and the specified user/password is valid, false otherwise
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to ask

changeUserPassword

public void changeUserPassword(java.lang.String name,
                               byte[] password)
                        throws AccumuloException,
                               AccumuloSecurityException
Description copied from class: SecurityOperations
Set the user's password

Overrides:
changeUserPassword in class SecurityOperations
Parameters:
name - the name of the user to modify
password - the plaintext password for the user
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to modify a user

changeUserAuthorizations

public void changeUserAuthorizations(java.lang.String name,
                                     Authorizations authorizations)
                              throws AccumuloException,
                                     AccumuloSecurityException
Description copied from class: SecurityOperations
Set the user's record-level authorizations

Overrides:
changeUserAuthorizations in class SecurityOperations
Parameters:
name - the name of the user to modify
authorizations - the authorizations that the user has for scanning
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to modify a user

getUserAuthorizations

public Authorizations getUserAuthorizations(java.lang.String name)
                                     throws AccumuloException,
                                            AccumuloSecurityException
Description copied from class: SecurityOperations
Retrieves the user's authorizations for scanning

Overrides:
getUserAuthorizations in class SecurityOperations
Parameters:
name - the name of the user to query
Returns:
the set of authorizations the user has available for scanning
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to query a user

hasSystemPermission

public boolean hasSystemPermission(java.lang.String name,
                                   SystemPermission perm)
                            throws AccumuloException,
                                   AccumuloSecurityException
Description copied from class: SecurityOperations
Verify the user has a particular system permission

Overrides:
hasSystemPermission in class SecurityOperations
Parameters:
name - the name of the user to query
perm - the system permission to check for
Returns:
true if user has that permission; false otherwise
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to query a user

hasTablePermission

public boolean hasTablePermission(java.lang.String name,
                                  java.lang.String tableName,
                                  TablePermission perm)
                           throws AccumuloException,
                                  AccumuloSecurityException
Description copied from class: SecurityOperations
Verify the user has a particular table permission

Overrides:
hasTablePermission in class SecurityOperations
Parameters:
name - the name of the user to query
tableName - the name of the table to query about
perm - the table permission to check for
Returns:
true if user has that permission; false otherwise
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to query a user

grantSystemPermission

public void grantSystemPermission(java.lang.String name,
                                  SystemPermission permission)
                           throws AccumuloException,
                                  AccumuloSecurityException
Description copied from class: SecurityOperations
Grant a user a system permission

Overrides:
grantSystemPermission in class SecurityOperations
Parameters:
name - the name of the user to modify
permission - the system permission to grant to the user
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to grant a user permissions

grantTablePermission

public void grantTablePermission(java.lang.String name,
                                 java.lang.String tableName,
                                 TablePermission permission)
                          throws AccumuloException,
                                 AccumuloSecurityException
Description copied from class: SecurityOperations
Grant a user a specific permission for a specific table

Overrides:
grantTablePermission in class SecurityOperations
Parameters:
name - the name of the user to modify
tableName - the name of the table to modify for the user
permission - the table permission to grant to the user
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to grant a user permissions

revokeSystemPermission

public void revokeSystemPermission(java.lang.String name,
                                   SystemPermission permission)
                            throws AccumuloException,
                                   AccumuloSecurityException
Description copied from class: SecurityOperations
Revoke a system permission from a user

Overrides:
revokeSystemPermission in class SecurityOperations
Parameters:
name - the name of the user to modify
permission - the system permission to revoke for the user
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to revoke a user's permissions

revokeTablePermission

public void revokeTablePermission(java.lang.String name,
                                  java.lang.String tableName,
                                  TablePermission permission)
                           throws AccumuloException,
                                  AccumuloSecurityException
Description copied from class: SecurityOperations
Revoke a table permission for a specific user on a specific table

Overrides:
revokeTablePermission in class SecurityOperations
Parameters:
name - the name of the user to modify
tableName - the name of the table to modify for the user
permission - the table permission to revoke for the user
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to revoke a user's permissions

listUsers

public java.util.Set<java.lang.String> listUsers()
                                          throws AccumuloException,
                                                 AccumuloSecurityException
Description copied from class: SecurityOperations
Return a list of users in accumulo

Overrides:
listUsers in class SecurityOperations
Returns:
a set of user names
Throws:
AccumuloException - if a general error occurs
AccumuloSecurityException - if the user does not have permission to query users


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