Author: kturner
Date: Fri Apr 12 16:44:41 2013
New Revision: 1467343

URL: http://svn.apache.org/r1467343
Log:
ACCUMULO-970 Removed and deprecated thrift enum from public API and fixed 
breakage between 1.4 and 1.5 API

Added:
    
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/SecurityErrorCode.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/security/
      - copied from r1467311, 
accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/client/security/
Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/assemble/   (props changed)
    accumulo/trunk/core/   (props changed)
    
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java
    
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
    
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
    
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
    
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
    
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
    
accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/security/SecurityErrorCodeTest.java
    accumulo/trunk/examples/   (props changed)
    
accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   
(props changed)
    
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
   (props changed)
    
accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/src/   (props changed)
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterSystemPerm.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTable.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateTable.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateUser.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropUser.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
    
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1467311

Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/assemble:r1467311

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1467311

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java
 Fri Apr 12 16:44:41 2013
@@ -156,9 +156,20 @@ public class AccumuloSecurityException e
   
   /**
    * @return the specific reason for this exception
+   * @since 1.5.0
    */
-  public SecurityErrorCode getErrorCode() {
-    return errorCode;
+
+  public org.apache.accumulo.core.client.security.SecurityErrorCode 
getSecurityErrorCode() {
+    return 
org.apache.accumulo.core.client.security.SecurityErrorCode.valueOf(errorCode.name());
+  }
+
+  /**
+   * @return the specific reason for this exception
+   * 
+   * @deprecated since 1.5.0; Use {@link #getSecurityErrorCode()} instead.
+   */
+  public org.apache.accumulo.core.security.thrift.SecurityErrorCode 
getErrorCode() {
+    return 
org.apache.accumulo.core.security.thrift.SecurityErrorCode.valueOf(errorCode.name());
   }
   
   public String getMessage() {

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
 Fri Apr 12 16:44:41 2013
@@ -25,7 +25,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.accumulo.core.client.impl.Tables;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.data.ConstraintViolationSummary;
 import org.apache.accumulo.core.data.KeyExtent;
 

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
 Fri Apr 12 16:44:41 2013
@@ -35,10 +35,6 @@ import java.util.concurrent.ExecutorServ
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.accumulo.trace.instrument.Span;
-import org.apache.accumulo.trace.instrument.Trace;
-import org.apache.accumulo.trace.instrument.Tracer;
-import org.apache.accumulo.trace.thrift.TInfo;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -67,6 +63,10 @@ import org.apache.accumulo.core.tabletse
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
 import org.apache.accumulo.core.util.SimpleThreadPool;
 import org.apache.accumulo.core.util.ThriftUtil;
+import org.apache.accumulo.trace.instrument.Span;
+import org.apache.accumulo.trace.instrument.Trace;
+import org.apache.accumulo.trace.instrument.Tracer;
+import org.apache.accumulo.trace.thrift.TInfo;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
 import org.apache.thrift.TApplicationException;
@@ -460,7 +460,7 @@ public class TabletServerBatchWriter {
       }
     }
   }
