Package org.apache.hadoop.hbase.stargate.auth.ZooKeeperAuthenticator

Examples of org.apache.hadoop.hbase.stargate.auth.ZooKeeperAuthenticator.UserModel


      new JSONJAXBContext(JSONConfiguration.natural().build(),
          UserModel.class);
    JSONMarshaller marshaller = context.createJSONMarshaller();
    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +
          ADMIN_TOKEN, null) == null) {
      UserModel model = new UserModel();
      model.name = ADMIN_USERNAME;
      model.admin = true;
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      marshaller.marshallToJSON(model, os);
      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + ADMIN_TOKEN,
        os.toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    }
    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +
          USER_TOKEN, null) == null) {
      UserModel model = new UserModel();
      model.name = USER_USERNAME;
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      marshaller.marshallToJSON(model, os);
      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + USER_TOKEN,
        os.toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    }
    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +
          DISABLED_TOKEN, null) == null) {
      UserModel model = new UserModel();
      model.name = DISABLED_USERNAME;
      model.disabled = true;
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      marshaller.marshallToJSON(model, os);
      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +DISABLED_TOKEN,
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.stargate.auth.ZooKeeperAuthenticator.UserModel

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.