public class TaskServiceUtils extends Object
Constructor and Description |
---|
TaskServiceUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addDatabaseCredentials(boolean useKubernetesSecrets,
String platformType)
Determines if a database credentials should be added to task properties.
|
static void |
contributeCommonProperties(Optional<Properties> defaultProperties,
Map<String,String> appDeploymentProperties,
String taskPlatformType)
Merge the common properties defined via the spring.cloud.dataflow.common-properties.task-resource file.
|
static String |
createComposedTaskDefinition(String graph)
Creates a properly formatted CTR definition based on the graph provided.
|
static String |
createComposedTaskDefinition(String alternateComposedTaskRunnerName,
String graph)
Creates a properly formatted CTR definition based on the graph provided.
|
static Map<String,String> |
establishComposedTaskProperties(Map<String,String> taskDeploymentProperties,
org.springframework.cloud.dataflow.core.dsl.TaskNode taskNode)
Establish the app and deployment properties to be used for a CTR.
|
static Map<String,String> |
extractAppProperties(String name,
Map<String,String> taskDeploymentProperties)
Extract app properties from the deployment properties by task name.
|
static Map<String,String> |
extractAppProperties(String name,
String label,
Map<String,String> taskDeploymentProperties)
Extract app properties from the deployment properties by task name.
|
static boolean |
isComposedTaskDefinition(String dsl)
Parses the task DSL to see if it is a composed task definition
|
static String |
labelForSimpleTask(String name,
String dsl) |
static org.springframework.cloud.deployer.spi.core.AppDefinition |
mergeAndExpandAppProperties(TaskDefinition original,
Resource resource,
Map<String,String> appDeploymentProperties,
VisibleProperties visibleProperties)
Return a copy of a given task definition where short form parameters have been expanded
to their long form (amongst the visible properties of the app) if
applicable.
|
static void |
updateDataFlowUriIfNeeded(String dataflowServerUri,
Map<String,String> appDeploymentProperties,
List<String> commandLineArgs) |
static void |
updateDataFlowUriIfNeeded(String dataFlowServerUriKey,
String dataflowServerUri,
Map<String,String> appDeploymentProperties,
List<String> commandLineArgs) |
static TaskDefinition |
updateTaskProperties(TaskDefinition taskDefinition,
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties)
Updates the task definition with the datasource properties.
|
static TaskDefinition |
updateTaskProperties(TaskDefinition taskDefinition,
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties,
boolean setDatabaseCredentials)
Updates the task definition with the datasource properties.
|
public static boolean isComposedTaskDefinition(String dsl)
dsl
- task DSLpublic static String createComposedTaskDefinition(String graph)
graph
- the graph for the CTR to execute.public static String createComposedTaskDefinition(String alternateComposedTaskRunnerName, String graph)
alternateComposedTaskRunnerName
- a ctr name to be used instead of the default.graph
- the graph for the CTR to execute.
of the CTR app to be launched.public static Map<String,String> establishComposedTaskProperties(Map<String,String> taskDeploymentProperties, org.springframework.cloud.dataflow.core.dsl.TaskNode taskNode)
taskDeploymentProperties
- properties to be parsed for the CTR.taskNode
- containing the tasks apps to be executed by the CTRpublic static TaskDefinition updateTaskProperties(TaskDefinition taskDefinition, org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties)
taskDefinition
- the TaskDefinition
to be updated.dataSourceProperties
- the dataSource properties used by SCDF.TaskDefinition
public static TaskDefinition updateTaskProperties(TaskDefinition taskDefinition, org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties, boolean setDatabaseCredentials)
taskDefinition
- the TaskDefinition
to be updated.dataSourceProperties
- the dataSource properties used by SCDF.setDatabaseCredentials
- if true database username and password that should be set in the TaskDefinition
.TaskDefinition
public static Map<String,String> extractAppProperties(String name, Map<String,String> taskDeploymentProperties)
name
- the task app name to search for in the deployment properties.taskDeploymentProperties
- the properties for the task deployment.public static Map<String,String> extractAppProperties(String name, String label, Map<String,String> taskDeploymentProperties)
name
- the task app name to search for in the deployment properties.label
- the taks app label to search for in the deployment properties.taskDeploymentProperties
- the properties for the task deployment.public static org.springframework.cloud.deployer.spi.core.AppDefinition mergeAndExpandAppProperties(TaskDefinition original, Resource resource, Map<String,String> appDeploymentProperties, VisibleProperties visibleProperties)
original
- the task definition with the original set of properties.resource
- the resource to be used for identifying included properties.appDeploymentProperties
- the app deployment properties to be added to the AppDefinition
.visibleProperties
- util for formatting visible properties properly.AppDefinition
.public static void updateDataFlowUriIfNeeded(String dataflowServerUri, Map<String,String> appDeploymentProperties, List<String> commandLineArgs)
public static void updateDataFlowUriIfNeeded(String dataFlowServerUriKey, String dataflowServerUri, Map<String,String> appDeploymentProperties, List<String> commandLineArgs)
public static boolean addDatabaseCredentials(boolean useKubernetesSecrets, String platformType)
platformType
- The type of platform.useKubernetesSecrets
- User wants to use kubernetes secrets for user name and password.public static void contributeCommonProperties(Optional<Properties> defaultProperties, Map<String,String> appDeploymentProperties, String taskPlatformType)
defaultProperties
- Default properties, if any, to contribute to the launch app properties.appDeploymentProperties
- App deployment properties passed to the Task at launch.taskPlatformType
- the platform typeCopyright © 2024 Pivotal Software, Inc.. All rights reserved.