@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); }
@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); }
@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); }
new DataFlowTemplate(targetHolder.getTarget().getTargetUri(), this.restTemplate)); this.targetHolder.getTarget() .setTargetResultMessage(String.format("Successfully targeted %s", targetUriString));
new DataFlowTemplate(targetHolder.getTarget().getTargetUri(), this.restTemplate)); this.targetHolder.getTarget() .setTargetResultMessage(String.format("Successfully targeted %s", targetUriString));