public void read(ObjectInputStream in) throws IOException { this.credentials = new Credentials(); credentials.readFields(in); }
public void read(ObjectInputStream in) throws IOException { this.credentials = new Credentials(); credentials.readFields(in); } }
private static Credentials doGetCredentials(CredentialKeyProvider provider, Map<String, String> credentials, String configKey) { Credentials credential = null; String credentialKey = provider.getCredentialKey(configKey); if (credentials != null && credentials.containsKey(credentialKey)) { try { byte[] credBytes = DatatypeConverter.parseBase64Binary(credentialKey); ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(credBytes)); credential = new Credentials(); credential.readFields(in); } catch (Exception e) { LOG.error("Could not obtain credentials from credentials map.", e); } } return credential; }
/** * Convenience method for reading a token from a DataInputStream. */ public void readTokenStorageStream(DataInputStream in) throws IOException { byte[] magic = new byte[TOKEN_STORAGE_MAGIC.length]; in.readFully(magic); if (!Arrays.equals(magic, TOKEN_STORAGE_MAGIC)) { throw new IOException("Bad header found in token storage."); } SerializedFormat format; try { format = SerializedFormat.valueOf(in.readByte()); } catch (IllegalArgumentException e) { throw new IOException(e); } switch (format) { case WRITABLE: readFields(in); break; case PROTOBUF: readProto(in); break; default: throw new IOException("Unsupported format " + format); } }
/** * Convenience method for reading a token storage file directly from a * datainputstream */ public void readTokenStorageStream(DataInputStream in) throws IOException { byte[] magic = new byte[TOKEN_STORAGE_MAGIC.length]; in.readFully(magic); if (!Arrays.equals(magic, TOKEN_STORAGE_MAGIC)) { throw new IOException("Bad header found in token storage."); } byte version = in.readByte(); if (version != TOKEN_STORAGE_VERSION) { throw new IOException("Unknown version " + version + " in token storage."); } readFields(in); }
public void read(ObjectInputStream in) throws IOException { this.credentials = new Credentials(); credentials.readFields(in); } }
public void read(ObjectInputStream in) throws IOException { this.credentials = new Credentials(); credentials.readFields(in); } }
/** * Convenience method for reading a token storage file directly from a * datainputstream */ public void readTokenStorageStream(DataInputStream in) throws IOException { byte[] magic = new byte[TOKEN_STORAGE_MAGIC.length]; in.readFully(magic); if (!Arrays.equals(magic, TOKEN_STORAGE_MAGIC)) { throw new IOException("Bad header found in token storage."); } byte version = in.readByte(); if (version != TOKEN_STORAGE_VERSION) { throw new IOException("Unknown version " + version + " in token storage."); } readFields(in); }
/** * Convenience method for reading a token storage file directly from a * datainputstream */ public void readTokenStorageStream(DataInputStream in) throws IOException { byte[] magic = new byte[TOKEN_STORAGE_MAGIC.length]; in.readFully(magic); if (!Arrays.equals(magic, TOKEN_STORAGE_MAGIC)) { throw new IOException("Bad header found in token storage."); } byte version = in.readByte(); if (version != TOKEN_STORAGE_VERSION) { throw new IOException("Unknown version " + version + " in token storage."); } readFields(in); }
public void read(ObjectInputStream in) throws IOException { this.credentials = new Credentials(); credentials.readFields(in); } }
/** * Convenience method for reading a token storage file directly from a * datainputstream */ public void readTokenStorageStream(DataInputStream in) throws IOException { byte[] magic = new byte[TOKEN_STORAGE_MAGIC.length]; in.readFully(magic); if (!Arrays.equals(magic, TOKEN_STORAGE_MAGIC)) { throw new IOException("Bad header found in token storage."); } byte version = in.readByte(); if (version != TOKEN_STORAGE_VERSION) { throw new IOException("Unknown version " + version + " in token storage."); } readFields(in); }
public void read(ObjectInputStream in) throws IOException { this.credentials = new Credentials(); credentials.readFields(in); }
public void read(ObjectInputStream in) throws IOException { this.credentials = new Credentials(); credentials.readFields(in); }
public void read(ObjectInputStream in) throws IOException { this.credentials = new Credentials(); credentials.readFields(in); }
private final UserGroupInformation getUgi() { // If the UGI has not been created, create it from the credentials, and don't inherit from the current or // login user. if (ugi == null) { // If the UGI has not been initialized, then create a new one with the credentials. try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(credentials))) { Credentials cred = new Credentials(); cred.readFields(in); ugi = UserGroupInformation.createRemoteUser(principal, SaslRpcServer.AuthMethod.KERBEROS); ugi.addCredentials(cred); } catch (IOException e) { throw TalendRuntimeException.createUnexpectedException(e); } } return ugi; }
private final UserGroupInformation getUgi() { // If the UGI has not been created, create it from the credentials, and don't inherit from the current or // login user. if (ugi == null) { // If the UGI has not been initialized, then create a new one with the credentials. try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(credentials))) { Credentials cred = new Credentials(); cred.readFields(in); ugi = UserGroupInformation.createRemoteUser(principal, SaslRpcServer.AuthMethod.KERBEROS); ugi.addCredentials(cred); } catch (IOException e) { throw TalendRuntimeException.createUnexpectedException(e); } } return ugi; }
@Override public void readFields(DataInput in) throws IOException { shouldDie = in.readBoolean(); boolean taskComing = in.readBoolean(); if (taskComing) { taskSpec = new TaskSpec(); taskSpec.readFields(in); } int numAdditionalResources = in.readInt(); additionalResources = Maps.newHashMap(); if (numAdditionalResources != -1) { for (int i = 0 ; i < numAdditionalResources ; i++) { String resourceName = in.readUTF(); TezLocalResource localResource = new TezLocalResource(); localResource.readFields(in); additionalResources.put(resourceName, localResource); } } credentialsChanged = in.readBoolean(); if (credentialsChanged) { boolean hasCredentials = in.readBoolean(); if (hasCredentials) { credentials = new Credentials(); credentials.readFields(in); } } }
Credentials ts = new Credentials(); dis = new DataInputStream(in); ts.readFields(dis); for (Token<?> token : ts.getAllTokens()) { token.setKind(isHttps ? HsftpFileSystem.TOKEN_KIND : HftpFileSystem.TOKEN_KIND);
Credentials ts = new Credentials(); dis = new DataInputStream(in); ts.readFields(dis); for (Token<?> token : ts.getAllTokens()) { token.setKind(isHttps ? HsftpFileSystem.TOKEN_KIND : HftpFileSystem.TOKEN_KIND);
new DataInputStream(new FileInputStream(tmpFileName)); ts = new Credentials(); ts.readFields(dis); dis.close();