Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC8A3109A2 for ; Wed, 4 Dec 2013 23:57:56 +0000 (UTC) Received: (qmail 41187 invoked by uid 500); 4 Dec 2013 23:57:56 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 40951 invoked by uid 500); 4 Dec 2013 23:57:56 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 40818 invoked by uid 99); 4 Dec 2013 23:57:55 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 23:57:55 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AABAF3202B7; Wed, 4 Dec 2013 23:57:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctubbsii@apache.org To: commits@accumulo.apache.org Date: Wed, 04 Dec 2013 23:58:21 -0000 Message-Id: <1dd326f7a530470894256e7a0ce8a6eb@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [29/50] [abbrv] git commit: ACCUMULO-802 Fix exception handling in RPC call for config ACCUMULO-802 Fix exception handling in RPC call for config Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ab50556c Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ab50556c Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ab50556c Branch: refs/heads/1.6.0-SNAPSHOT Commit: ab50556c6b8017df0e11d9dfd3592aab273dfbb1 Parents: 71bed4d Author: Christopher Tubbs Authored: Thu Nov 14 16:22:28 2013 -0500 Committer: Christopher Tubbs Committed: Wed Dec 4 18:46:11 2013 -0500 ---------------------------------------------------------------------- .../server/client/ClientServiceHandler.java | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/ab50556c/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java b/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java index 3148a3d..1deaa04 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java +++ b/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java @@ -52,8 +52,8 @@ import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.Credentials; import org.apache.accumulo.core.security.SystemPermission; -import org.apache.accumulo.core.security.TablePermission; import org.apache.accumulo.core.security.TableNamespacePermission; +import org.apache.accumulo.core.security.TablePermission; import org.apache.accumulo.core.security.thrift.TCredentials; import org.apache.accumulo.server.conf.ServerConfiguration; import org.apache.accumulo.server.fs.VolumeManager; @@ -186,12 +186,12 @@ public class ClientServiceHandler implements ClientService.Iface { } @Override - public void grantTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte permission) throws ThriftSecurityException, - ThriftTableOperationException { + public void grantTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte permission) + throws ThriftSecurityException, ThriftTableOperationException { String namespaceId = checkTableNamespaceId(tableNamespace, TableOperation.PERMISSION); security.grantTableNamespacePermission(credentials, user, namespaceId, TableNamespacePermission.getPermissionById(permission)); } - + @Override public void revokeSystemPermission(TInfo tinfo, TCredentials credentials, String user, byte permission) throws ThriftSecurityException { security.revokeSystemPermission(credentials, user, SystemPermission.getPermissionById(permission)); @@ -217,19 +217,19 @@ public class ClientServiceHandler implements ClientService.Iface { } @Override - public boolean hasTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte perm) throws ThriftSecurityException, - ThriftTableOperationException { + public boolean hasTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte perm) + throws ThriftSecurityException, ThriftTableOperationException { String namespaceId = checkTableNamespaceId(tableNamespace, TableOperation.PERMISSION); return security.hasTableNamespacePermission(credentials, user, namespaceId, TableNamespacePermission.getPermissionById(perm)); } - + @Override - public void revokeTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte permission) throws ThriftSecurityException, - ThriftTableOperationException { + public void revokeTableNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String tableNamespace, byte permission) + throws ThriftSecurityException, ThriftTableOperationException { String namespaceId = checkTableNamespaceId(tableNamespace, TableOperation.PERMISSION); security.revokeTableNamespacePermission(credentials, user, namespaceId, TableNamespacePermission.getPermissionById(permission)); } - + @Override public Set listLocalUsers(TInfo tinfo, TCredentials credentials) throws ThriftSecurityException { return security.listUsers(credentials); @@ -428,7 +428,7 @@ public class ClientServiceHandler implements ClientService.Iface { namespaceId = TableNamespaces.getNamespaceId(instance, ns); } catch (TableNamespaceNotFoundException e) { String why = "Could not find table namespace while getting configuration."; - throw new ThriftTableOperationException(null, ns, null, null, why); + throw new ThriftTableOperationException(null, ns, null, TableOperationExceptionType.NOTFOUND, why); } AccumuloConfiguration config = ServerConfiguration.getTableNamespaceConfiguration(instance, namespaceId); return conf(credentials, config);