Class DefaultHttpDestination
- All Implemented Interfaces:
Destination
,DestinationProperties
,HttpDestination
,HttpDestinationProperties
HttpDestination
interface.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class to allow for easy creation of an immutableDefaultHttpDestination
instance. -
Method Summary
Modifier and TypeMethodDescriptionStarts a builder to be used to create aDefaultHttpDestination
with property: .Starts a builder to be used to create aDefaultHttpDestination
with some properties.boolean
fromDestination
(Destination destination) Creates a newDefaultHttpDestination
instance from the givenDestination
by copying all properties returned byDestinationProperties.getPropertyNames()
.Creates a newDefaultHttpDestination
instance from the given map of properties.fromProperties
(DestinationProperties properties) Creates a newDefaultHttpDestination
instance from the givenDestinationProperties
by copying all properties returned byDestinationProperties.getPropertyNames()
.<ValueT> io.vavr.control.Option<ValueT>
get
(DestinationPropertyKey<ValueT> propertyKey) Convenience method to convert theObject
return 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 theObject
return type ofDestinationProperties.get(String)
into the expected type.<ValueT> io.vavr.control.Option<ValueT>
Convenience method to convert theObject
return 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>
TheProxyConfiguration
to be used when communicating over HTTP.io.vavr.control.Option<ProxyType>
Returns theProxyType
that is configured for this destination.Defines from how theSSLContext
for 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 theURI
to communicate with.int
hashCode()
boolean
Indicates whether all server certificates should be accepted when communicating over HTTP.Returns a newDefaultHttpDestination.Builder
instance that is initialized with thisDefaultHttpDestination
.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.sap.cloud.sdk.cloudplatform.connectivity.Destination
asHttp, asRfc, isHttp, isRfc
Methods inherited from interface com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties
getHeaders
-
Method Details
-
getHeaders
Description copied from interface:HttpDestinationProperties
Getter for a collection of headers that should be added to the outgoing request for this destination.- Specified by:
getHeaders
in 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:HttpDestinationProperties
Getter for theURI
to communicate with.This is a mandatory property of a HttpDestination.
- Specified by:
getUri
in interfaceHttpDestinationProperties
- Returns:
- The
URI
to be used with this destination.
-
getTlsVersion
Description copied from interface:HttpDestinationProperties
The TLS version to be used when communicating over HTTP.- Specified by:
getTlsVersion
in interfaceHttpDestinationProperties
- Returns:
- An
Option
wrapping the TLS version to use, if any.
-
getProxyConfiguration
Description copied from interface:HttpDestinationProperties
TheProxyConfiguration
to be used when communicating over HTTP.- Specified by:
getProxyConfiguration
in interfaceHttpDestinationProperties
- Returns:
- An
Option
wrapping theProxyConfiguration
to use, if any.
-
getKeyStore
Description copied from interface:HttpDestinationProperties
The KeyStore to be used when communicating over HTTP.- Specified by:
getKeyStore
in interfaceHttpDestinationProperties
- Returns:
- An
Option
wrapping the KeyStore to use, if any.
-
getKeyStorePassword
Description copied from interface:HttpDestinationProperties
The password for the Key Store to be used when communicating over HTTP.- Specified by:
getKeyStorePassword
in interfaceHttpDestinationProperties
- Returns:
- An
Option
wrapping the password to use, if any.
-
isTrustingAllCertificates
public boolean isTrustingAllCertificates()Description copied from interface:HttpDestinationProperties
Indicates whether all server certificates should be accepted when communicating over HTTP.- Specified by:
isTrustingAllCertificates
in interfaceHttpDestinationProperties
- Returns:
true
if all certificates should be accepted,false
otherwise.
-
getTrustStore
Description copied from interface:HttpDestinationProperties
Returns the optional trust store of the destination.- Specified by:
getTrustStore
in interfaceHttpDestinationProperties
- Returns:
- The optional trust store of the destination.
-
getTrustStorePassword
Description copied from interface:HttpDestinationProperties
Returns the optional trust store password of the destination.- Specified by:
getTrustStorePassword
in interfaceHttpDestinationProperties
- Returns:
- The optional trust store password of the destination.
-
getSecurityConfigurationStrategy
Description copied from interface:HttpDestinationProperties
Defines from how theSSLContext
for outbound HTTP calls via this destination is determined from.- Specified by:
getSecurityConfigurationStrategy
in interfaceHttpDestinationProperties
- Returns:
- The optional
SecurityConfigurationStrategy
of the destination
-
getBasicCredentials
Description copied from interface:HttpDestinationProperties
Returns the basic credentials to be used for authentication at the remote system.- Specified by:
getBasicCredentials
in interfaceHttpDestinationProperties
- Returns:
- An
Option
wrapping theBasicCredentials
to use, if any.
-
getAuthenticationType
Description copied from interface:HttpDestinationProperties
Returns the authentication type to be expected when authenticating at the remote system.- Specified by:
getAuthenticationType
in interfaceHttpDestinationProperties
- Returns:
- This destination authentication type.
-
getProxyType
Description copied from interface:HttpDestinationProperties
Returns theProxyType
that is configured for this destination.- Specified by:
getProxyType
in interfaceHttpDestinationProperties
- Returns:
- An
Option
wrapping theProxyType
to use, if any.
-
toString
-
toBuilder
Returns a newDefaultHttpDestination.Builder
instance that is initialized with thisDefaultHttpDestination
.Please note that this operation performs a shallow copy only. As a consequence, complex objects (such as the
KeyStore
s) will be copied by reference only, which leads to a shared state between thedestination
and theDefaultHttpDestination
to be created.- Returns:
- A new
DefaultHttpDestination.Builder
instance. - Since:
- 5.0.0
- See Also:
-
builder
Starts a builder to be used to create aDefaultHttpDestination
with property: .- Parameters:
uri
- The uri of theDefaultHttpDestination
to be created. In case this is no valid URI anIllegalArgumentException
will be thrown.- Returns:
- A new
Builder
instance. - Throws:
IllegalArgumentException
- if the givenuri
is no valid URI.
-
builder
Starts a builder to be used to create aDefaultHttpDestination
with some properties.- Parameters:
uri
- The uri of theDefaultHttpDestination
to be created.- Returns:
- A new
Builder
instance.
-
fromMap
Creates a newDefaultHttpDestination
instance from the given map of properties.- Parameters:
map
- The map of properties to create the builder from.- Returns:
- A new
DefaultHttpDestination.Builder
instance. - Since:
- 5.0.0
-
fromProperties
@Nonnull public static DefaultHttpDestination.Builder fromProperties(@Nonnull DestinationProperties properties) Creates a newDefaultHttpDestination
instance from the givenDestinationProperties
by copying all properties returned byDestinationProperties.getPropertyNames()
. In addition, if the givendestination
is an instance ofDefaultHttpDestination
, all additional properties that are specific to theHttpDestinationProperties
instance will be copied as well. This especially also includes any statically addedDestinationHeaderProvider
s andHeader
s attached to thedestination
.Please note that this operation performs a shallow copy only. As a consequence, complex objects (such as the
KeyStore
s) will be copied by reference only, which leads to a shared state between thedestination
and theDefaultHttpDestination
to be created.- Parameters:
properties
- TheDestinationProperties
to create the builder from.- Returns:
- A new
DefaultHttpDestination.Builder
instance. - Throws:
IllegalArgumentException
- if the providedproperties
are not an instance of eitherDefaultDestination
orDefaultHttpDestination
.- Since:
- 5.0.0
-
fromDestination
@Nonnull public static DefaultHttpDestination.Builder fromDestination(@Nonnull Destination destination) Creates a newDefaultHttpDestination
instance from the givenDestination
by copying all properties returned byDestinationProperties.getPropertyNames()
. In addition, if the givendestination
is an instance ofDefaultHttpDestination
, all additional properties that are specific to theHttpDestinationProperties
instance will be copied as well. This especially also includes any statically addedDestinationHeaderProvider
s andHeader
s attached to thedestination
.Please note that this operation performs a shallow copy only. As a consequence, complex objects (such as the
KeyStore
s) will be copied by reference only, which leads to a shared state between thedestination
and theDefaultHttpDestination
to be created.- Parameters:
destination
- TheDestination
to create the builder from.- Returns:
- A new
DefaultHttpDestination.Builder
instance. - Throws:
IllegalArgumentException
- if the provideddestination
is not an instance of eitherDefaultDestination
orDefaultHttpDestination
.- Since:
- 5.0.0
-
equals
-
hashCode
public int hashCode() -
get
Description copied from interface:DestinationProperties
Gets the value associated with the given key (if any).- Specified by:
get
in interfaceDestinationProperties
- Parameters:
key
- The key to get the value for.- Returns:
- An
Option
object containing the value, if any.
-
getPropertyNames
Description copied from interface:DestinationProperties
Retrieves the set of property keys of the destination.- Specified by:
getPropertyNames
in interfaceDestinationProperties
- Returns:
- An iterable of type String which is the set of property keys for a destination
-
get
Description copied from interface:DestinationProperties
Convenience method to cast theObject
return type ofDestinationProperties.get(String)
into the expected type.- Specified by:
get
in 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
Option
object containing the converted value, if any.
-
get
Description copied from interface:DestinationProperties
Convenience method to convert theObject
return type ofDestinationProperties.get(String)
into any expected type.- Specified by:
get
in 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
Option
object containing the converted value, if any.
-
get
Description copied from interface:DestinationProperties
Convenience method to convert theObject
return type ofDestinationProperties.get(String)
into any expected type.- Specified by:
get
in interfaceDestinationProperties
- Type Parameters:
ValueT
- The expected type of the value.- Parameters:
propertyKey
- TheDestinationPropertyKey
for the value to retrieve.- Returns:
- An
Option
object containing the converted value, if any.
-