/** * {@inheritDoc} */ @Override public ExecResponse runScriptOnNode(String id, Statement runScript, RunScriptOptions options) { NodeMetadata node = this.getNodeMetadata(id); if (node == null) throw new NoSuchElementException(id); if (node.getStatus() != Status.RUNNING) throw new IllegalStateException("node " + id + " needs to be running before executing a script on it. current state: " + formatStatus(node)); initAdminAccess.visit(runScript); node = updateNodeWithCredentialsIfPresent(node, options); ExecResponse response = runScriptOnNodeFactory.create(node, runScript, options).init().call(); persistNodeCredentials.ifAdminAccess(runScript).apply(node); return response; }
/** * {@inheritDoc} */ @Override public ExecResponse runScriptOnNode(String id, Statement runScript, RunScriptOptions options) { NodeMetadata node = this.getNodeMetadata(id); if (node == null) throw new NoSuchElementException(id); if (node.getStatus() != Status.RUNNING) throw new IllegalStateException("node " + id + " needs to be running before executing a script on it. current state: " + formatStatus(node)); initAdminAccess.visit(runScript); node = updateNodeWithCredentialsIfPresent(node, options); ExecResponse response = runScriptOnNodeFactory.create(node, runScript, options).init().call(); persistNodeCredentials.ifAdminAccess(runScript).apply(node); return response; }
/** * {@inheritDoc} */ @Override public ListenableFuture<ExecResponse> submitScriptOnNode(String id, final Statement runScript, RunScriptOptions options) { NodeMetadata node = this.getNodeMetadata(id); if (node == null) throw new NoSuchElementException(id); if (node.getStatus() != Status.RUNNING) throw new IllegalStateException("node " + id + " needs to be running before executing a script on it. current state: " + formatStatus(node)); initAdminAccess.visit(runScript); final NodeMetadata node1 = updateNodeWithCredentialsIfPresent(node, options); ListenableFuture<ExecResponse> response = runScriptOnNodeFactory.submit(node1, runScript, options); response.addListener(new Runnable() { public void run() { persistNodeCredentials.ifAdminAccess(runScript).apply(node1); } }, userExecutor); return response; }
/** * {@inheritDoc} */ @Override public ExecResponse runScriptOnNode(String id, Statement runScript, RunScriptOptions options) { NodeMetadata node = this.getNodeMetadata(id); if (node == null) throw new NoSuchElementException(id); if (node.getStatus() != Status.RUNNING) throw new IllegalStateException("node " + id + " needs to be running before executing a script on it. current state: " + formatStatus(node)); initAdminAccess.visit(runScript); node = updateNodeWithCredentialsIfPresent(node, options); ExecResponse response = runScriptOnNodeFactory.create(node, runScript, options).init().call(); persistNodeCredentials.ifAdminAccess(runScript).apply(node); return response; }
/** * {@inheritDoc} */ @Override public ExecResponse runScriptOnNode(String id, Statement runScript, RunScriptOptions options) { NodeMetadata node = this.getNodeMetadata(id); if (node == null) throw new NoSuchElementException(id); if (node.getStatus() != Status.RUNNING) throw new IllegalStateException("node " + id + " needs to be running before executing a script on it. current state: " + formatStatus(node)); initAdminAccess.visit(runScript); node = updateNodeWithCredentialsIfPresent(node, options); ExecResponse response = runScriptOnNodeFactory.create(node, runScript, options).init().call(); persistNodeCredentials.ifAdminAccess(runScript).apply(node); return response; }
/** * {@inheritDoc} */ @Override public ListenableFuture<ExecResponse> submitScriptOnNode(String id, final Statement runScript, RunScriptOptions options) { NodeMetadata node = this.getNodeMetadata(id); if (node == null) throw new NoSuchElementException(id); if (node.getStatus() != Status.RUNNING) throw new IllegalStateException("node " + id + " needs to be running before executing a script on it. current state: " + formatStatus(node)); initAdminAccess.visit(runScript); final NodeMetadata node1 = updateNodeWithCredentialsIfPresent(node, options); ListenableFuture<ExecResponse> response = runScriptOnNodeFactory.submit(node1, runScript, options); response.addListener(new Runnable() { public void run() { persistNodeCredentials.ifAdminAccess(runScript).apply(node1); } }, userExecutor); return response; }
/** * {@inheritDoc} */ @Override public ListenableFuture<ExecResponse> submitScriptOnNode(String id, final Statement runScript, RunScriptOptions options) { NodeMetadata node = this.getNodeMetadata(id); if (node == null) throw new NoSuchElementException(id); if (node.getStatus() != Status.RUNNING) throw new IllegalStateException("node " + id + " needs to be running before executing a script on it. current state: " + formatStatus(node)); initAdminAccess.visit(runScript); final NodeMetadata node1 = updateNodeWithCredentialsIfPresent(node, options); ListenableFuture<ExecResponse> response = runScriptOnNodeFactory.submit(node1, runScript, options); response.addListener(new Runnable() { public void run() { persistNodeCredentials.ifAdminAccess(runScript).apply(node1); } }, userExecutor); return response; }
/** * {@inheritDoc} */ @Override public ListenableFuture<ExecResponse> submitScriptOnNode(String id, final Statement runScript, RunScriptOptions options) { NodeMetadata node = this.getNodeMetadata(id); if (node == null) throw new NoSuchElementException(id); if (node.getStatus() != Status.RUNNING) throw new IllegalStateException("node " + id + " needs to be running before executing a script on it. current state: " + formatStatus(node)); initAdminAccess.visit(runScript); final NodeMetadata node1 = updateNodeWithCredentialsIfPresent(node, options); ListenableFuture<ExecResponse> response = runScriptOnNodeFactory.submit(node1, runScript, options); response.addListener(new Runnable() { public void run() { persistNodeCredentials.ifAdminAccess(runScript).apply(node1); } }, userExecutor); return response; }