@Override public String getLoginUser() { return delegate.getLoginUser(); }
@Override public String getLoginUser() { return delegate.getLoginUser(); }
@Override public String getLoginUser() { return delegate.getLoginUser(); }
@Override public String getLoginUser() { return delegate.getLoginUser(); }
public static LoginCredentials overrideDefaultCredentialsWithOptionsIfPresent( @Nullable LoginCredentials defaultCreds, RunScriptOptions options) { Builder builder = LoginCredentials.builder(defaultCreds); if (options.getLoginUser() != null) builder.user(options.getLoginUser()); if (options.getLoginPassword() != null) builder.password(options.getLoginPassword()); if (options.getLoginPrivateKey() != null) builder.privateKey(options.getLoginPrivateKey()); if (options.shouldAuthenticateSudo() != null) builder.authenticateSudo(true); return builder.build(); }
public static LoginCredentials overrideDefaultCredentialsWithOptionsIfPresent( @Nullable LoginCredentials defaultCreds, RunScriptOptions options) { Builder builder = LoginCredentials.builder(defaultCreds); if (options.getLoginUser() != null) builder.user(options.getLoginUser()); if (options.getLoginPassword() != null) builder.password(options.getLoginPassword()); if (options.getLoginPrivateKey() != null) builder.privateKey(options.getLoginPrivateKey()); if (options.shouldAuthenticateSudo() != null) builder.authenticateSudo(true); return builder.build(); }
public static LoginCredentials overrideDefaultCredentialsWithOptionsIfPresent( @Nullable LoginCredentials defaultCreds, RunScriptOptions options) { Builder builder = LoginCredentials.builder(defaultCreds); if (options.getLoginUser() != null) builder.user(options.getLoginUser()); if (options.getLoginPassword() != null) builder.password(options.getLoginPassword()); if (options.getLoginPrivateKey() != null) builder.privateKey(options.getLoginPrivateKey()); if (options.shouldAuthenticateSudo() != null) builder.authenticateSudo(true); return builder.build(); }
public static LoginCredentials overrideDefaultCredentialsWithOptionsIfPresent( @Nullable LoginCredentials defaultCreds, RunScriptOptions options) { Builder builder = LoginCredentials.builder(defaultCreds); if (options.getLoginUser() != null) builder.user(options.getLoginUser()); if (options.getLoginPassword() != null) builder.password(options.getLoginPassword()); if (options.getLoginPrivateKey() != null) builder.privateKey(options.getLoginPrivateKey()); if (options.shouldAuthenticateSudo() != null) builder.authenticateSudo(true); return builder.build(); }
public Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching( ClusterSpec spec, Predicate<NodeMetadata> condition, Statement statement, RunScriptOptions options) throws IOException, RunScriptOnNodesException { LoginCredentials credentials = LoginCredentials.builder() .user(spec.getClusterUser()).privateKey(spec.getPrivateKey()).build(); if (options == null) { options = defaultRunScriptOptionsForSpec(spec); } else if (options.getLoginUser() == null) { options = options.overrideLoginCredentials(credentials); } condition = Predicates .and(runningInGroup(spec.getClusterName()), condition); ComputeServiceContext context = getCompute().apply(spec); return context.getComputeService().runScriptOnNodesMatching(condition, statement, options); }
public Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching( ClusterSpec spec, Predicate<NodeMetadata> condition, Statement statement, RunScriptOptions options) throws IOException, RunScriptOnNodesException { LoginCredentials credentials = LoginCredentials.builder() .user(spec.getClusterUser()).privateKey(spec.getPrivateKey()).build(); if (options == null) { options = defaultRunScriptOptionsForSpec(spec); } else if (options.getLoginUser() == null) { options = options.overrideLoginCredentials(credentials); } condition = Predicates .and(runningInGroup(spec.getClusterName()), condition); ComputeServiceContext context = getCompute().apply(spec); return context.getComputeService().runScriptOnNodesMatching(condition, statement, options); }
protected NodeMetadata updateNodeWithCredentialsIfPresent(NodeMetadata node, RunScriptOptions options) { checkNotNull(node, "node"); Builder builder = LoginCredentials.builder(node.getCredentials()); if (options.getLoginUser() != null) builder.user(options.getLoginUser()); if (options.hasLoginPasswordOption()) { if (options.hasLoginPassword()) { builder.password(options.getLoginPassword()); } else { builder.noPassword(); } } if (options.hasLoginPrivateKeyOption()) { if (options.hasLoginPrivateKey()) { builder.privateKey(options.getLoginPrivateKey()); } else { builder.noPrivateKey(); } } if (options.shouldAuthenticateSudo() != null) builder.authenticateSudo(true); return NodeMetadataBuilder.fromNodeMetadata(node).credentials(builder.build()).build(); }
protected NodeMetadata updateNodeWithCredentialsIfPresent(NodeMetadata node, RunScriptOptions options) { checkNotNull(node, "node"); Builder builder = LoginCredentials.builder(node.getCredentials()); if (options.getLoginUser() != null) builder.user(options.getLoginUser()); if (options.hasLoginPasswordOption()) { if (options.hasLoginPassword()) { builder.password(options.getLoginPassword()); } else { builder.noPassword(); } } if (options.hasLoginPrivateKeyOption()) { if (options.hasLoginPrivateKey()) { builder.privateKey(options.getLoginPrivateKey()); } else { builder.noPrivateKey(); } } if (options.shouldAuthenticateSudo() != null) builder.authenticateSudo(true); return NodeMetadataBuilder.fromNodeMetadata(node).credentials(builder.build()).build(); }
protected NodeMetadata updateNodeWithCredentialsIfPresent(NodeMetadata node, RunScriptOptions options) { checkNotNull(node, "node"); Builder builder = LoginCredentials.builder(node.getCredentials()); if (options.getLoginUser() != null) builder.user(options.getLoginUser()); if (options.hasLoginPasswordOption()) { if (options.hasLoginPassword()) { builder.password(options.getLoginPassword()); } else { builder.noPassword(); } } if (options.hasLoginPrivateKeyOption()) { if (options.hasLoginPrivateKey()) { builder.privateKey(options.getLoginPrivateKey()); } else { builder.noPrivateKey(); } } if (options.shouldAuthenticateSudo() != null) builder.authenticateSudo(true); return NodeMetadataBuilder.fromNodeMetadata(node).credentials(builder.build()).build(); }
protected NodeMetadata updateNodeWithCredentialsIfPresent(NodeMetadata node, RunScriptOptions options) { checkNotNull(node, "node"); Builder builder = LoginCredentials.builder(node.getCredentials()); if (options.getLoginUser() != null) builder.user(options.getLoginUser()); if (options.hasLoginPasswordOption()) { if (options.hasLoginPassword()) { builder.password(options.getLoginPassword()); } else { builder.noPassword(); } } if (options.hasLoginPrivateKeyOption()) { if (options.hasLoginPrivateKey()) { builder.privateKey(options.getLoginPrivateKey()); } else { builder.noPrivateKey(); } } if (options.shouldAuthenticateSudo() != null) builder.authenticateSudo(true); return NodeMetadataBuilder.fromNodeMetadata(node).credentials(builder.build()).build(); }
public LoginCredentials apply(Template template, LoginCredentials fromNode) { RunScriptOptions options = checkNotNull(template.getOptions(), "template options are required"); LoginCredentials.Builder builder = LoginCredentials.builder(fromNode); if (options.getLoginUser() != null) builder.user(template.getOptions().getLoginUser()); if (options.getLoginPassword() != null) builder.password(options.getLoginPassword()); if (options.getLoginPrivateKey() != null) builder.privateKey(options.getLoginPrivateKey()); if (options.shouldAuthenticateSudo() != null && options.shouldAuthenticateSudo()) builder.authenticateSudo(true); return builder.build(); } }
public LoginCredentials apply(Template template, LoginCredentials fromNode) { RunScriptOptions options = checkNotNull(template.getOptions(), "template options are required"); LoginCredentials.Builder builder = LoginCredentials.builder(fromNode); if (options.getLoginUser() != null) builder.user(template.getOptions().getLoginUser()); if (options.getLoginPassword() != null) builder.password(options.getLoginPassword()); if (options.getLoginPrivateKey() != null) builder.privateKey(options.getLoginPrivateKey()); if (options.shouldAuthenticateSudo() != null && options.shouldAuthenticateSudo()) builder.authenticateSudo(true); return builder.build(); } }
public LoginCredentials apply(final Template template, final LoginCredentials fromNode) { final RunScriptOptions options = checkNotNull(template.getOptions(), "template options are required"); final LoginCredentials.Builder builder = LoginCredentials.builder(fromNode); if (options.getLoginUser() != null) { builder.user(template.getOptions().getLoginUser()); } if (options.getLoginPassword() != null) { builder.password(options.getLoginPassword()); } if (options.getLoginPrivateKey() != null) { builder.privateKey(options.getLoginPrivateKey()); } if (options.shouldAuthenticateSudo() != null && options.shouldAuthenticateSudo()) { builder.authenticateSudo(true); } return builder.build(); } }
public void copyTo(RunScriptOptions to) { if (this.getPort() != -1) to.blockOnPort(this.getPort(), this.getSeconds()); if (this.getTaskName() != null) to.nameTask(this.getTaskName()); to.runAsRoot(this.shouldRunAsRoot()); to.blockOnComplete(this.shouldBlockOnComplete()); to.wrapInInitScript(this.shouldWrapInInitScript()); if (this.hasLoginPasswordOption()) to.overrideLoginPassword(this.loginPassword); if (this.hasLoginPrivateKeyOption()) to.overrideLoginPrivateKey(this.loginPrivateKey); if (this.getLoginUser() != null) to.overrideLoginUser(this.getLoginUser()); if (this.shouldAuthenticateSudo() != null) { to.overrideAuthenticateSudo(this.shouldAuthenticateSudo()); } }
public void copyTo(RunScriptOptions to) { if (this.getPort() != -1) to.blockOnPort(this.getPort(), this.getSeconds()); if (this.getTaskName() != null) to.nameTask(this.getTaskName()); to.runAsRoot(this.shouldRunAsRoot()); to.blockOnComplete(this.shouldBlockOnComplete()); to.wrapInInitScript(this.shouldWrapInInitScript()); if (this.hasLoginPasswordOption()) to.overrideLoginPassword(this.loginPassword); if (this.hasLoginPrivateKeyOption()) to.overrideLoginPrivateKey(this.loginPrivateKey); if (this.getLoginUser() != null) to.overrideLoginUser(this.getLoginUser()); if (this.shouldAuthenticateSudo() != null) { to.overrideAuthenticateSudo(this.shouldAuthenticateSudo()); } }