From 6e1c4e6a0e0b3fdf295c528397a3f7c477e6ae08 Mon Sep 17 00:00:00 2001 From: Corneil du Plessis Date: Tue, 19 Sep 2023 18:26:51 +0200 Subject: [PATCH] Updated javadoc entries --- build-docs.sh | 4 +- has-javadoc.sh | 19 +++++- ...MappingJwtGrantedAuthoritiesConverter.java | 2 +- spring-cloud-dataflow-classic-docs/pom.xml | 1 - .../ComposedBatchConfigurer.java | 1 + .../cloud/dataflow/core/dsl/StreamParser.java | 8 +-- .../cloud/dataflow/core/dsl/TaskVisitor.java | 4 +- .../dataflow/core/dsl/TransitionNode.java | 12 ++-- spring-cloud-dataflow-docs/pom.xml | 2 +- .../dataflow/rest/client/JobOperations.java | 13 ++-- .../dataflow/rest/client/TaskOperations.java | 39 ++++++----- .../dataflow/rest/client/dsl/task/Task.java | 55 +++++++++------- .../server/service/TaskExecutionService.java | 27 +++++--- .../server/service/TaskJobService.java | 66 ++++++++++++------- .../skipper/domain/ActuatorPostRequest.java | 9 ++- .../support/yaml/DefaultYamlConverter.java | 2 +- 16 files changed, 157 insertions(+), 107 deletions(-) diff --git a/build-docs.sh b/build-docs.sh index ab537fe181..306d9a3594 100755 --- a/build-docs.sh +++ b/build-docs.sh @@ -2,7 +2,5 @@ SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") SCDIR=$(realpath $SCDIR) pushd "$SCDIR" > /dev/null || exit - ./mvnw install -DskipTests -T 1C - ./mvnw install -o -Pfull,asciidoctordocs,restdocs -pl :spring-cloud-dataflow-classic-docs,:spring-cloud-dataflow-docs - ./mvnw install -o -Pasciidoctordocs,restdocs -pl :spring-cloud-skipper-server-core,:spring-cloud-skipper-docs + ./mvnw install -DskipTests -am -pl :spring-cloud-dataflow-classic-docs,:spring-cloud-dataflow-docs,:spring-cloud-skipper-server-core,:spring-cloud-skipper-docs -Pfull,asciidoctordocs,restdocs popd > /dev/null || exit diff --git a/has-javadoc.sh b/has-javadoc.sh index fa71fb2ec8..f5836cc851 100755 --- a/has-javadoc.sh +++ b/has-javadoc.sh @@ -10,13 +10,28 @@ function check_jars() { VERSION=$3 set +e RESULT=$(ls -1a "$TARGET_DIR/" 2> /dev/null) + CLASS_COUNT=-1 if [[ "$RESULT" != *"-$VERSION-javadoc.jar"* ]]; then + echo "Checking for classes in $TARGET" + CLASS_COUNT=$(jar -t -f "$TARGET" | grep -c "\.class") COUNT_MISSING_JAVADOC=$((1 + COUNT_MISSING_JAVADOC)) - echo "No javadoc for $TARGET_DIR" + if ((CLASS_COUNT <= 0)); then + echo "No classes and no javadoc jar for $TARGET_DIR" + else + echo "No javadoc jar for $TARGET_DIR" + fi fi if [[ "$RESULT" != *"-$VERSION-sources.jar"* ]]; then COUNT_MISSING_SOURCES=$((1 + COUNT_MISSING_SOURCES)) - echo "No sources for $TARGET_DIR" + if((CLASS_COUNT < 0)); then + echo "Checking for classes in $TARGET" + CLASS_COUNT=$(jar -t -f "$TARGET" | grep -c "\.class") + fi + if ((CLASS_COUNT <= 0)); then + echo "No classes and no sources for $TARGET_DIR" + else + echo "No sources jar for $TARGET_DIR" + fi fi } VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) diff --git a/spring-cloud-common-security-config/spring-cloud-common-security-config-web/src/main/java/org/springframework/cloud/common/security/support/MappingJwtGrantedAuthoritiesConverter.java b/spring-cloud-common-security-config/spring-cloud-common-security-config-web/src/main/java/org/springframework/cloud/common/security/support/MappingJwtGrantedAuthoritiesConverter.java index a12c0daeed..e31c908e8a 100644 --- a/spring-cloud-common-security-config/spring-cloud-common-security-config-web/src/main/java/org/springframework/cloud/common/security/support/MappingJwtGrantedAuthoritiesConverter.java +++ b/spring-cloud-common-security-config/spring-cloud-common-security-config-web/src/main/java/org/springframework/cloud/common/security/support/MappingJwtGrantedAuthoritiesConverter.java @@ -127,7 +127,7 @@ public void setAuthoritiesMapping(Map authoritiesMapping) { /** * Sets the name of token claim to use for group mapping {@link GrantedAuthority * authorities} by this converter. Defaults to - * {@link JwtGrantedAuthoritiesConverter#WELL_KNOWN_GROUPS_CLAIM_NAMES}. + * {@link org.springframework.security.oauth2.server.resource.authentication.JwtGrantedAuthoritiesConverter#WELL_KNOWN_AUTHORITIES_CLAIM_NAMES}. * * @param groupAuthoritiesClaimName the token claim name to map group * authorities diff --git a/spring-cloud-dataflow-classic-docs/pom.xml b/spring-cloud-dataflow-classic-docs/pom.xml index d14c3b1391..ddb861f5da 100644 --- a/spring-cloud-dataflow-classic-docs/pom.xml +++ b/spring-cloud-dataflow-classic-docs/pom.xml @@ -10,7 +10,6 @@ spring-cloud-dataflow-classic-docs Spring Cloud Data Flow Docs for Classic mode Spring Cloud Data Flow Docs for Classic Mode - pom org.springframework.cloud diff --git a/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedBatchConfigurer.java b/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedBatchConfigurer.java index f1611ffffb..f98b372ce9 100644 --- a/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedBatchConfigurer.java +++ b/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedBatchConfigurer.java @@ -55,6 +55,7 @@ public class ComposedBatchConfigurer extends BasicBatchConfigurer { * @param dataSource the underlying data source * @param transactionManagerCustomizers transaction manager customizers (or * {@code null}) + * @param composedTaskProperties composed task properties */ protected ComposedBatchConfigurer(BatchProperties properties, DataSource dataSource, TransactionManagerCustomizers transactionManagerCustomizers, ComposedTaskProperties composedTaskProperties) { diff --git a/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/StreamParser.java b/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/StreamParser.java index 092bb3bf44..a0eb30deef 100644 --- a/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/StreamParser.java +++ b/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/StreamParser.java @@ -256,7 +256,7 @@ else if (t.getKind() == TokenKind.PIPE) { return null; } - DestinationNode destinationNode = eatDestinationReference(false); + DestinationNode destinationNode = eatDestinationReference(); if (destinationNode == null) { return null; } @@ -279,7 +279,7 @@ protected SinkDestinationNode eatSinkDestination() { SinkDestinationNode SinkDestinationNode = null; if (tokens.peek(TokenKind.GT)) { Token gt = tokens.eat(TokenKind.GT); - DestinationNode destinationNode = eatDestinationReference(false); + DestinationNode destinationNode = eatDestinationReference(); if (destinationNode == null) { return null; } @@ -317,7 +317,7 @@ protected String getTokenData(Token token) { * * @return {@code DestinationNode} representing the destination reference */ - protected DestinationNode eatDestinationReference(boolean canDefault) { + protected DestinationNode eatDestinationReference() { Tokens tokens = getTokens(); Token firstToken = tokens.next(); if (!firstToken.isKind(TokenKind.COLON)) { @@ -366,7 +366,7 @@ protected DestinationNode eatDestinationReference(boolean canDefault) { *

