Class DefaultHttpDestination
- All Implemented Interfaces:
Destination,DestinationProperties,HttpDestination,HttpDestinationProperties
HttpDestination interface.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class to allow for easy creation of an immutableDefaultHttpDestinationinstance. -
Method Summary
Modifier and TypeMethodDescriptionStarts a builder to be used to create aDefaultHttpDestinationwith property: .Starts a builder to be used to create aDefaultHttpDestinationwith some properties.booleanfromDestination(Destination destination) Creates a newDefaultHttpDestinationinstance from the givenDestinationby copying all properties returned byDestinationProperties.getPropertyNames().Creates a newDefaultHttpDestinationinstance from the given map of properties.fromProperties(DestinationProperties properties) Creates a newDefaultHttpDestinationinstance from the givenDestinationPropertiesby copying all properties returned byDestinationProperties.getPropertyNames().<ValueT> io.vavr.control.Option<ValueT>get(DestinationPropertyKey<ValueT> propertyKey) Convenience method to convert theObjectreturn type ofDestinationProperties.get(String)into any expected type.io.vavr.control.Option<Object>Gets the value associated with the given key (if any).<ValueT> io.vavr.control.Option<ValueT>Convenience method to cast theObjectreturn type ofDestinationProperties.get(String)into the expected type.<ValueT> io.vavr.control.Option<ValueT>Convenience method to convert theObjectreturn type ofDestinationProperties.get(String)into any expected type.Returns the authentication type to be expected when authenticating at the remote system.io.vavr.control.Option<BasicCredentials>Returns the basic credentials to be used for authentication at the remote system.getHeaders(URI requestUri) Getter for a collection of headers that should be added to the outgoing request for this destination.io.vavr.control.Option<KeyStore>The KeyStore to be used when communicating over HTTP.io.vavr.control.Option<String>The password for the Key Store to be used when communicating over HTTP.Retrieves the set of property keys of the destination.io.vavr.control.Option<ProxyConfiguration>TheProxyConfigurationto be used when communicating over HTTP.io.vavr.control.Option<ProxyType>Returns theProxyTypethat is configured for this destination.Defines from how theSSLContextfor outbound HTTP calls via this destination is determined from.io.vavr.control.Option<String>The TLS version to be used when communicating over HTTP.io.vavr.control.Option<KeyStore>Returns the optional trust store of the destination.io.vavr.control.Option<String>Returns the optional trust store password of the destination.getUri()Getter for theURIto communicate with.inthashCode()booleanIndicates whether all server certificates should be accepted when communicating over HTTP.Returns a newDefaultHttpDestination.Builderinstance that is initialized with thisDefaultHttpDestination.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sap.cloud.sdk.cloudplatform.connectivity.Destination
asHttp, asRfc, isHttp, isRfcMethods inherited from interface com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties
getHeaders
-
Method Details
-
getHeaders
Description copied from interface:HttpDestinationPropertiesGetter for a collection of headers that should be added to the outgoing request for this destination.- Specified by:
getHeadersin interfaceHttpDestinationProperties- Parameters:
requestUri- The target URI of a request to which HTTP headers should be added.- Returns:
- A collection with all headers to be used when communicating with the target of the destination.
-
getUri
Description copied from interface:HttpDestinationPropertiesGetter for theURIto communicate with.This is a mandatory property of a HttpDestination.
- Specified by:
getUriin interfaceHttpDestinationProperties- Returns:
- The
URIto be used with this destination.
-
getTlsVersion
Description copied from interface:HttpDestinationPropertiesThe TLS version to be used when communicating over HTTP.- Specified by:
getTlsVersionin interfaceHttpDestinationProperties- Returns:
- An
Optionwrapping the TLS version to use, if any.
-
getProxyConfiguration
Description copied from interface:HttpDestinationPropertiesTheProxyConfigurationto be used when communicating over HTTP.- Specified by:
getProxyConfigurationin interfaceHttpDestinationProperties- Returns:
- An
Optionwrapping theProxyConfigurationto use, if any.
-
getKeyStore
Description copied from interface:HttpDestinationPropertiesThe KeyStore to be used when communicating over HTTP.- Specified by:
getKeyStorein interfaceHttpDestinationProperties- Returns:
- An
Optionwrapping the KeyStore to use, if any.
-
getKeyStorePassword
Description copied from interface:HttpDestinationPropertiesThe password for the Key Store to be used when communicating over HTTP.- Specified by:
getKeyStorePasswordin interfaceHttpDestinationProperties- Returns:
- An
Optionwrapping the password to use, if any.
-
isTrustingAllCertificates
public boolean isTrustingAllCertificates()Description copied from interface:HttpDestinationPropertiesIndicates whether all server certificates should be accepted when communicating over HTTP.- Specified by:
isTrustingAllCertificatesin interfaceHttpDestinationProperties- Returns:
trueif all certificates should be accepted,falseotherwise.
-
getTrustStore
Description copied from interface:HttpDestinationPropertiesReturns the optional trust store of the destination.- Specified by:
getTrustStorein interfaceHttpDestinationProperties- Returns:
- The optional trust store of the destination.
-
getTrustStorePassword
Description copied from interface:HttpDestinationPropertiesReturns the optional trust store password of the destination.- Specified by:
getTrustStorePasswordin interfaceHttpDestinationProperties- Returns:
- The optional trust store password of the destination.
-
getSecurityConfigurationStrategy
Description copied from interface:HttpDestinationPropertiesDefines from how theSSLContextfor outbound HTTP calls via this destination is determined from.- Specified by:
getSecurityConfigurationStrategyin interfaceHttpDestinationProperties- Returns:
- The optional
SecurityConfigurationStrategyof the destination
-
getBasicCredentials
Description copied from interface:HttpDestinationPropertiesReturns the basic credentials to be used for authentication at the remote system.- Specified by:
getBasicCredentialsin interfaceHttpDestinationProperties- Returns:
- An
Optionwrapping theBasicCredentialsto use, if any.
-
getAuthenticationType
Description copied from interface:HttpDestinationPropertiesReturns the authentication type to be expected when authenticating at the remote system.- Specified by:
getAuthenticationTypein interfaceHttpDestinationProperties- Returns:
- This destination authentication type.
-
getProxyType
Description copied from interface:HttpDestinationPropertiesReturns theProxyTypethat is configured for this destination.- Specified by:
getProxyTypein interfaceHttpDestinationProperties- Returns:
- An
Optionwrapping theProxyTypeto use, if any.
-
toString
-
toBuilder
Returns a newDefaultHttpDestination.Builderinstance that is initialized with thisDefaultHttpDestination.Please note that this operation performs a shallow copy only. As a consequence, complex objects (such as the
KeyStores) will be copied by reference only, which leads to a shared state between thedestinationand theDefaultHttpDestinationto be created.- Returns:
- A new
DefaultHttpDestination.Builderinstance. - Since:
- 5.0.0
- See Also:
-
builder
Starts a builder to be used to create aDefaultHttpDestinationwith property: .- Parameters:
uri- The uri of theDefaultHttpDestinationto be created. In case this is no valid URI anIllegalArgumentExceptionwill be thrown.- Returns:
- A new
Builderinstance. - Throws:
IllegalArgumentException- if the givenuriis no valid URI.
-
builder
Starts a builder to be used to create aDefaultHttpDestinationwith some properties.- Parameters:
uri- The uri of theDefaultHttpDestinationto be created.- Returns:
- A new
Builderinstance.
-
fromMap
Creates a newDefaultHttpDestinationinstance from the given map of properties.- Parameters:
map- The map of properties to create the builder from.- Returns:
- A new
DefaultHttpDestination.Builderinstance. - Since:
- 5.0.0
-
fromProperties
@Nonnull public static DefaultHttpDestination.Builder fromProperties(@Nonnull DestinationProperties properties) Creates a newDefaultHttpDestinationinstance from the givenDestinationPropertiesby copying all properties returned byDestinationProperties.getPropertyNames(). In addition, if the givendestinationis an instance ofDefaultHttpDestination, all additional properties that are specific to theHttpDestinationPropertiesinstance will be copied as well. This especially also includes any statically addedDestinationHeaderProviders andHeaders attached to thedestination.Please note that this operation performs a shallow copy only. As a consequence, complex objects (such as the
KeyStores) will be copied by reference only, which leads to a shared state between thedestinationand theDefaultHttpDestinationto be created.- Parameters:
properties- TheDestinationPropertiesto create the builder from.- Returns:
- A new
DefaultHttpDestination.Builderinstance. - Throws:
IllegalArgumentException- if the providedpropertiesare not an instance of eitherDefaultDestinationorDefaultHttpDestination.- Since:
- 5.0.0
-
fromDestination
@Nonnull public static DefaultHttpDestination.Builder fromDestination(@Nonnull Destination destination) Creates a newDefaultHttpDestinationinstance from the givenDestinationby copying all properties returned byDestinationProperties.getPropertyNames(). In addition, if the givendestinationis an instance ofDefaultHttpDestination, all additional properties that are specific to theHttpDestinationPropertiesinstance will be copied as well. This especially also includes any statically addedDestinationHeaderProviders andHeaders attached to thedestination.Please note that this operation performs a shallow copy only. As a consequence, complex objects (such as the
KeyStores) will be copied by reference only, which leads to a shared state between thedestinationand theDefaultHttpDestinationto be created.- Parameters:
destination- TheDestinationto create the builder from.- Returns:
- A new
DefaultHttpDestination.Builderinstance. - Throws:
IllegalArgumentException- if the provideddestinationis not an instance of eitherDefaultDestinationorDefaultHttpDestination.- Since:
- 5.0.0
-
equals
-
hashCode
public int hashCode() -
get
Description copied from interface:DestinationPropertiesGets the value associated with the given key (if any).- Specified by:
getin interfaceDestinationProperties- Parameters:
key- The key to get the value for.- Returns:
- An
Optionobject containing the value, if any.
-
getPropertyNames
Description copied from interface:DestinationPropertiesRetrieves the set of property keys of the destination.- Specified by:
getPropertyNamesin interfaceDestinationProperties- Returns:
- An iterable of type String which is the set of property keys for a destination
-
get
Description copied from interface:DestinationPropertiesConvenience method to cast theObjectreturn type ofDestinationProperties.get(String)into the expected type.- Specified by:
getin interfaceDestinationProperties- Type Parameters:
ValueT- The expected type of the value.- Parameters:
key- The key to get the value for.expectedType- The expected type to cast the value to.- Returns:
- An
Optionobject containing the converted value, if any.
-
get
Description copied from interface:DestinationPropertiesConvenience method to convert theObjectreturn type ofDestinationProperties.get(String)into any expected type.- Specified by:
getin interfaceDestinationProperties- Type Parameters:
ValueT- The expected type of the value.- Parameters:
key- The key to get the value for.conversion- A function converting the object given byDestinationProperties.get(String)into the expected type. Will never be called if no value (ornull) is present for the given key.- Returns:
- An
Optionobject containing the converted value, if any.
-
get
Description copied from interface:DestinationPropertiesConvenience method to convert theObjectreturn type ofDestinationProperties.get(String)into any expected type.- Specified by:
getin interfaceDestinationProperties- Type Parameters:
ValueT- The expected type of the value.- Parameters:
propertyKey- TheDestinationPropertyKeyfor the value to retrieve.- Returns:
- An
Optionobject containing the converted value, if any.
-