private void handleAccumuloSecurityException(AccumuloSecurityException e) throws org.apache.accumulo.proxy.thrift.TableNotFoundException, org.apache.accumulo.proxy.thrift.AccumuloSecurityException { if (e.getSecurityErrorCode().equals(SecurityErrorCode.TABLE_DOESNT_EXIST)) throw new org.apache.accumulo.proxy.thrift.TableNotFoundException(e.toString()); throw new org.apache.accumulo.proxy.thrift.AccumuloSecurityException(e.toString()); }
private void handleException(Exception ex) throws org.apache.accumulo.proxy.thrift.AccumuloException, org.apache.accumulo.proxy.thrift.AccumuloSecurityException, TException { try { throw ex; } catch (AccumuloException e) { throw new org.apache.accumulo.proxy.thrift.AccumuloException(e.toString()); } catch (AccumuloSecurityException e) { throw new org.apache.accumulo.proxy.thrift.AccumuloSecurityException(e.toString()); } catch (Exception e) { throw new org.apache.accumulo.proxy.thrift.AccumuloException(e.toString()); } }
/** * Write the given Mutation to the replication table. */ static void update(ClientContext context, Mutation m, KeyExtent extent) { Writer t = getWriter(context); while (true) { try { t.update(m); return; } catch (AccumuloException e) { log.error(e.toString(), e); } catch (AccumuloSecurityException e) { log.error(e.toString(), e); } catch (ConstraintViolationException e) { log.error(e.toString(), e); } catch (TableNotFoundException e) { log.error(e.toString(), e); } sleepUninterruptibly(1, TimeUnit.SECONDS); } }
@Override public ByteBuffer login(String principal, Map<String,String> loginProperties) throws org.apache.accumulo.proxy.thrift.AccumuloSecurityException, TException { if (ThriftServerType.SASL == serverType) { String remoteUser = UGIAssumingProcessor.rpcPrincipal(); if (null == remoteUser || !remoteUser.equals(principal)) { logger.error( "Denying login from user " + remoteUser + " who attempted to log in as " + principal); throw new org.apache.accumulo.proxy.thrift.AccumuloSecurityException( RPC_ACCUMULO_PRINCIPAL_MISMATCH_MSG); } } try { AuthenticationToken token = getToken(principal, loginProperties); ByteBuffer login = ByteBuffer .wrap((instance.getInstanceID() + "," + new Credentials(principal, token).serialize()) .getBytes(UTF_8)); getConnector(login); // check to make sure user exists return login; } catch (AccumuloSecurityException e) { logger.error("Failed to login", e); throw new org.apache.accumulo.proxy.thrift.AccumuloSecurityException(e.toString()); } catch (Exception e) { logger.error("Failed to login", e); throw new TException(e); } }