@Override public void readFields(DataInput in) throws IOException { super.readFields(in); identifier = new AuthenticationTokenIdentifier(); identifier.readFields(in); }
private PasswordToken deserailize(byte[] tokenBytes){ PasswordToken type = null; try { type = PasswordToken.class.newInstance(); } catch (Exception e) { throw new IllegalArgumentException("Cannot instantiate " + PasswordToken.class.getName(), e); } ByteArrayInputStream bais = new ByteArrayInputStream(tokenBytes); DataInputStream in = new DataInputStream(bais); try { type.readFields(in); } catch (IOException e) { throw new IllegalArgumentException("Cannot deserialize provided byte array as class " + PasswordToken.class.getName(), e); } try { in.close(); } catch (IOException e) { throw new IllegalStateException("Shouldn't happen", e); } return type; } public Authorizations getAuthorizations() {
@Override public void readFields(DataInput in) throws IOException { super.readFields(in); identifier = new AuthenticationTokenIdentifier(); identifier.readFields(in); }