@Bean @Lazy @ConditionalOnMissingBean public ReactorCloudFoundryClient cloudFoundryClient(ConnectionContext connectionContext, TokenProvider tokenProvider) { return ReactorCloudFoundryClient.builder() .connectionContext(connectionContext) .tokenProvider(tokenProvider) .build(); }
@Bean @Lazy @ConditionalOnMissingBean public ReactorCloudFoundryClient cloudFoundryClient(ConnectionContext connectionContext, TokenProvider tokenProvider) { return ReactorCloudFoundryClient.builder() .connectionContext(connectionContext) .tokenProvider(tokenProvider) .build(); }
@Bean @ConditionalOnMissingBean public CloudFoundryClient cloudFoundryClient(ConnectionContext connectionContext, TokenProvider tokenProvider) { return ReactorCloudFoundryClient.builder() .connectionContext(connectionContext) .tokenProvider(tokenProvider) .build(); }
.username(connectionProperties.getUsername()) .password(connectionProperties.getPassword()).build(); CloudFoundryClient cloudFoundryClient = ReactorCloudFoundryClient.builder() .connectionContext(connectionContext).tokenProvider(tokenProvider) .build();
.username(connectionProperties.getUsername()) .password(connectionProperties.getPassword()).build(); CloudFoundryClient cloudFoundryClient = ReactorCloudFoundryClient.builder() .connectionContext(connectionContext).tokenProvider(tokenProvider) .build();
.username(connectionProperties.getUsername()) .password(connectionProperties.getPassword()).build(); CloudFoundryClient cloudFoundryClient = ReactorCloudFoundryClient.builder() .connectionContext(connectionContext).tokenProvider(tokenProvider) .build();
.username(connectionProperties.getUsername()) .password(connectionProperties.getPassword()).build(); CloudFoundryClient cloudFoundryClient = ReactorCloudFoundryClient.builder() .connectionContext(connectionContext).tokenProvider(tokenProvider) .build();
private CloudFoundryOperations buildCloudFoundryOperations(String platformName) { CloudFoundryPlatformProperties.CloudFoundryProperties cloudFoundryProperties = this.cloudFoundryPlatformProperties .getAccounts() .get(platformName); CloudFoundryConnectionProperties connectionProperties = cloudFoundryProperties.getConnection(); ConnectionContext connectionContext = DefaultConnectionContext.builder() .apiHost(connectionProperties.getUrl().getHost()) .skipSslValidation(connectionProperties.isSkipSslValidation()) .build(); TokenProvider tokenProvider = PasswordGrantTokenProvider.builder() .username(connectionProperties.getUsername()) .password(connectionProperties.getPassword()).build(); CloudFoundryClient cloudFoundryClient = ReactorCloudFoundryClient.builder() .connectionContext(connectionContext) .tokenProvider(tokenProvider) .build(); return DefaultCloudFoundryOperations .builder().cloudFoundryClient(cloudFoundryClient) .organization(connectionProperties.getOrg()) .space(connectionProperties.getSpace()).build(); } }
public CFClientProvider(CFClientParams params) { long sslTimeout = Long.getLong("sts.bootdash.cf.client.ssl.handshake.timeout", 60); //TODO: make a preference for this? Optional<Boolean> keepAlive = getBooleanSystemProp("http.keepAlive"); CloudFoundryClientCache.debug("cf client keepAlive = "+keepAlive); connection = DefaultConnectionContext.builder() .proxyConfiguration(Optional.ofNullable(getProxy(params.getHost()))) .apiHost(params.getHost()) .sslHandshakeTimeout(Duration.ofSeconds(sslTimeout)) .keepAlive(keepAlive) .skipSslValidation(params.skipSslValidation()) .build(); tokenProvider = createTokenProvider(params); client = ReactorCloudFoundryClient.builder() .connectionContext(connection) .tokenProvider(tokenProvider) .build(); uaaClient = ReactorUaaClient.builder() .connectionContext(connection) .tokenProvider(tokenProvider) .build(); doppler = ReactorDopplerClient.builder() .connectionContext(connection) .tokenProvider(tokenProvider) .build(); }
protected CloudFoundryOperations getCfOperations() { CfProperties cfAppProperties = this.cfPropertiesMapper.getProperties(); ConnectionContext connectionContext = DefaultConnectionContext.builder() .apiHost(cfAppProperties.ccHost()) .skipSslValidation(true) .proxyConfiguration(tryGetProxyConfiguration(cfAppProperties)) .build(); TokenProvider tokenProvider = getTokenProvider(cfAppProperties); CloudFoundryClient cfClient = ReactorCloudFoundryClient.builder() .connectionContext(connectionContext) .tokenProvider(tokenProvider) .build(); CloudFoundryOperations cfOperations = DefaultCloudFoundryOperations.builder() .cloudFoundryClient(cfClient) .organization(cfAppProperties.org()) .space(cfAppProperties.space()) .build(); return cfOperations; }