Package org.apache.accumulo.core.client

Examples of org.apache.accumulo.core.client.AccumuloSecurityException


    } catch (InterruptedException e) {
      log.error(e, e);
      throw new RuntimeException(e);
    } catch (KeeperException e) {
      if (e.code().equals(KeeperException.Code.NONODE))
        throw new AccumuloSecurityException(user, SecurityErrorCode.USER_DOESNT_EXIST, e);
      log.error(e, e);
      throw new AccumuloSecurityException(user, SecurityErrorCode.CONNECTION_ERROR, e);
    }
  }
View Full Code Here


  }
 
  @Override
  public void changePassword(String principal, AuthenticationToken token) throws AccumuloSecurityException {
    if (!(token instanceof PasswordToken))
      throw new AccumuloSecurityException(principal, SecurityErrorCode.INVALID_TOKEN);
    PasswordToken pt = (PasswordToken) token;
    if (userExists(principal)) {
      try {
        synchronized (zooCache) {
          zooCache.clear(ZKUserPath + "/" + principal);
          ZooReaderWriter.getRetryingInstance().putPrivatePersistentData(ZKUserPath + "/" + principal, ZKSecurityTool.createPass(pt.getPassword()),
              NodeExistsPolicy.OVERWRITE);
        }
      } catch (KeeperException e) {
        log.error(e, e);
        throw new AccumuloSecurityException(principal, SecurityErrorCode.CONNECTION_ERROR, e);
      } catch (InterruptedException e) {
        log.error(e, e);
        throw new RuntimeException(e);
      } catch (AccumuloException e) {
        log.error(e, e);
        throw new AccumuloSecurityException(principal, SecurityErrorCode.DEFAULT_SECURITY_ERROR, e);
      }
    } else
      throw new AccumuloSecurityException(principal, SecurityErrorCode.USER_DOESNT_EXIST); // user doesn't exist
  }
View Full Code Here

  }
 
  @Override
  public boolean authenticateUser(String principal, AuthenticationToken token) throws AccumuloSecurityException {
    if (!(token instanceof PasswordToken))
      throw new AccumuloSecurityException(principal, SecurityErrorCode.INVALID_TOKEN);
    PasswordToken pt = (PasswordToken) token;
    byte[] pass;
    String zpath = ZKUserPath + "/" + principal;
    pass = zooCache.get(zpath);
    boolean result = ZKSecurityTool.checkPass(pt.getPassword(), pass);
View Full Code Here

        return Translator.translate(failures, Translators.TKET);
      } finally {
        ThriftUtil.returnClient((TServiceClient) client);
      }
    } catch (ThriftSecurityException e) {
      throw new AccumuloSecurityException(e.user, e.code, e);
    } catch (Throwable t) {
      t.printStackTrace();
      throw new AccumuloException(t);
    }
  }
View Full Code Here

  public void initializeSecurity(TCredentials credentials, String rootPrincipal, byte[] token) throws AccumuloSecurityException, ThriftSecurityException {
    authenticate(credentials);

    if (!credentials.getPrincipal().equals(SecurityConstants.SYSTEM_PRINCIPAL))
      throw new AccumuloSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);

    authenticator.initializeSecurity(credentials, rootPrincipal, token);
    authorizor.initializeSecurity(credentials, rootPrincipal);
    permHandle.initializeSecurity(credentials, rootPrincipal);
    try {
View Full Code Here

  private AuthenticationToken reassembleToken(TCredentials toAuth) throws AccumuloSecurityException {
    String tokenClass = toAuth.getTokenClassName();
    if (authenticator.validTokenClass(tokenClass)) {
      return CredentialHelper.extractToken(toAuth);
    }
    throw new AccumuloSecurityException(toAuth.getPrincipal(), SecurityErrorCode.INVALID_TOKEN);
  }
View Full Code Here

    IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
    try {
      zoo.putPersistentData(ZKUserPath + "/" + user, new byte[0], NodeExistsPolicy.SKIP);
    } catch (KeeperException e) {
      log.error(e, e);
      throw new AccumuloSecurityException(user, SecurityErrorCode.CONNECTION_ERROR, e);
    } catch (InterruptedException e) {
      log.error(e, e);
      throw new RuntimeException(e);
    }
  }
View Full Code Here

      log.error(e, e);
      throw new RuntimeException(e);
    } catch (KeeperException e) {
      log.error(e, e);
      if (e.code().equals(KeeperException.Code.NONODE))
        throw new AccumuloSecurityException(user, SecurityErrorCode.USER_DOESNT_EXIST, e);
      throw new AccumuloSecurityException(user, SecurityErrorCode.CONNECTION_ERROR, e);
     
    }
  }
View Full Code Here

        ZooReaderWriter.getRetryingInstance().putPersistentData(ZKUserPath + "/" + user + ZKUserAuths, ZKSecurityTool.convertAuthorizations(authorizations),
            NodeExistsPolicy.OVERWRITE);
      }
    } catch (KeeperException e) {
      log.error(e, e);
      throw new AccumuloSecurityException(user, SecurityErrorCode.CONNECTION_ERROR, e);
    } catch (InterruptedException e) {
      log.error(e, e);
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    } catch (TTransportException e) {
      log.debug("Server : " + server + " msg : " + e.getMessage());
      throw new IOException(e);
    } catch (ThriftSecurityException e) {
      log.debug("Server : " + server + " msg : " + e.getMessage(), e);
      throw new AccumuloSecurityException(e.user, e.code, e);
    } catch (TApplicationException e) {
      log.debug("Server : " + server + " msg : " + e.getMessage(), e);
      throw new AccumuloServerException(server, e);
    } catch (TException e) {
      log.debug("Server : " + server + " msg : " + e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.AccumuloSecurityException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.