* Expected formats: {@code appList: app (| app)*} A stream may end in an app (if it is * a sink) or be followed by a sink destination. - * + * @param preceedingSourceChannelSpecified indicator to parser about state of stream. * @return a list of {@code AppNode} */ protected List eatAppList(boolean preceedingSourceChannelSpecified) { diff --git a/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/TaskVisitor.java b/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/TaskVisitor.java index 41db7e373c..6a51f4a595 100644 --- a/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/TaskVisitor.java +++ b/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/TaskVisitor.java @@ -32,7 +32,7 @@ * * This includes two sequences - as in two separate definitions. The primary definition * references other definitions where it would be too messy to inline them. In this case - * preVisit(int) would be called for both 0 and 1. + * {@link #preVisit(FlowNode)} would be called. * * @author Andy Clement */ @@ -112,7 +112,7 @@ public void postVisit(TaskAppNode taskApp) { } /** - * After visit(TaskAppNode) and before postVisit(TaskAppNode) the + * After {@link #visit(TaskAppNode)} and before {@link #postVisit(TaskAppNode)} the * transitions (if there are any) are visited for that task app. * * @param transition the transition diff --git a/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/TransitionNode.java b/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/TransitionNode.java index 58f0558585..e92946b277 100644 --- a/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/TransitionNode.java +++ b/spring-cloud-dataflow-core-dsl/src/main/java/org/springframework/cloud/dataflow/core/dsl/TransitionNode.java @@ -18,12 +18,12 @@ /** * An AST node representing a transition found in a parsed task specification. A - * transition is expressed in the form "{@code STATE->TARGET}". If STATE is + * transition is expressed in the form "{@code STATE->TARGET}". If {@code STATE} is * unquoted it is considered a reference to the exit code of the preceding app (where - * * means 'any exit code'). If STATE is quoted it is considered a - * reference to the exit status of the preceding app (where '*' means 'any exit - * status'). TARGET can be either a reference to a label, :foo, or a single app - * name Foo. + * {@code *} means 'any exit code'). If {@code STATE} is quoted it is considered a + * reference to the exit status of the preceding app (where {@code '*'} means 'any exit + * status'). TARGET can be either a reference to a label, {@code :foo}, or a single app + * name {@code Foo}. * * @author Andy Clement */ @@ -134,8 +134,6 @@ public String getStatusToCheckInDSLForm() { } /** - * The target is either an app or a reference. If it is an app then call - * getTargetApp otherwise call getTargetReference. * * @return true if the target is an app */ diff --git a/spring-cloud-dataflow-docs/pom.xml b/spring-cloud-dataflow-docs/pom.xml index 8b5d834a54..52e5af4a88 100644 --- a/spring-cloud-dataflow-docs/pom.xml +++ b/spring-cloud-dataflow-docs/pom.xml @@ -10,7 +10,7 @@ spring-cloud-dataflow-docs Spring Cloud Data Flow Docs Spring Cloud Data Flow Docs - pom + jar ${basedir}/.. 0.2.5 diff --git a/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/JobOperations.java b/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/JobOperations.java index bf189619b0..9f531aa6aa 100644 --- a/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/JobOperations.java +++ b/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/JobOperations.java @@ -38,7 +38,8 @@ public interface JobOperations { /** * Restarts a job by id * - * @param id job execution id + * @param id job execution id + * @param schemaTarget the schema target for the job execution */ void executionRestart(long id, String schemaTarget); @@ -72,7 +73,8 @@ public interface JobOperations { /** * Return the {@link JobExecutionResource} for the id specified. * - * @param id identifier of the job execution + * @param id identifier of the job execution + * @param schemaTarget the schema target for the job execution * @return {@link JobExecutionResource} */ JobExecutionResource jobExecution(long id, String schemaTarget); @@ -80,7 +82,8 @@ public interface JobOperations { /** * Return the {@link JobInstanceResource} for the id specified. * - * @param id identifier of the job instasnce + * @param id identifier of the job instance + * @param schemaTarget the schema target for the job instance * @return {@link JobInstanceResource} */ JobInstanceResource jobInstance(long id, String schemaTarget); @@ -89,6 +92,7 @@ public interface JobOperations { * List step executions known for a specific job execution id. * * @param jobExecutionId the id of the job execution. + * @param schemaTarget the schema target for the job execution * @return the paged list of step executions */ PagedModel stepExecutionList(long jobExecutionId, String schemaTarget); @@ -97,8 +101,9 @@ public interface JobOperations { * Return StepExecutionProgressInfoResource for a specific job execution id and step * execution Id. * - * @param jobExecutionId the id of the job execution for the step to be returned. + * @param jobExecutionId the id of the job execution for the step to be returned. * @param stepExecutionId the id step execution to be returned. + * @param schemaTarget the schema target of the job execution. * @return the step execution progress info */ StepExecutionProgressInfoResource stepExecutionProgress(long jobExecutionId, long stepExecutionId, String schemaTarget); diff --git a/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/TaskOperations.java b/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/TaskOperations.java index ac9c40a085..1d87c3c6ab 100644 --- a/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/TaskOperations.java +++ b/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/TaskOperations.java @@ -54,8 +54,8 @@ public interface TaskOperations { /** * Create a new task definition * - * @param name the name of the task - * @param definition the task definition DSL + * @param name the name of the task + * @param definition the task definition DSL * @param description the description of the task definition * @return the task definition */ @@ -64,9 +64,9 @@ public interface TaskOperations { /** * Launch an already created task. * - * @param name the name of the task + * @param name the name of the task * @param properties the deployment properties - * @param arguments the command line arguments + * @param arguments the command line arguments * @return long containing the TaskExecutionId */ LaunchResponseResource launch(String name, Map properties, List arguments); @@ -74,15 +74,17 @@ public interface TaskOperations { /** * Request the stop of a group {@link org.springframework.cloud.task.repository.TaskExecution}s. * - * @param ids comma delimited set of {@link org.springframework.cloud.task.repository.TaskExecution} ids to stop. + * @param ids comma delimited set of {@link org.springframework.cloud.task.repository.TaskExecution} ids to stop. + * @param schemaTarget the schema target of the task execution. */ void stop(String ids, String schemaTarget); /** * Request the stop of a group {@link org.springframework.cloud.task.repository.TaskExecution}s. * - * @param ids comma delimited set of {@link org.springframework.cloud.task.repository.TaskExecution} ids to stop. - * @param platform the platform name where the task is executing. + * @param ids comma delimited set of {@link org.springframework.cloud.task.repository.TaskExecution} ids to stop. + * @param schemaTarget the schema target of the task execution. + * @param platform the platform name where the task is executing. */ void stop(String ids, String schemaTarget, String platform); @@ -96,7 +98,7 @@ public interface TaskOperations { /** * Destroy an existing task with the flag to cleanup task resources. * - * @param name the name of the task + * @param name the name of the task * @param cleanup flag indicates task execution cleanup */ void destroy(String name, boolean cleanup); @@ -117,7 +119,8 @@ public interface TaskOperations { /** * Return the {@link TaskExecutionResource} for the id specified. * - * @param id identifier of the task execution + * @param id identifier of the task execution + * @param schemaTarget the schema target of the task execution. * @return {@link TaskExecutionResource} */ TaskExecutionResource taskExecutionStatus(long id, String schemaTarget); @@ -134,7 +137,7 @@ public interface TaskOperations { * Return the task execution log. * * @param externalExecutionId the external execution identifier of the task execution. - * @param platform the platform from which to obtain the log. + * @param platform the platform from which to obtain the log. * @return {@link String} containing the log. */ String taskExecutionLog(String externalExecutionId, String platform); @@ -142,6 +145,7 @@ public interface TaskOperations { /** * Return information including the count of currently executing tasks and task execution * limits. + * * @return Collection of {@link CurrentTaskExecutionsResource} */ Collection currentTaskExecutions(); @@ -149,15 +153,17 @@ public interface TaskOperations { /** * Cleanup any resources associated with the execution for the id specified. * - * @param id identifier of the task execution + * @param id identifier of the task execution + * @param schemaTarget the schema target of the task execution. */ void cleanup(long id, String schemaTarget); /** * Cleanup any resources associated with the execution for the id specified. * - * @param id identifier of the task execution - * @param removeData delete the history of the execution + * @param id identifier of the task execution + * @param schemaTarget the schema target of the task execution. + * @param removeData delete the history of the execution */ void cleanup(long id, String schemaTarget, boolean removeData); @@ -166,20 +172,22 @@ public interface TaskOperations { * Cleanup any resources associated with the matching task executions. * * @param completed cleanup only completed task executions - * @param taskName the name of the task to cleanup, if null then all the tasks are considered. + * @param taskName the name of the task to cleanup, if null then all the tasks are considered. */ void cleanupAllTaskExecutions(boolean completed, String taskName); /** * Get the task executions count with the option to filter only the completed task executions. + * * @param completed cleanup only completed task executions - * @param taskName the name of the task to cleanup, if null then all the tasks are considered. + * @param taskName the name of the task to cleanup, if null then all the tasks are considered. * @return the number of task executions. */ Integer getAllTaskExecutionsCount(boolean completed, String taskName); /** * Return the validation status for the tasks in an definition. + * * @param taskDefinitionName The name of the task definition to be validated. * @return {@link TaskAppStatusResource} containing the task app statuses. * @throws OperationNotSupportedException if the server does not support task validation @@ -188,7 +196,6 @@ public interface TaskOperations { /** * Destroy all existing tasks. - * */ void destroyAll(); } diff --git a/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/dsl/task/Task.java b/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/dsl/task/Task.java index 56b0b3928e..1530bdf5c0 100644 --- a/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/dsl/task/Task.java +++ b/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/dsl/task/Task.java @@ -23,7 +23,6 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; -import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -162,13 +161,13 @@ public LaunchResponseResource launch(Map properties, List> idTargets = executions().stream() - .filter(Objects::nonNull) - .filter(e -> e.getTaskExecutionStatus() == TaskExecutionStatus.RUNNING) - .collect(Collectors.groupingBy(TaskExecutionResource::getSchemaTarget, Collectors.toSet())); + .filter(Objects::nonNull) + .filter(e -> e.getTaskExecutionStatus() == TaskExecutionStatus.RUNNING) + .collect(Collectors.groupingBy(TaskExecutionResource::getSchemaTarget, Collectors.toSet())); idTargets.forEach((schemaTarget, tasks) -> { String ids = tasks.stream() - .map(taskExecutionResource -> String.valueOf(taskExecutionResource.getExecutionId())) - .collect(Collectors.joining(",")); + .map(taskExecutionResource -> String.valueOf(taskExecutionResource.getExecutionId())) + .collect(Collectors.joining(",")); this.taskOperations.stop(ids, schemaTarget); }); } @@ -176,14 +175,15 @@ public void stop() { /** * Stop a list of {@link org.springframework.cloud.task.repository.TaskExecution}s. * + * @param schemaTarget the schema target of the task executions. * @param taskExecutionIds List of {@link org.springframework.cloud.task.repository.TaskExecution} ids to stop. *

* Note: this functionality is platform dependent! It works for local platform but does nothing on K8s! */ public void stop(String schemaTarget, long... taskExecutionIds) { String commaSeparatedIds = Stream.of(taskExecutionIds) - .map(String::valueOf) - .collect(Collectors.joining(",")); + .map(String::valueOf) + .collect(Collectors.joining(",")); if (StringUtils.hasText(commaSeparatedIds)) { this.taskOperations.stop(commaSeparatedIds, schemaTarget); } @@ -212,7 +212,8 @@ public Collection executions() { /** * Retrieve task execution by Id. * - * @param executionId Task execution Id + * @param executionId Task execution Id + * @param schemaTarget the schema target of the task execution. * @return Task executions for the given task execution id. */ public Optional execution(long executionId, String schemaTarget) { @@ -223,25 +224,27 @@ public Optional execution(long executionId, String schema * Find {@link TaskExecutionResource} by a parent execution id. * * @param parentExecutionId parent task execution id. + * @param schemaTarget the schema target of the parent execution. * @return Return TaskExecutionResource */ public Optional executionByParentExecutionId(long parentExecutionId, String schemaTarget) { return this.executions().stream() - .filter(Objects::nonNull) - .filter(e -> e.getParentExecutionId() == parentExecutionId && e.getSchemaTarget().equals(schemaTarget)) - .findFirst(); + .filter(Objects::nonNull) + .filter(e -> e.getParentExecutionId() == parentExecutionId && e.getSchemaTarget().equals(schemaTarget)) + .findFirst(); } /** * Task execution status * - * @param executionId execution Id + * @param executionId execution Id. + * @param schemaTarget the schema target of the execution. * @return returns the task execution status. */ public TaskExecutionStatus executionStatus(long executionId, String schemaTarget) { return this.execution(executionId, schemaTarget) - .map(TaskExecutionResource::getTaskExecutionStatus) - .orElse(TaskExecutionStatus.UNKNOWN); + .map(TaskExecutionResource::getTaskExecutionStatus) + .orElse(TaskExecutionStatus.UNKNOWN); } /** @@ -256,12 +259,12 @@ public boolean isComposed() { */ public List composedTaskChildTasks() { return !isComposed() ? - new ArrayList<>() : - this.taskOperations.list().getContent().stream() - .filter(Objects::nonNull) - .filter(t -> t.getName().startsWith(this.taskName + "-")) - .map(t -> new Task(t.getName(), this.dataFlowOperations)) - .collect(Collectors.toList()); + new ArrayList<>() : + this.taskOperations.list().getContent().stream() + .filter(Objects::nonNull) + .filter(t -> t.getName().startsWith(this.taskName + "-")) + .map(t -> new Task(t.getName(), this.dataFlowOperations)) + .collect(Collectors.toList()); } /** @@ -270,7 +273,7 @@ public List composedTaskChildTasks() { */ public Optional composedTaskChildTaskByLabel(String childTaskLabel) { return this.composedTaskChildTasks().stream() - .filter(childTask -> childTask.getTaskName().endsWith("-" + childTaskLabel)).findFirst(); + .filter(childTask -> childTask.getTaskName().endsWith("-" + childTaskLabel)).findFirst(); } @@ -291,6 +294,7 @@ public Collection thinkJobExecutionResources() { /** * @param jobExecutionId the job execution id. + * @param schemaTarget the schema target of the job execution. * @return Returns list of {@link StepExecutionResource} belonging to the job. */ public Collection jobStepExecutions(long jobExecutionId, String schemaTarget) { @@ -306,9 +310,9 @@ public Collection jobInstanceResources() { private Optional definitionResource() { return this.taskOperations.list().getContent().stream() - .filter(Objects::nonNull) - .filter(t -> t.getName().equals(this.taskName)) - .findFirst(); + .filter(Objects::nonNull) + .filter(t -> t.getName().equals(this.taskName)) + .findFirst(); } /** @@ -331,6 +335,7 @@ public void close() { * Remove specified task execution for the specified task execution id. * * @param taskExecutionId the id of the task execution to be removed. + * @param schemaTarget the schema target */ public void cleanupTaskExecution(long taskExecutionId, String schemaTarget) { this.taskOperations.cleanup(taskExecutionId, schemaTarget, true); diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/service/TaskExecutionService.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/service/TaskExecutionService.java index 07d1b99f29..27ff4473c2 100644 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/service/TaskExecutionService.java +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/service/TaskExecutionService.java @@ -39,9 +39,9 @@ public interface TaskExecutionService { /** * Execute a task with the provided task name and optional runtime properties. * - * @param taskName Name of the task. Must not be null or empty. + * @param taskName Name of the task. Must not be null or empty. * @param taskDeploymentProperties Optional deployment properties. Must not be null. - * @param commandLineArgs Optional runtime commandline argument + * @param commandLineArgs Optional runtime commandline argument * @return the taskExecutionId for the executed task. */ LaunchResponse executeTask(String taskName, Map taskDeploymentProperties, List commandLineArgs); @@ -50,7 +50,7 @@ public interface TaskExecutionService { * Retrieve logs for the task application. * * @param platformName the name of the platform - * @param taskId the ID that uniquely identifies the task + * @param taskId the ID that uniquely identifies the task * @return the logs of the task application. */ String getLog(String platformName, String taskId, String schemaTarget); @@ -65,30 +65,36 @@ public interface TaskExecutionService { /** * Request the platform to stop the task executions for the ids provided. * - * @param ids a set of ids for the task executions to be stopped. - * @param platform The name of the platform where the tasks are executing. + * @param ids a set of ids for the task executions to be stopped. + * @param schemaTarget the schema target of the task execution. + * @param platform The name of the platform where the tasks are executing. */ void stopTaskExecution(Set ids, String schemaTarget, String platform); /** * Retrieve the TaskManifest for the execution id provided - * @param id task exectution id + * + * @param id task exectution id + * @param schemaTarget the schema target of the task execution. * @return {@code TaskManifest} or null if not found. */ TaskManifest findTaskManifestById(Long id, String schemaTarget); /** * Returns all the task execution IDs with the option to include only the completed task executions. + * * @param onlyCompleted filter by completed task executions - * @param taskName the task name, if null then retrieve all the tasks + * @param taskName the task name, if null then retrieve all the tasks + * @return the set of execution ids. * @since 2.8 */ Set getAllTaskExecutionIds(boolean onlyCompleted, String taskName); /** * Returns the count of all the task execution IDs with the option to include only the completed task executions. + * * @param onlyCompleted whether to include only completed task executions - * @param taskName the task name, if null then retrieve all the tasks + * @param taskName the task name, if null then retrieve all the tasks * @return the number of executions * @since 2.8 */ @@ -96,8 +102,9 @@ public interface TaskExecutionService { /** * Returns the count of all the task execution IDs with the option to include only the completed task executions. - * @param onlyCompleted whether to include only completed task executions (ignored when {@code includeTasksEndedMinDaysAgo} is specified) - * @param taskName the task name, if null then retrieve all the tasks + * + * @param onlyCompleted whether to include only completed task executions (ignored when {@code includeTasksEndedMinDaysAgo} is specified) + * @param taskName the task name, if null then retrieve all the tasks * @param includeTasksEndedMinDaysAgo only include tasks that have ended at least this many days ago * @return the number of executions, 0 if no data, never null * @since 2.11.0 diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/service/TaskJobService.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/service/TaskJobService.java index 4e3ac6110b..eccb73f58b 100644 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/service/TaskJobService.java +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/service/TaskJobService.java @@ -17,7 +17,6 @@ package org.springframework.cloud.dataflow.server.service; import java.util.Date; -import java.util.List; import org.springframework.batch.core.BatchStatus; import org.springframework.batch.core.Job; @@ -34,7 +33,6 @@ import org.springframework.cloud.task.repository.TaskExecution; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; -import org.springframework.web.bind.annotation.RequestParam; /** * Repository that retrieves Tasks and JobExecutions/Instances and the associations @@ -52,7 +50,7 @@ public interface TaskJobService { * @param pageable enumerates the data to be returned. * @return List containing {@link TaskJobExecution}s. * @throws NoSuchJobExecutionException in the event that a job execution id specified is - * not present when looking up stepExecutions for the result. + * not present when looking up stepExecutions for the result. */ Page listJobExecutions(Pageable pageable) throws NoSuchJobExecutionException; @@ -61,7 +59,7 @@ public interface TaskJobService { * with a specific jobName and matches the data with a task id. * * @param pageable enumerates the data to be returned. - * @param jobName the name of the job for which to findByTaskNameContains. + * @param jobName the name of the job for which to findByTaskNameContains. * @return List containing {@link JobExecutionWithStepCount}s. * @throws NoSuchJobException if the job with the given name does not exist. */ @@ -70,10 +68,11 @@ public interface TaskJobService { /** * Retrieves a JobExecution from the JobRepository and matches it with a task id. * - * @param id the id of the {@link JobExecution} + * @param id the id of the {@link JobExecution} + * @param schemaTarget the schema target of the task job execution. * @return the {@link TaskJobExecution}s associated with the id. * @throws NoSuchJobExecutionException if the specified job execution for the id does not - * exist. + * exist. */ TaskJobExecution getJobExecution(long id, String schemaTarget) throws NoSuchJobExecutionException; @@ -82,7 +81,7 @@ public interface TaskJobService { * specific jobName and matches the data with the associated JobExecutions. * * @param pageable enumerates the data to be returned. - * @param jobName the name of the job for which to findByTaskNameContains. + * @param jobName the name of the job for which to findByTaskNameContains. * @return List containing {@link JobInstanceExecutions}. * @throws NoSuchJobException if the job for the jobName specified does not exist. */ @@ -92,10 +91,11 @@ public interface TaskJobService { * Retrieves a {@link JobInstance} from the JobRepository and matches it with the * associated {@link JobExecution}s. * - * @param id the id of the {@link JobInstance} + * @param id the id of the {@link JobInstance} + * @param schemaTarget the schema target of the job instance. * @return the {@link JobInstanceExecutions} associated with the id. * @throws NoSuchJobInstanceException if job instance id does not exist. - * @throws NoSuchJobException if the job for the job instance does not exist. + * @throws NoSuchJobException if the job for the job instance does not exist. */ JobInstanceExecutions getJobInstance(long id, String schemaTarget) throws NoSuchJobInstanceException, NoSuchJobException; @@ -104,8 +104,9 @@ public interface TaskJobService { * deemed restartable. Otherwise a {@link JobNotRestartableException} is being thrown. * * @param jobExecutionId The id of the JobExecution to restart. + * @param schemaTarget the schema target of the job execution. * @throws NoSuchJobExecutionException if the JobExecution for the provided id does not - * exist. + * exist. */ void restartJobExecution(long jobExecutionId, String schemaTarget) throws NoSuchJobExecutionException; @@ -117,11 +118,12 @@ public interface TaskJobService { * responsibility of the implementor of the {@link Job} to react to that request. * Furthermore, this method does not interfere with the associated {@link TaskExecution}. * - * @param jobExecutionId The id of the {@link JobExecution} to stop - * @throws NoSuchJobExecutionException thrown if no job execution exists for the - * jobExecutionId. + * @param jobExecutionId The id of the {@link JobExecution} to stop. + * @param schemaTarget the schema target of the job execution. + * @throws NoSuchJobExecutionException thrown if no job execution exists for the + * jobExecutionId. * @throws JobExecutionNotRunningException thrown if a stop is requested on a job that is - * not running. + * not running. * @see org.springframework.cloud.dataflow.server.batch.JobService#stop(Long) */ void stopJobExecution(long jobExecutionId, String schemaTarget) throws NoSuchJobExecutionException, JobExecutionNotRunningException; @@ -132,9 +134,8 @@ public interface TaskJobService { * * @param pageable enumerates the data to be returned. * @return List containing {@link TaskJobExecution}s. - * * @throws NoSuchJobExecutionException thrown if the job execution specified does not - * exist. + * exist. */ Page listJobExecutionsWithStepCount(Pageable pageable) throws NoSuchJobExecutionException; @@ -143,12 +144,17 @@ public interface TaskJobService { * jobName, status and matches the data with a task id. * * @param pageable enumerates the data to be returned. - * @param jobName the name of the job for which to findByTaskNameContains. - * @param status the BatchStatus of the job execution. + * @param jobName the name of the job for which to findByTaskNameContains. + * @param status the BatchStatus of the job execution. * @return List containing {@link TaskJobExecution}s. - * @throws NoSuchJobException if the job with the given name does not exist. + * @throws NoSuchJobException if the job with the given name does not exist. + * @throws NoSuchJobExecutionException the job execution with the given name doesn't exist. */ - Page listJobExecutionsForJob(Pageable pageable, String jobName, BatchStatus status) throws NoSuchJobException, NoSuchJobExecutionException; + Page listJobExecutionsForJob( + Pageable pageable, + String jobName, + BatchStatus status + ) throws NoSuchJobException, NoSuchJobExecutionException; /** * Retrieves Pageable list of {@link JobExecutionWithStepCount} from the JobRepository @@ -156,7 +162,7 @@ public interface TaskJobService { * * @param pageable enumerates the data to be returned. * @param fromDate the date which start date must be greater than. - * @param toDate the date which start date must be less than. + * @param toDate the date which start date must be less than. * @return List containing {@link JobExecutionWithStepCount}s. * @throws NoSuchJobException if the job with the given name does not exist. */ @@ -166,21 +172,31 @@ public interface TaskJobService { * Retrieves Pageable list of {@link JobExecutionWithStepCount} from the JobRepository * filtered by the job instance id. * - * @param pageable enumerates the data to be returned. + * @param pageable enumerates the data to be returned. * @param jobInstanceId the job instance id associated with the execution. + * @param schemaTarget the schema target of the job instance. * @return List containing {@link JobExecutionWithStepCount}s. * @throws NoSuchJobException if the job with the given name does not exist. */ - Page listJobExecutionsForJobWithStepCountFilteredByJobInstanceId(Pageable pageable, int jobInstanceId, String schemaTarget) throws NoSuchJobException; + Page listJobExecutionsForJobWithStepCountFilteredByJobInstanceId( + Pageable pageable, + int jobInstanceId, + String schemaTarget + ) throws NoSuchJobException; /** * Retrieves Pageable list of {@link JobExecutionWithStepCount} from the JobRepository * filtered by the task execution id. * - * @param pageable enumerates the data to be returned. + * @param pageable enumerates the data to be returned. * @param taskExecutionId the task execution id associated with the execution. + * @param schemaTarget the schema target of the task execution. * @return List containing {@link JobExecutionWithStepCount}s. * @throws NoSuchJobException if the job with the given name does not exist. */ - Page listJobExecutionsForJobWithStepCountFilteredByTaskExecutionId(Pageable pageable, int taskExecutionId, String schemaTarget) throws NoSuchJobException; + Page listJobExecutionsForJobWithStepCountFilteredByTaskExecutionId( + Pageable pageable, + int taskExecutionId, + String schemaTarget + ) throws NoSuchJobException; } diff --git a/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/domain/ActuatorPostRequest.java b/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/domain/ActuatorPostRequest.java index fe09693ee3..531138ce9b 100644 --- a/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/domain/ActuatorPostRequest.java +++ b/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/domain/ActuatorPostRequest.java @@ -20,23 +20,22 @@ import java.util.Objects; import org.springframework.util.Assert; - +/** + * @author David Turanski + */ public class ActuatorPostRequest { private String endpoint; private Map body; - /** - * @author David Turanski - */ public ActuatorPostRequest() { } /** * @param endpoint the relative actuator path, e.g., {@code /info}, base actuator url if empty. * @param body the request body as JSON text - * @return + * @return actuator post request */ public static ActuatorPostRequest of(String endpoint, Map body) { Assert.notEmpty(body, "'body' must not be empty"); diff --git a/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/support/yaml/DefaultYamlConverter.java b/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/support/yaml/DefaultYamlConverter.java index ecebd1323c..b768bd5eff 100644 --- a/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/support/yaml/DefaultYamlConverter.java +++ b/spring-cloud-skipper/spring-cloud-skipper/src/main/java/org/springframework/cloud/skipper/support/yaml/DefaultYamlConverter.java @@ -137,7 +137,7 @@ private boolean hasComments(String line) { } /** - * Default implementation of a {@link Builder} building a {@link DefaultYamlConverter}. + * Default implementation of a {@link org.springframework.cloud.skipper.support.yaml.YamlConverter.Builder} building a {@link DefaultYamlConverter}. */ public static class DefaultBuilder implements Builder {