/** * Setup a {@link DataFlowTemplate} using the provided baseURI. Will build a * {@link RestTemplate} implicitly with the required set of Jackson MixIns. For more * information, please see {@link #prepareRestTemplate(RestTemplate)}. * Please be aware that the created RestTemplate will use the JDK's default timeout * values. Consider passing in a custom {@link RestTemplate} or, depending on your JDK * implementation, set System properties such as: * <ul> * <li>sun.net.client.defaultConnectTimeout * <li>sun.net.client.defaultReadTimeout * </ul> * For more information see <a href= * "http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html">this * link</a> * * @param baseURI Must not be null */ public DataFlowTemplate(URI baseURI) { this(baseURI, getDefaultDataflowRestTemplate()); }
@Bean public RestTemplate restTemplate(Environment ev) { return DataFlowTemplate.getDefaultDataflowRestTemplate(); }
/** * Setup a {@link DataFlowTemplate} using the provided baseURI. Will build a * {@link RestTemplate} implicitly with the required set of Jackson MixIns. For more * information, please see {@link #prepareRestTemplate(RestTemplate)}. * Please be aware that the created RestTemplate will use the JDK's default timeout * values. Consider passing in a custom {@link RestTemplate} or, depending on your JDK * implementation, set System properties such as: * <ul> * <li>sun.net.client.defaultConnectTimeout * <li>sun.net.client.defaultReadTimeout * </ul> * For more information see <a href= * "http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html">this * link</a> * * @param baseURI Must not be null */ public DataFlowTemplate(URI baseURI) { this(baseURI, getDefaultDataflowRestTemplate()); }
@Bean public RestTemplate restTemplate(Environment ev) { return DataFlowTemplate.getDefaultDataflowRestTemplate(); }
@Bean public DataFlowOperations dataFlowOperations() { final RestTemplate restTemplate = DataFlowTemplate.getDefaultDataflowRestTemplate(); validateUsernamePassword(this.properties.getDataflowServerUsername(), this.properties.getDataflowServerPassword()); if (StringUtils.hasText(this.properties.getDataflowServerUsername()) && StringUtils.hasText(this.properties.getDataflowServerPassword())) { restTemplate.setRequestFactory(HttpClientConfigurer.create(this.properties.getDataflowServerUri()) .basicAuthCredentials(properties.getDataflowServerUsername(), properties.getDataflowServerPassword()) .buildClientHttpRequestFactory()); logger.debug("Configured basic security for accessing the Data Flow Server"); } else { logger.debug("Not configuring basic security for accessing the Data Flow Server"); } return new DataFlowTemplate(this.properties.getDataflowServerUri(), restTemplate); }