Class DataFlowTemplate
java.lang.Object
org.springframework.cloud.dataflow.rest.client.DataFlowTemplate
- All Implemented Interfaces:
DataFlowOperations
Implementation of DataFlowOperations delegating to sub-templates, discovered via REST
relations.
- Author:
- Ilayaperumal Gopinathan, Mark Fisher, Glenn Renfro, Patrick Peralta, Gary Russell, Eric Bottard, Gunnar Hillert
-
Field Summary
FieldsModifier and TypeFieldDescriptionHolds discovered URLs of the API.protected final RestTemplateA template used for http interaction. -
Constructor Summary
ConstructorsConstructorDescriptionDataFlowTemplate(URI baseURI, com.fasterxml.jackson.databind.ObjectMapper mapper) Setup aDataFlowTemplateusing the provided baseURI.DataFlowTemplate(URI baseURI, RestTemplate restTemplate, com.fasterxml.jackson.databind.ObjectMapper mapper) Setup aDataFlowTemplateusing the provideRestTemplate. -
Method Summary
Modifier and TypeMethodDescriptionstatic RestTemplateInvokesprepareRestTemplate(RestTemplate).org.springframework.hateoas.Linkstatic com.fasterxml.jackson.databind.ObjectMapperprepareObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Mutable operation to add several required MixIns to the providedObjectMapper.static RestTemplateprepareRestTemplate(RestTemplate restTemplate) Will augment the providedRestTemplatewith the Jackson Mixins required by Spring Cloud Data Flow, specifically:JobExecutionJacksonMixInJobParametersJacksonMixInJobParameterJacksonMixInJobInstanceJacksonMixInExitStatusJacksonMixInStepExecutionJacksonMixInExecutionContextJacksonMixInStepExecutionHistoryJacksonMixIn
-
Field Details
-
restTemplate
A template used for http interaction. -
resources
Holds discovered URLs of the API.
-
-
Constructor Details
-
DataFlowTemplate
Setup aDataFlowTemplateusing the provided baseURI. Will build aRestTemplateimplicitly with the required set of Jackson MixIns. For more information, please seeprepareRestTemplate(RestTemplate). Please be aware that the created RestTemplate will use the JDK's default timeout values. Consider passing in a customRestTemplateor, depending on your JDK implementation, set System properties such as:- sun.net.client.defaultConnectTimeout
- sun.net.client.defaultReadTimeout
- Parameters:
baseURI- Must not be null
-
DataFlowTemplate
public DataFlowTemplate(URI baseURI, RestTemplate restTemplate, com.fasterxml.jackson.databind.ObjectMapper mapper) Setup aDataFlowTemplateusing the provideRestTemplate. Any missing Mixins for Jackson will be added implicitly. For more information, please seeprepareRestTemplate(RestTemplate).- Parameters:
baseURI- Must not be nullrestTemplate- Must not be null
-
-
Method Details
-
prepareRestTemplate
Will augment the providedRestTemplatewith the Jackson Mixins required by Spring Cloud Data Flow, specifically:JobExecutionJacksonMixInJobParametersJacksonMixInJobParameterJacksonMixInJobInstanceJacksonMixInExitStatusJacksonMixInStepExecutionJacksonMixInExecutionContextJacksonMixInStepExecutionHistoryJacksonMixIn
Furthermore, this method will also register the
Jackson2HalModule- Parameters:
restTemplate- Can be null. Instantiates a newRestTemplateif null- Returns:
- RestTemplate with the required Jackson Mixins
-
prepareObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper prepareObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Mutable operation to add several required MixIns to the providedObjectMapper.- Parameters:
objectMapper- Must not be null- Returns:
- ObjectMapper with several mixIns applied
-
getDefaultDataflowRestTemplate
InvokesprepareRestTemplate(RestTemplate).- Returns:
- RestTemplate with the required Jackson MixIns applied
-
getLink
public org.springframework.hateoas.Link getLink(org.springframework.hateoas.RepresentationModel<?> resourceSupport, String rel) -
streamOperations
- Specified by:
streamOperationsin interfaceDataFlowOperations- Returns:
- Stream related operations.
-
taskOperations
- Specified by:
taskOperationsin interfaceDataFlowOperations- Returns:
- Task related operations.
-
jobOperations
- Specified by:
jobOperationsin interfaceDataFlowOperations- Returns:
- Job related operations.
-
appRegistryOperations
- Specified by:
appRegistryOperationsin interfaceDataFlowOperations- Returns:
- Application registry related operations.
-
completionOperations
- Specified by:
completionOperationsin interfaceDataFlowOperations- Returns:
- DSL Completion related operations.
-
runtimeOperations
- Specified by:
runtimeOperationsin interfaceDataFlowOperations- Returns:
- Runtime related operations.
-
aboutOperation
- Specified by:
aboutOperationin interfaceDataFlowOperations- Returns:
- "About" related operations.
-
schedulerOperations
- Specified by:
schedulerOperationsin interfaceDataFlowOperations- Returns:
- Scheduler related operations.
-
getRestTemplate
- Returns:
- The underlying RestTemplate, will never return null
-