accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject [3/3] git commit: Merge branch '1.6.0-SNAPSHOT'
Date Thu, 06 Mar 2014 20:06:26 GMT
Merge branch '1.6.0-SNAPSHOT'

Conflicts:
	core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6ba354d2
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6ba354d2
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6ba354d2

Branch: refs/heads/master
Commit: 6ba354d25a008be58cd415afbd071a4ad865780f
Parents: 384bc84 68afb1e
Author: John Vines <vines@apache.org>
Authored: Thu Mar 6 15:05:41 2014 -0500
Committer: John Vines <vines@apache.org>
Committed: Thu Mar 6 15:05:41 2014 -0500

----------------------------------------------------------------------
 .../client/admin/SecurityOperationsImpl.java    |  57 +++++++----
 .../server/client/ClientServiceHandler.java     |  19 ++--
 .../accumulo/master/FateServiceHandler.java     |  12 +--
 .../master/MasterClientServiceHandler.java      |   4 +-
 .../org/apache/accumulo/test/NamespacesIT.java  | 100 ++++++++++++++++++-
 5 files changed, 153 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/6ba354d2/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java
index f97e2b6,9d662f4..20c3768
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java
@@@ -208,15 -202,20 +208,22 @@@ public class SecurityOperationsImpl imp
  
    @Override
    public boolean hasTablePermission(final String principal, final String table, final TablePermission
perm) throws AccumuloException, AccumuloSecurityException {
 -    ArgumentChecker.notNull(principal, table, perm);
 +    checkArgument(principal != null, "principal is null");
 +    checkArgument(table != null, "table is null");
 +    checkArgument(perm != null, "perm is null");
-     return execute(new ClientExecReturn<Boolean,ClientService.Client>() {
-       @Override
-       public Boolean execute(ClientService.Client client) throws Exception {
-         return client.hasTablePermission(Tracer.traceInfo(), credentials.toThrift(instance),
principal, table, perm.getId());
-       }
-     });
+     try {
+       return execute(new ClientExecReturn<Boolean,ClientService.Client>() {
+         @Override
+         public Boolean execute(ClientService.Client client) throws Exception {
+           return client.hasTablePermission(Tracer.traceInfo(), credentials.toThrift(instance),
principal, table, perm.getId());
+         }
+       });
+     } catch (AccumuloSecurityException e) {
+       if (e.getSecurityErrorCode() == org.apache.accumulo.core.client.security.SecurityErrorCode.NAMESPACE_DOESNT_EXIST)
+         throw new AccumuloSecurityException(null, SecurityErrorCode.TABLE_DOESNT_EXIST,
e);
+       else
+         throw e;
+     }
    }
  
    @Override
@@@ -248,15 -244,20 +255,22 @@@
    @Override
    public void grantTablePermission(final String principal, final String table, final TablePermission
permission) throws AccumuloException,
        AccumuloSecurityException {
 -    ArgumentChecker.notNull(principal, table, permission);
 +    checkArgument(principal != null, "principal is null");
 +    checkArgument(table != null, "table is null");
 +    checkArgument(permission != null, "permission is null");
-     execute(new ClientExec<ClientService.Client>() {
-       @Override
-       public void execute(ClientService.Client client) throws Exception {
-         client.grantTablePermission(Tracer.traceInfo(), credentials.toThrift(instance),
principal, table, permission.getId());
-       }
-     });
+     try {
+       execute(new ClientExec<ClientService.Client>() {
+         @Override
+         public void execute(ClientService.Client client) throws Exception {
+           client.grantTablePermission(Tracer.traceInfo(), credentials.toThrift(instance),
principal, table, permission.getId());
+         }
+       });
+     } catch (AccumuloSecurityException e) {
+       if (e.getSecurityErrorCode() == org.apache.accumulo.core.client.security.SecurityErrorCode.NAMESPACE_DOESNT_EXIST)
+         throw new AccumuloSecurityException(null, SecurityErrorCode.TABLE_DOESNT_EXIST,
e);
+       else
+         throw e;
+     }
    }
  
    @Override
@@@ -288,15 -286,20 +302,22 @@@
    @Override
    public void revokeTablePermission(final String principal, final String table, final TablePermission
permission) throws AccumuloException,
        AccumuloSecurityException {
 -    ArgumentChecker.notNull(principal, table, permission);
 +    checkArgument(principal != null, "principal is null");
 +    checkArgument(table != null, "table is null");
 +    checkArgument(permission != null, "permission is null");
-     execute(new ClientExec<ClientService.Client>() {
-       @Override
-       public void execute(ClientService.Client client) throws Exception {
-         client.revokeTablePermission(Tracer.traceInfo(), credentials.toThrift(instance),
principal, table, permission.getId());
-       }
-     });
+     try {
+       execute(new ClientExec<ClientService.Client>() {
+         @Override
+         public void execute(ClientService.Client client) throws Exception {
+           client.revokeTablePermission(Tracer.traceInfo(), credentials.toThrift(instance),
principal, table, permission.getId());
+         }
+       });
+     } catch (AccumuloSecurityException e) {
+       if (e.getSecurityErrorCode() == org.apache.accumulo.core.client.security.SecurityErrorCode.NAMESPACE_DOESNT_EXIST)
+         throw new AccumuloSecurityException(null, SecurityErrorCode.TABLE_DOESNT_EXIST,
e);
+       else
+         throw e;
+     }
    }
  
    @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6ba354d2/server/master/src/main/java/org/apache/accumulo/master/FateServiceHandler.java
----------------------------------------------------------------------


Mime
View raw message