Package org.apache.hadoop.security.token

Examples of org.apache.hadoop.security.token.TokenIdentifier.readFields()


      Token<? extends TokenIdentifier> token,
      Class<? extends TokenIdentifier> cls) throws IOException {
    TokenIdentifier tokenIdentifier = ReflectionUtils.newInstance(cls, null);
    ByteArrayInputStream buf = new ByteArrayInputStream(token.getIdentifier());
    DataInputStream in = new DataInputStream(buf);
    tokenIdentifier.readFields(in);
    in.close();
    return tokenIdentifier;
  }

  /** Factory for {@link SaslServerHandler} */
 
View Full Code Here


  public static TokenIdentifier getIdentifier(String id,
      SecretManager<TokenIdentifier> secretManager) throws InvalidToken {
    byte[] tokenId = decodeIdentifier(id);
    TokenIdentifier tokenIdentifier = secretManager.createIdentifier();
    try {
      tokenIdentifier.readFields(new DataInputStream(new ByteArrayInputStream(
          tokenId)));
    } catch (IOException e) {
      throw (InvalidToken) new InvalidToken(
          "Can't de-serialize tokenIdentifier").initCause(e);
    }
View Full Code Here

      Token<? extends TokenIdentifier> token,
      Class<? extends TokenIdentifier> cls) throws IOException {
    TokenIdentifier tokenIdentifier = ReflectionUtils.newInstance(cls, null);
    ByteArrayInputStream buf = new ByteArrayInputStream(token.getIdentifier());
    DataInputStream in = new DataInputStream(buf);
    tokenIdentifier.readFields(in);
    in.close();
    return tokenIdentifier;
  }

  /** Factory for {@link SaslServerHandler} */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.