/** * 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()); }
/** * Invokes {@link #prepareRestTemplate(RestTemplate)}. * * @return RestTemplate with the required Jackson MixIns applied */ public static RestTemplate getDefaultDataflowRestTemplate() { return prepareRestTemplate(null); }
@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); }
@Bean @ConditionalOnMissingBean(DataFlowOperations.class) public DataFlowOperations dataFlowOperations() throws Exception{ RestTemplate template = DataFlowTemplate.prepareRestTemplate(restTemplate); final HttpClientConfigurer httpClientConfigurer = HttpClientConfigurer.create(new URI(properties.getServerUri())) .skipTlsCertificateVerification(properties.isSkipSslValidation()); if(!StringUtils.isEmpty(properties.getAuthentication().getBasic().getUsername()) && !StringUtils.isEmpty(properties.getAuthentication().getBasic().getPassword())){ httpClientConfigurer.basicAuthCredentials(properties.getAuthentication().getBasic().getUsername(), properties.getAuthentication().getBasic().getPassword()); template.setRequestFactory(httpClientConfigurer.buildClientHttpRequestFactory()); } return new DataFlowTemplate(new URI(properties.getServerUri()), template); }
new DataFlowTemplate(targetHolder.getTarget().getTargetUri(), this.restTemplate)); this.targetHolder.getTarget() .setTargetResultMessage(String.format("Successfully targeted %s", targetUriString));
Assert.notNull(restTemplate, "The provided restTemplate must not be null."); this.restTemplate = prepareRestTemplate(restTemplate); String downloadURL = getLink(resourceSupport, "dashboard").getHref() + "#about"; throw new IllegalStateException(String.format( "Incompatible version of Data Flow server detected.\n" this.streamOperations = new StreamTemplate(restTemplate, resourceSupport, getVersion()); this.runtimeOperations = new RuntimeTemplate(restTemplate, resourceSupport); this.taskOperations = new TaskTemplate(restTemplate, resourceSupport, getVersion()); this.jobOperations = new JobTemplate(restTemplate, resourceSupport); if(resourceSupport.hasLink(SchedulerTemplate.SCHEDULES_RELATION)) {
@Bean @ConditionalOnMissingBean(DataFlowOperations.class) public DataFlowOperations dataFlowOperations() throws Exception{ RestTemplate template = DataFlowTemplate.prepareRestTemplate(restTemplate); final HttpClientConfigurer httpClientConfigurer = HttpClientConfigurer.create(new URI(properties.getServerUri())) .skipTlsCertificateVerification(properties.isSkipSslValidation()); if(!StringUtils.isEmpty(properties.getAuthentication().getBasic().getUsername()) && !StringUtils.isEmpty(properties.getAuthentication().getBasic().getPassword())){ httpClientConfigurer.basicAuthCredentials(properties.getAuthentication().getBasic().getUsername(), properties.getAuthentication().getBasic().getPassword()); template.setRequestFactory(httpClientConfigurer.buildClientHttpRequestFactory()); } return new DataFlowTemplate(new URI(properties.getServerUri()), template); }
new DataFlowTemplate(targetHolder.getTarget().getTargetUri(), this.restTemplate)); this.targetHolder.getTarget() .setTargetResultMessage(String.format("Successfully targeted %s", targetUriString));
Assert.notNull(restTemplate, "The provided restTemplate must not be null."); this.restTemplate = prepareRestTemplate(restTemplate); String downloadURL = getLink(resourceSupport, "dashboard").getHref() + "#about"; throw new IllegalStateException(String.format( "Incompatible version of Data Flow server detected.\n" this.streamOperations = new StreamTemplate(restTemplate, resourceSupport, getVersion()); this.runtimeOperations = new RuntimeTemplate(restTemplate, resourceSupport); this.taskOperations = new TaskTemplate(restTemplate, resourceSupport, getVersion()); this.jobOperations = new JobTemplate(restTemplate, resourceSupport); if(resourceSupport.hasLink(SchedulerTemplate.SCHEDULES_RELATION)) {
/** * 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()); }
/** * Invokes {@link #prepareRestTemplate(RestTemplate)}. * * @return RestTemplate with the required Jackson MixIns applied */ public static RestTemplate getDefaultDataflowRestTemplate() { return prepareRestTemplate(null); }
@Bean public RestTemplate restTemplate(Environment ev) { return DataFlowTemplate.getDefaultDataflowRestTemplate(); }
@Bean public RestTemplate restTemplate(Environment ev) { return DataFlowTemplate.getDefaultDataflowRestTemplate(); }