Class TransparentProxyDestination.AbstractBuilder<B extends TransparentProxyDestination.AbstractBuilder<B>>
java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.TransparentProxyDestination.AbstractBuilder<B>
- Type Parameters:
B- The type of the builder subclass, used for fluent method chaining.
- Direct Known Subclasses:
TransparentProxyDestination.Builder,TransparentProxyDestination.GatewayBuilder
- Enclosing class:
- TransparentProxyDestination
public abstract static class TransparentProxyDestination.AbstractBuilder<B extends TransparentProxyDestination.AbstractBuilder<B>>
extends Object
Abstract base class for builders to share common functionality like adding headers and properties.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactorToken(String actorToken) Adds an actor token header to the destination.actorTokenType(String actorTokenType) Adds an actor token type header to the destination.authorization(String authorization) Adds an authorization header to the destination.build()Finally creates theTransparentProxyDestinationwith the properties retrieved via theproperty(String, Object)method.Sets the chain name header for the destination.chainVarSamlProviderDestinationName(String samlProviderDestinationName) Sets the chain variable SAML provider destination name header for the destination.chainVarSubjectToken(String subjectToken) Sets the chain variable subject token header for the destination.chainVarSubjectTokenType(String subjectTokenType) Sets the chain variable subject token type header for the destination.clientAssertion(String clientAssertion) Adds a client assertion header to the destination.clientAssertionDestinationName(String clientAssertionDestinationName) Adds a client assertion destination name header to the destination.clientAssertionType(String clientAssertionType) Adds a client assertion type header to the destination.codeVerifier(String codeVerifier) Adds a code verifier header to the destination.protected abstract BgetThis()Returns the current builder instance.Adds the given header to the list of headers added to every outgoing request for this destination.Adds a header given by theheaderNameandheaderValueto the list of headers added to every outgoing request for this destination.headers(Collection<Header> headers) Adds the given headers to the list of headers added to every outgoing request for this destination.<ValueT> Bproperty(DestinationPropertyKey<ValueT> key, ValueT value) Adds the given key-value pair to the destination to be created.Adds the given key-value pair to the destination to be created.redirectUri(String redirectUri) Adds a redirect URI header to the destination.subjectTokenType(String subjectTokenType) Adds a subject token type header to the destination.Adds a tenant ID header to the destination.tenantSubdomain(String tenantSubdomain) Adds a tenant subdomain header to the destination.tokenServiceTenant(String tokenServiceTenant) Adds a token service tenant header to the destination.
-
Constructor Details
-
AbstractBuilder
public AbstractBuilder()
-
-
Method Details
-
getThis
Returns the current builder instance.This method is used to support fluent method chaining in subclasses of
AbstractBuilder.- Returns:
- the current builder instance
-
property
Adds the given key-value pair to the destination to be created. This will overwrite any property already assigned to the key.- Parameters:
key- The key to assign a property for.value- The property value to be assigned.- Returns:
- This builder.
- Since:
- 5.22.0
-
property
@Nonnull public <ValueT> B property(@Nonnull DestinationPropertyKey<ValueT> key, @Nonnull ValueT value) Adds the given key-value pair to the destination to be created. This will overwrite any property already assigned to the key.- Type Parameters:
ValueT- The type of the property value.- Parameters:
key- TheDestinationPropertyKeyto assign a property for.value- The property value to be assigned.- Returns:
- This builder.
- Since:
- 5.22.0
-
headers
Adds the given headers to the list of headers added to every outgoing request for this destination.- Parameters:
headers- Headers to add to outgoing requests.- Returns:
- This builder.
-
header
Adds the given header to the list of headers added to every outgoing request for this destination.- Parameters:
header- A header to add to outgoing requests.- Returns:
- This builder.
-
header
Adds a header given by theheaderNameandheaderValueto the list of headers added to every outgoing request for this destination.- Parameters:
headerName- The name of the header to add.headerValue- The value of the header to add.- Returns:
- This builder.
-
tenantSubdomain
Adds a tenant subdomain header to the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/multitenancyNote: Tenant subdomain and tenant ID cannot be set at the same time. Calling this method when a tenant ID header is already present will throw an exception.
- Parameters:
tenantSubdomain- The tenant subdomain value.- Returns:
- This builder instance for method chaining.
- Throws:
IllegalStateException- if tenant ID header is already set
-
tenantId
Adds a tenant ID header to the destination. Set automatically by the Cloud SDK per-request, if both tenant id and tenant subdomain are left unset. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/multitenancyNote: Tenant subdomain and tenant ID cannot be set at the same time. Calling this method when a tenant ID header is already present will throw an exception.
- Parameters:
tenantId- The tenant ID value.- Returns:
- This builder instance for method chaining.
- Throws:
IllegalStateException- if tenant ID header is already set
-
tokenServiceTenant
Adds a token service tenant header to the destination. Is send to the destination service as x-tenant header and should be used when tokenServiceURLType in the destination service is common. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/technical-user-propagation and https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/oauth-client-credentials-authentication-cf15900ca39242fb87a1fb081a54b9ca- Parameters:
tokenServiceTenant- The token service tenant value.- Returns:
- This builder instance for method chaining.
-
clientAssertion
Adds a client assertion header to the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/provide-client-assertion-properties-as-headers- Parameters:
clientAssertion- The client assertion value.- Returns:
- This builder instance for method chaining.
-
clientAssertionType
Adds a client assertion type header to the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/provide-client-assertion-properties-as-headers- Parameters:
clientAssertionType- The client assertion type value.- Returns:
- This builder instance for method chaining.
-
clientAssertionDestinationName
Adds a client assertion destination name header to the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/client-assertion-with-automated-assertion-fetching-by-service- Parameters:
clientAssertionDestinationName- The client assertion destination name value.- Returns:
- This builder instance for method chaining.
-
authorization
Adds an authorization header to the destination. Will be used for OAuth 2.0 token exchange and principal propagation by the transparent proxy. Will be sent to the destination service as x-user-token, x-code, x-refresh-token, x-subject-token or x-chain-var-subjectToken header depending on the destination authentication type. Set automatically by the Cloud SDK per-request, if unset here.- Parameters:
authorization- The authorization value.- Returns:
- This builder instance for method chaining.
-
subjectTokenType
Adds a subject token type header to the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/oauth-token-exchange-authentication-8813df7e39e5472ca5bdcdd34598592d- Parameters:
subjectTokenType- The subject token type value.- Returns:
- This builder instance for method chaining.
-
actorToken
Adds an actor token header to the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/oauth-token-exchange-authentication-8813df7e39e5472ca5bdcdd34598592d- Parameters:
actorToken- The actor token value.- Returns:
- This builder instance for method chaining.
-
actorTokenType
Adds an actor token type header to the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/oauth-token-exchange-authentication-8813df7e39e5472ca5bdcdd34598592d- Parameters:
actorTokenType- The actor token type value.- Returns:
- This builder instance for method chaining.
-
redirectUri
Adds a redirect URI header to the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/oauth-authorization-code-authentication-7bdfed49c6d0451b8aafe1c94da8c770- Parameters:
redirectUri- The redirect URI value.- Returns:
- This builder instance for method chaining.
-
codeVerifier
Adds a code verifier header to the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/oauth-authorization-code-authentication-7bdfed49c6d0451b8aafe1c94da8c770- Parameters:
codeVerifier- The code verifier value.- Returns:
- This builder instance for method chaining.
-
chainName
Sets the chain name header for the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/ias-signed-saml-bearer-assertion- Parameters:
chainName- The name of the chain.- Returns:
- This builder instance for method chaining.
-
chainVarSubjectToken
Sets the chain variable subject token header for the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/ias-signed-saml-bearer-assertion- Parameters:
subjectToken- The subject token value.- Returns:
- This builder instance for method chaining.
-
chainVarSubjectTokenType
Sets the chain variable subject token type header for the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/ias-signed-saml-bearer-assertion- Parameters:
subjectTokenType- The subject token type value.- Returns:
- This builder instance for method chaining.
-
chainVarSamlProviderDestinationName
Sets the chain variable SAML provider destination name header for the destination. See https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/ias-signed-saml-bearer-assertion- Parameters:
samlProviderDestinationName- The SAML provider destination name.- Returns:
- This builder instance for method chaining.
-
build
Finally creates theTransparentProxyDestinationwith the properties retrieved via theproperty(String, Object)method.- Returns:
- A fully instantiated
TransparentProxyDestination.
-