-  
+
   private void updateAuthorizationFailures(Set<KeyExtent> keySet, 
SecurityErrorCode code) {
     HashMap<KeyExtent, SecurityErrorCode> map = new HashMap<KeyExtent, 
SecurityErrorCode>();
     for (KeyExtent ke : keySet)
@@ -522,7 +522,18 @@ public class TabletServerBatchWriter {
   private void checkForFailures() throws MutationsRejectedException {
     if (somethingFailed) {
       List<ConstraintViolationSummary> cvsList = violations.asList();
-      throw new MutationsRejectedException(instance, cvsList, new 
HashMap<KeyExtent,Set<SecurityErrorCode>>(authorizationFailures), 
serverSideErrors, unknownErrors, lastUnknownError);
+      
HashMap<KeyExtent,Set<org.apache.accumulo.core.client.security.SecurityErrorCode>>
 af = new 
HashMap<KeyExtent,Set<org.apache.accumulo.core.client.security.SecurityErrorCode>>();
+      for (Entry<KeyExtent,Set<SecurityErrorCode>> entry : 
authorizationFailures.entrySet()) {
+        HashSet<org.apache.accumulo.core.client.security.SecurityErrorCode> 
codes = new 
HashSet<org.apache.accumulo.core.client.security.SecurityErrorCode>();
+        
+        for (SecurityErrorCode sce : entry.getValue()) {
+          
codes.add(org.apache.accumulo.core.client.security.SecurityErrorCode.valueOf(sce.name()));
+        }
+        
+        af.put(entry.getKey(), codes);
+      }
+      
+      throw new MutationsRejectedException(instance, cvsList, af, 
serverSideErrors, unknownErrors, lastUnknownError);
     }
   }
   
@@ -662,7 +673,8 @@ public class TabletServerBatchWriter {
         // assume an IOError communicating with !METADATA tablet
         failedMutations.add(mutationsToProcess);
       } catch (AccumuloSecurityException e) {
-        updateAuthorizationFailures(Collections.singletonMap(new KeyExtent(new 
Text(Constants.METADATA_TABLE_ID), null, null), e.getErrorCode()));
+        updateAuthorizationFailures(Collections.singletonMap(new KeyExtent(new 
Text(Constants.METADATA_TABLE_ID), null, null),
+            SecurityErrorCode.valueOf(e.getSecurityErrorCode().name())));
       } catch (TableDeletedException e) {
         updateUnknownErrors(e.getMessage(), e);
       } catch (TableOfflineException e) {

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
 Fri Apr 12 16:44:41 2013
@@ -33,9 +33,9 @@ import org.apache.accumulo.core.client.M
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.ZooKeeperInstance;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
 import org.apache.accumulo.core.client.mapreduce.lib.util.OutputConfigurator;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.data.ColumnUpdate;
 import org.apache.accumulo.core.data.KeyExtent;

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
 Fri Apr 12 16:44:41 2013
@@ -34,9 +34,9 @@ import org.apache.accumulo.core.client.M
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.ZooKeeperInstance;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
 import org.apache.accumulo.core.client.mapreduce.lib.util.OutputConfigurator;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.ColumnUpdate;

Added: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/SecurityErrorCode.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/SecurityErrorCode.java?rev=1467343&view=auto
==============================================================================
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/SecurityErrorCode.java
 (added)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/SecurityErrorCode.java
 Fri Apr 12 16:44:41 2013
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.core.client.security;
+
+/**
+ * 
+ */
+public enum SecurityErrorCode {
+  DEFAULT_SECURITY_ERROR,
+  BAD_CREDENTIALS,
+  PERMISSION_DENIED,
+  USER_DOESNT_EXIST,
+  CONNECTION_ERROR,
+  USER_EXISTS,
+  GRANT_INVALID,
+  BAD_AUTHORIZATIONS,
+  INVALID_INSTANCEID,
+  TABLE_DOESNT_EXIST,
+  UNSUPPORTED_OPERATION,
+  INVALID_TOKEN,
+  AUTHENTICATOR_FAILED,
+  AUTHORIZOR_FAILED,
+  PERMISSIONHANDLER_FAILED,
+  TOKEN_EXPIRED,
+  SERIALIZATION_ERROR,
+  INSUFFICIENT_PROPERTIES;
+}

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
 Fri Apr 12 16:44:41 2013
@@ -28,7 +28,7 @@ import org.apache.accumulo.core.client.B
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.data.ConstraintViolationSummary;
 import org.apache.accumulo.core.data.KeyExtent;

Modified: 
accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/security/SecurityErrorCodeTest.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/security/SecurityErrorCodeTest.java?rev=1467343&r1=1467311&r2=1467343&view=diff
==============================================================================
    (empty)

Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/examples:r1467311

Modified: 
accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
 (original)
+++ 
accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
 Fri Apr 12 16:44:41 2013
@@ -18,9 +18,9 @@ package org.apache.accumulo.examples.sim
 
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Map.Entry;
 import java.util.Random;
 import java.util.Set;
-import java.util.Map.Entry;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ClientOnRequiredTable;
@@ -30,7 +30,7 @@ import org.apache.accumulo.core.client.B
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;

Propchange: 
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged 
/accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1467311

Propchange: 
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
  Merged 
/accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1467311

Modified: 
accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java 
(original)
+++ 
accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java 
Fri Apr 12 16:44:41 2013
@@ -50,8 +50,8 @@ import org.apache.accumulo.core.client.Z
 import org.apache.accumulo.core.client.admin.ActiveCompaction;
 import org.apache.accumulo.core.client.admin.ActiveScan;
 import org.apache.accumulo.core.client.admin.TimeType;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
 import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.data.Column;
@@ -175,7 +175,7 @@ public class ProxyServer implements Accu
       return new 
org.apache.accumulo.proxy.thrift.AccumuloException(e.toString());
     } catch (AccumuloSecurityException e) {
       logger.debug(e,e);
-      if (e.getErrorCode().equals(SecurityErrorCode.TABLE_DOESNT_EXIST))
+      if 
(e.getSecurityErrorCode().equals(SecurityErrorCode.TABLE_DOESNT_EXIST))
         return new 
org.apache.accumulo.proxy.thrift.TableNotFoundException(e.toString());
       return new 
org.apache.accumulo.proxy.thrift.AccumuloSecurityException(e.toString());
     } catch (TableNotFoundException e) {

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/server:r1467311

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/src:r1467311

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java 
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java 
Fri Apr 12 16:44:41 2013
@@ -21,7 +21,6 @@ import java.util.Random;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.accumulo.trace.instrument.Trace;
 import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
@@ -29,7 +28,7 @@ import org.apache.accumulo.core.client.I
 import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.impl.TabletServerBatchWriter;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.data.ConstraintViolationSummary;
 import org.apache.accumulo.core.data.Key;
@@ -47,6 +46,7 @@ import org.apache.accumulo.core.util.Fas
 import org.apache.accumulo.fate.zookeeper.ZooReader;
 import org.apache.accumulo.server.cli.ClientOnDefaultTable;
 import org.apache.accumulo.server.conf.ServerConfiguration;
+import org.apache.accumulo.trace.instrument.Trace;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.io.Text;

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
 Fri Apr 12 16:44:41 2013
@@ -38,7 +38,7 @@ import org.apache.accumulo.core.client.S
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.impl.Tables;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Key;
@@ -119,7 +119,7 @@ public class PermissionsTest {
             test_user_conn.tableOperations().create(tableName);
             throw new IllegalStateException("Should NOT be able to create a 
table");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || 
root_conn.tableOperations().list().contains(tableName))
+            if (e.getSecurityErrorCode() != 
SecurityErrorCode.PERMISSION_DENIED || 
root_conn.tableOperations().list().contains(tableName))
               throw e;
           }
           break;
@@ -130,7 +130,7 @@ public class PermissionsTest {
             test_user_conn.tableOperations().delete(tableName);
             throw new IllegalStateException("Should NOT be able to delete a 
table");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || 
!root_conn.tableOperations().list().contains(tableName))
+            if (e.getSecurityErrorCode() != 
SecurityErrorCode.PERMISSION_DENIED || 
!root_conn.tableOperations().list().contains(tableName))
               throw e;
           }
           break;
@@ -142,7 +142,7 @@ public class PermissionsTest {
             test_user_conn.tableOperations().setProperty(tableName, 
Property.TABLE_BLOOM_ERRORRATE.getKey(), "003.14159%");
             throw new IllegalStateException("Should NOT be able to set a table 
property");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED
+            if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
                 || 
ServerConfiguration.getTableConfiguration(root_conn.getInstance(), 
tableId).get(Property.TABLE_BLOOM_ERRORRATE).equals("003.14159%"))
               throw e;
           }
@@ -151,7 +151,7 @@ public class PermissionsTest {
             test_user_conn.tableOperations().removeProperty(tableName, 
Property.TABLE_BLOOM_ERRORRATE.getKey());
             throw new IllegalStateException("Should NOT be able to remove a 
table property");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED
+            if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
                 || 
!ServerConfiguration.getTableConfiguration(root_conn.getInstance(), 
tableId).get(Property.TABLE_BLOOM_ERRORRATE).equals("003.14159%"))
               throw e;
           }
@@ -160,7 +160,7 @@ public class PermissionsTest {
             test_user_conn.tableOperations().rename(tableName, table2);
             throw new IllegalStateException("Should NOT be able to rename a 
table");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || 
!root_conn.tableOperations().list().contains(tableName)
+            if (e.getSecurityErrorCode() != 
SecurityErrorCode.PERMISSION_DENIED || 
!root_conn.tableOperations().list().contains(tableName)
                 || root_conn.tableOperations().list().contains(table2))
               throw e;
           }
@@ -171,7 +171,8 @@ public class PermissionsTest {
             test_user_conn.securityOperations().createLocalUser(user, new 
PasswordToken(password));
             throw new IllegalStateException("Should NOT be able to create a 
user");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || 
root_conn.securityOperations().authenticateUser(user, new 
PasswordToken(password)))
+            if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
+                || root_conn.securityOperations().authenticateUser(user, new 
PasswordToken(password)))
               throw e;
           }
           break;
@@ -182,7 +183,8 @@ public class PermissionsTest {
             test_user_conn.securityOperations().dropLocalUser(user);
             throw new IllegalStateException("Should NOT be able to delete a 
user");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || 
!root_conn.securityOperations().authenticateUser(user, new 
PasswordToken(password)))
+            if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
+                || !root_conn.securityOperations().authenticateUser(user, new 
PasswordToken(password)))
               throw e;
           }
           break;
@@ -193,7 +195,7 @@ public class PermissionsTest {
             test_user_conn.securityOperations().changeUserAuthorizations(user, 
new Authorizations("A", "B"));
             throw new IllegalStateException("Should NOT be able to alter a 
user");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || 
!root_conn.securityOperations().getUserAuthorizations(user).isEmpty())
+            if (e.getSecurityErrorCode() != 
SecurityErrorCode.PERMISSION_DENIED || 
!root_conn.securityOperations().getUserAuthorizations(user).isEmpty())
               throw e;
           }
           break;
@@ -376,7 +378,7 @@ public class PermissionsTest {
               throw new IllegalStateException("Should NOT be able to read from 
the table");
           } catch (RuntimeException e) {
             AccumuloSecurityException se = (AccumuloSecurityException) 
e.getCause();
-            if (se.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED)
+            if (se.getSecurityErrorCode() != 
SecurityErrorCode.PERMISSION_DENIED)
               throw se;
           }
           break;
@@ -390,11 +392,12 @@ public class PermissionsTest {
               writer.close();
             } catch (MutationsRejectedException e1) {
               if (e1.getAuthorizationFailuresMap().size() > 0)
-                throw new AccumuloSecurityException(test_user_conn.whoami(), 
SecurityErrorCode.PERMISSION_DENIED, e1);
+                throw new AccumuloSecurityException(test_user_conn.whoami(), 
org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.PERMISSION_DENIED,
+                    e1);
             }
             throw new IllegalStateException("Should NOT be able to write to a 
table");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED)
+            if (e.getSecurityErrorCode() != 
SecurityErrorCode.PERMISSION_DENIED)
               throw e;
           }
           break;
@@ -408,7 +411,7 @@ public class PermissionsTest {
             test_user_conn.tableOperations().setLocalityGroups(TEST_TABLE, 
groups);
             throw new IllegalStateException("User should not be able to set 
locality groups");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED)
+            if (e.getSecurityErrorCode() != 
SecurityErrorCode.PERMISSION_DENIED)
               throw e;
           }
           break;
@@ -417,7 +420,7 @@ public class PermissionsTest {
             test_user_conn.tableOperations().delete(TEST_TABLE);
             throw new IllegalStateException("User should not be able delete 
the table");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED)
+            if (e.getSecurityErrorCode() != 
SecurityErrorCode.PERMISSION_DENIED)
               throw e;
           }
           break;
@@ -426,7 +429,7 @@ public class PermissionsTest {
             test_user_conn.securityOperations().grantTablePermission("root", 
TEST_TABLE, TablePermission.GRANT);
             throw new IllegalStateException("User should not be able grant 
permissions");
           } catch (AccumuloSecurityException e) {
-            if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED)
+            if (e.getSecurityErrorCode() != 
SecurityErrorCode.PERMISSION_DENIED)
               throw e;
           }
           break;

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterSystemPerm.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterSystemPerm.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterSystemPerm.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterSystemPerm.java
 Fri Apr 12 16:44:41 2013
@@ -62,7 +62,7 @@ public class AlterSystemPerm extends Tes
       try {
         conn.securityOperations().revokeSystemPermission(targetUser, sysPerm);
       } catch (AccumuloSecurityException ae) {
-        switch (ae.getErrorCode()) {
+        switch (ae.getSecurityErrorCode()) {
           case GRANT_INVALID:
             if (sysPerm.equals(SystemPermission.GRANT))
               return;
@@ -80,7 +80,7 @@ public class AlterSystemPerm extends Tes
       try {
         conn.securityOperations().grantSystemPermission(targetUser, sysPerm);
       } catch (AccumuloSecurityException ae) {
-        switch (ae.getErrorCode()) {
+        switch (ae.getSecurityErrorCode()) {
           case GRANT_INVALID:
             if (sysPerm.equals(SystemPermission.GRANT))
               return;

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTable.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTable.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTable.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTable.java
 Fri Apr 12 16:44:41 2013
@@ -24,7 +24,7 @@ import org.apache.accumulo.core.client.A
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
 
@@ -49,12 +49,12 @@ public class AlterTable extends Test {
     try {
       conn.tableOperations().rename(oldName, newName);
     } catch (AccumuloSecurityException ae) {
-      if (ae.getErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
+      if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
         if (hasPermission)
           throw new AccumuloException("Got a security exception when I should 
have had permission.", ae);
         else
           return;
-      } else if (ae.getErrorCode().equals(SecurityErrorCode.BAD_CREDENTIALS)) {
+      } else if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.BAD_CREDENTIALS)) {
         if (WalkingSecurity.get(state).userPassTransient(conn.whoami()))
           return;
       }

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java
 Fri Apr 12 16:44:41 2013
@@ -90,7 +90,7 @@ public class AlterTablePerm extends Test
         else
           action = "give";
       } catch (AccumuloSecurityException ae) {
-        switch (ae.getErrorCode()) {
+        switch (ae.getSecurityErrorCode()) {
           case USER_DOESNT_EXIST:
             if (exists)
               throw new AccumuloException("Framework and Accumulo are out of 
sync, we think user exists", ae);
@@ -112,7 +112,7 @@ public class AlterTablePerm extends Test
       try {
         conn.securityOperations().revokeTablePermission(target, tableName, 
tabPerm);
       } catch (AccumuloSecurityException ae) {
-        switch (ae.getErrorCode()) {
+        switch (ae.getSecurityErrorCode()) {
           case GRANT_INVALID:
             throw new AccumuloException("Got a grant invalid on 
non-System.GRANT option", ae);
           case PERMISSION_DENIED:
@@ -140,7 +140,7 @@ public class AlterTablePerm extends Test
       try {
         conn.securityOperations().grantTablePermission(target, tableName, 
tabPerm);
       } catch (AccumuloSecurityException ae) {
-        switch (ae.getErrorCode()) {
+        switch (ae.getSecurityErrorCode()) {
           case GRANT_INVALID:
             throw new AccumuloException("Got a grant invalid on 
non-System.GRANT option", ae);
           case PERMISSION_DENIED:

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
 Fri Apr 12 16:44:41 2013
@@ -62,7 +62,7 @@ public class Authenticate extends Test {
     try {
       result = conn.securityOperations().authenticateUser(target, new 
PasswordToken(password));
     } catch (AccumuloSecurityException ae) {
-      switch (ae.getErrorCode()) {
+      switch (ae.getSecurityErrorCode()) {
         case PERMISSION_DENIED:
           if (exists && hasPermission)
             throw new AccumuloException("Got a security exception when I 
should have had permission.", ae);

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
 Fri Apr 12 16:44:41 2013
@@ -67,7 +67,7 @@ public class ChangePass extends Test {
     try {
       conn.securityOperations().changeLocalUserPassword(target, newPass);
     } catch (AccumuloSecurityException ae) {
-      switch (ae.getErrorCode()) {
+      switch (ae.getSecurityErrorCode()) {
         case PERMISSION_DENIED:
           if (hasPerm)
             throw new AccumuloException("Change failed when it should have 
succeeded to change " + target + "'s password", ae);

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateTable.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateTable.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateTable.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateTable.java
 Fri Apr 12 16:44:41 2013
@@ -22,7 +22,7 @@ import org.apache.accumulo.core.client.A
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableExistsException;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.test.randomwalk.State;
 import org.apache.accumulo.test.randomwalk.Test;
@@ -41,7 +41,7 @@ public class CreateTable extends Test {
     try {
       conn.tableOperations().create(tableName);
     } catch (AccumuloSecurityException ae) {
-      if (ae.getErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
+      if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
         if (hasPermission)
           throw new AccumuloException("Got a security exception when I should 
have had permission.", ae);
         else

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateUser.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateUser.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateUser.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateUser.java
 Fri Apr 12 16:44:41 2013
@@ -39,7 +39,7 @@ public class CreateUser extends Test {
     try {
       conn.securityOperations().createLocalUser(tableUserName, tabUserPass);
     } catch (AccumuloSecurityException ae) {
-      switch (ae.getErrorCode()) {
+      switch (ae.getSecurityErrorCode()) {
         case PERMISSION_DENIED:
           if (hasPermission)
             throw new AccumuloException("Got a security exception when I 
should have had permission.", ae);

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java
 Fri Apr 12 16:44:41 2013
@@ -23,7 +23,7 @@ import org.apache.accumulo.core.client.A
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.security.CredentialHelper;
 import org.apache.accumulo.test.randomwalk.State;
@@ -57,7 +57,7 @@ public class DropTable extends Test {
     try {
       conn.tableOperations().delete(tableName);
     } catch (AccumuloSecurityException ae) {
-      if (ae.getErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
+      if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
         if (hasPermission)
           throw new AccumuloException("Got a security exception when I should 
have had permission.", ae);
         else {
@@ -66,7 +66,7 @@ public class DropTable extends Test {
           WalkingSecurity.get(state).cleanTablePermissions(tableName);
           return;
         }
-      } else if (ae.getErrorCode().equals(SecurityErrorCode.BAD_CREDENTIALS)) {
+      } else if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.BAD_CREDENTIALS)) {
         if (WalkingSecurity.get(state).userPassTransient(conn.whoami()))
           return;
       }

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropUser.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropUser.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropUser.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropUser.java
 Fri Apr 12 16:44:41 2013
@@ -38,7 +38,7 @@ public class DropUser extends Test {
     try {
       conn.securityOperations().dropLocalUser(tableUserName);
     } catch (AccumuloSecurityException ae) {
-      switch (ae.getErrorCode()) {
+      switch (ae.getSecurityErrorCode()) {
         case PERMISSION_DENIED:
           if (hasPermission)
             throw new AccumuloException("Got a security exception when I 
should have had permission.", ae);

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SetAuths.java
 Fri Apr 12 16:44:41 2013
@@ -75,7 +75,7 @@ public class SetAuths extends Test {
     try {
       conn.securityOperations().changeUserAuthorizations(target, auths);
     } catch (AccumuloSecurityException ae) {
-      switch (ae.getErrorCode()) {
+      switch (ae.getSecurityErrorCode()) {
         case PERMISSION_DENIED:
           if (hasPermission)
             throw new AccumuloException("Got a security exception when I 
should have had permission.", ae);

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
 Fri Apr 12 16:44:41 2013
@@ -32,7 +32,7 @@ import org.apache.accumulo.core.client.C
 import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
@@ -99,13 +99,13 @@ public class TableOp extends Test {
             throw new AccumuloException("Accumulo and test suite out of sync: 
table " + tableName, tnfe);
           return;
         } catch (AccumuloSecurityException ae) {
-          if (ae.getErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
+          if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
             if (canRead && !ambiguousZone)
               throw new AccumuloException("Table read permission out of sync 
with Accumulo: table " + tableName, ae);
             else
               return;
           }
-          if (ae.getErrorCode().equals(SecurityErrorCode.BAD_AUTHORIZATIONS)) {
+          if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.BAD_AUTHORIZATIONS)) {
             if (ambiguousAuths)
               return;
             else
@@ -114,14 +114,14 @@ public class TableOp extends Test {
           throw new AccumuloException("Unexpected exception!", ae);
         } catch (RuntimeException re) {
           if (re.getCause() instanceof AccumuloSecurityException
-              && ((AccumuloSecurityException) 
re.getCause()).getErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
+              && ((AccumuloSecurityException) 
re.getCause()).getSecurityErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED))
 {
             if (canRead && !ambiguousZone)
               throw new AccumuloException("Table read permission out of sync 
with Accumulo: table " + tableName, re.getCause());
             else
               return;
           }
           if (re.getCause() instanceof AccumuloSecurityException
-              && ((AccumuloSecurityException) 
re.getCause()).getErrorCode().equals(SecurityErrorCode.BAD_AUTHORIZATIONS)) {
+              && ((AccumuloSecurityException) 
re.getCause()).getSecurityErrorCode().equals(SecurityErrorCode.BAD_AUTHORIZATIONS))
 {
             if (ambiguousAuths)
               return;
             else
@@ -213,11 +213,11 @@ public class TableOp extends Test {
             throw new AccumuloException("Table didn't exist when it should 
have: " + tableName);
           return;
         } catch (AccumuloSecurityException ae) {
-          if (ae.getErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
+          if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.PERMISSION_DENIED)) {
             if 
(WalkingSecurity.get(state).canBulkImport(WalkingSecurity.get(state).getTabCredentials(),
 tableName))
               throw new AccumuloException("Bulk Import failed when it should 
have worked: " + tableName);
             return;
-          } else if 
(ae.getErrorCode().equals(SecurityErrorCode.BAD_CREDENTIALS)) {
+          } else if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.BAD_CREDENTIALS)) {
             if (WalkingSecurity.get(state).userPassTransient(conn.whoami()))
               return;
           }

Modified: 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java?rev=1467343&r1=1467342&r2=1467343&view=diff
==============================================================================
--- 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java
 (original)
+++ 
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java
 Fri Apr 12 16:44:41 2013
@@ -21,8 +21,8 @@ import java.util.Properties;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
 import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.SystemPermission;
 import org.apache.accumulo.core.security.TablePermission;
@@ -64,7 +64,7 @@ public class Validate extends Test {
           accuHasSp = conn.securityOperations().hasSystemPermission(user, sp);
           log.debug("Just checked to see if user " + user + " has system perm 
" + sp.name() + " with answer " + accuHasSp);
         } catch (AccumuloSecurityException ae) {
-          if (ae.getErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) {
+          if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) {
             if (tableUserExists)
               throw new AccumuloException("Got user DNE error when they 
should", ae);
             else
@@ -83,12 +83,12 @@ public class Validate extends Test {
           accuHasTp = conn.securityOperations().hasTablePermission(user, 
WalkingSecurity.get(state).getTableName(), tp);
           log.debug("Just checked to see if user " + user + " has table perm " 
+ tp.name() + " with answer " + accuHasTp);
         } catch (AccumuloSecurityException ae) {
-          if (ae.getErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) {
+          if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) {
             if (tableUserExists)
               throw new AccumuloException("Got user DNE error when they 
should", ae);
             else
               continue;
-          } else if 
(ae.getErrorCode().equals(SecurityErrorCode.TABLE_DOESNT_EXIST)) {
+          } else if 
(ae.getSecurityErrorCode().equals(SecurityErrorCode.TABLE_DOESNT_EXIST)) {
             if (tableExists)
               throw new AccumuloException("Got table DNE when it should", ae);
             else


Reply via email to