/** * Retrieve all the key-value pairs in a workflow run's {@link WorkflowToken} that were set by the specified node. * * @param workflowRunId the run id of the workflow * @param nodeName the name of the node * @return {@link WorkflowTokenNodeDetail} containing all the key-value pairs set by the specified node in the * specified workflow run's {@link WorkflowToken} */ public WorkflowTokenNodeDetail getWorkflowTokenAtNode(ProgramRunId workflowRunId, String nodeName) throws UnauthenticatedException, IOException, NotFoundException, UnauthorizedException { return getWorkflowTokenAtNode(workflowRunId, nodeName, null, null); }
/** * Retrieve the specified key set by the specified node in a specified workflow run's {@link WorkflowToken}. * * @param workflowRunId the run id of the workflow * @param nodeName the name of the node * @param key the specified key * @return {@link WorkflowTokenNodeDetail} containing the specified key set by the specified node with the * specified {@link WorkflowToken.Scope}in the specified workflow run's {@link WorkflowToken} */ public WorkflowTokenNodeDetail getWorkflowTokenAtNode(ProgramRunId workflowRunId, String nodeName, String key) throws UnauthenticatedException, IOException, NotFoundException, UnauthorizedException { return getWorkflowTokenAtNode(workflowRunId, nodeName, null, key); }
/** * Retrieve all the key-value pairs in a workflow run's {@link WorkflowToken} that were set by the specified node * in the specified {@link WorkflowToken.Scope}. * * @param workflowRunId the run id of the workflow * @param nodeName the name of the node * @param scope the specified {@link WorkflowToken.Scope} * @return {@link WorkflowTokenNodeDetail} containing all the keys set by the specified node with the * specified {@link WorkflowToken.Scope}in the specified workflow run's {@link WorkflowToken} */ public WorkflowTokenNodeDetail getWorkflowTokenAtNode(ProgramRunId workflowRunId, String nodeName, WorkflowToken.Scope scope) throws UnauthenticatedException, IOException, NotFoundException, UnauthorizedException { return getWorkflowTokenAtNode(workflowRunId, nodeName, scope, null); }
@Override public WorkflowTokenNodeDetail getTokenAtNode(String runId, String nodeName, @Nullable WorkflowToken.Scope scope, @Nullable String key) throws NotFoundException { try { return workflowClient.getWorkflowTokenAtNode(workflowId.run(runId), nodeName, scope, key); } catch (IOException | UnauthenticatedException | UnauthorizedException e) { throw Throwables.propagate(e); } }
private Table getWorkflowToken(ProgramRunId runId, WorkflowToken.Scope workflowTokenScope, String key, String nodeName) throws UnauthenticatedException, IOException, NotFoundException, UnauthorizedException { WorkflowTokenNodeDetail workflowToken = workflowClient.getWorkflowTokenAtNode(runId, nodeName, workflowTokenScope, key); List<Map.Entry<String, String>> tokenKeys = new ArrayList<>(); tokenKeys.addAll(workflowToken.getTokenDataAtNode().entrySet()); return Table.builder() .setHeader("token key", "token value") .setRows(tokenKeys, new RowMaker<Map.Entry<String, String>>() { @Override public List<?> makeRow(Map.Entry<String, String> object) { return Lists.newArrayList(object.getKey(), object.getValue()); } }) .build(); } }
private Table getWorkflowToken(ProgramRunId runId, WorkflowToken.Scope workflowTokenScope, String key, String nodeName) throws UnauthenticatedException, IOException, NotFoundException, UnauthorizedException { WorkflowTokenNodeDetail workflowToken = workflowClient.getWorkflowTokenAtNode(runId, nodeName, workflowTokenScope, key); List<Map.Entry<String, String>> tokenKeys = new ArrayList<>(); tokenKeys.addAll(workflowToken.getTokenDataAtNode().entrySet()); return Table.builder() .setHeader("token key", "token value") .setRows(tokenKeys, new RowMaker<Map.Entry<String, String>>() { @Override public List<?> makeRow(Map.Entry<String, String> object) { return Lists.newArrayList(object.getKey(), object.getValue()); } }) .build(); } }