Module io.helidon.integrations.oci
Package io.helidon.integrations.oci
Class OciConfig.BuilderBase<BUILDER extends OciConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends OciConfig>
java.lang.Object
io.helidon.integrations.oci.OciConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
OciConfig.Builder
- Enclosing interface:
OciConfig
public abstract static class OciConfig.BuilderBase<BUILDER extends OciConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends OciConfig>
extends Object
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
OciConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllowedAuthenticationMethods(List<String> allowedAuthenticationMethods) List of attempted authentication strategies in caseOciConfig.authenticationMethod()is set to "auto".List of attempted authentication strategies in caseOciConfig.authenticationMethod()is set to "auto".allowedAuthenticationMethods(List<String> allowedAuthenticationMethods) List of attempted authentication strategies in caseOciConfig.authenticationMethod()is set to "auto".Authentication method to use.authenticationMethod(String authenticationMethod) Authentication method to use.Timeout of authentication operations, where applicable.authenticationTimeout(Duration authenticationTimeout) Timeout of authentication operations, where applicable.Clear all allowedAuthenticationMethods.Clear existing value of configFileMethodConfig.Clear existing value of configMethodConfig.Clear existing value of federationEndpoint.Clear existing value of imdsBaseUri.Clear existing value of imdsDetectRetries.Clear existing value of region.Clear existing value of sessionTokenMethodConfig.Clear existing value of tenantId.config()Get the config used to update the builder.Deprecated.Update builder from configuration (node of this type).Config file method configuration (if provided and used).configFileMethodConfig(ConfigFileMethodConfig configFileMethodConfig) Config file method configuration (if provided and used).Config file method configuration (if provided and used).configFileMethodConfig(Supplier<? extends ConfigFileMethodConfig> supplier) Config file method configuration (if provided and used).Config method configuration (if provided and used).configMethodConfig(ConfigMethodConfig configMethodConfig) Config method configuration (if provided and used).configMethodConfig(Consumer<ConfigMethodConfig.Builder> consumer) Config method configuration (if provided and used).configMethodConfig(Supplier<? extends ConfigMethodConfig> supplier) Config method configuration (if provided and used).Customization of federation endpoint for authentication providers.federationEndpoint(URI federationEndpoint) Customization of federation endpoint for authentication providers.Update this builder from an existing prototype instance.from(OciConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.The OCI IMDS URI (http URL pointing to the metadata service, if customization needed).imdsBaseUri(URI imdsBaseUri) The OCI IMDS URI (http URL pointing to the metadata service, if customization needed).Customize the number of retries to contact IMDS service.imdsDetectRetries(int imdsDetectRetries) Customize the number of retries to contact IMDS service.The OCI IMDS connection timeout.imdsTimeout(Duration imdsTimeout) The OCI IMDS connection timeout.protected voidHandles providers and decorators.Optional<com.oracle.bmc.Region> region()Explicit region.region(com.oracle.bmc.Region region) Explicit region.Session token method configuration (if provided and used).sessionTokenMethodConfig(SessionTokenMethodConfig sessionTokenMethodConfig) Session token method configuration (if provided and used).Session token method configuration (if provided and used).sessionTokenMethodConfig(Supplier<? extends SessionTokenMethodConfig> supplier) Session token method configuration (if provided and used).tenantId()OCI tenant id for Instance Principal, Resource Principal or OKE Workload.OCI tenant id for Instance Principal, Resource Principal or OKE Workload.toString()protected voidValidates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends OciConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends OciConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends OciConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends OciConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
clearRegion
Clear existing value of region.- Returns:
- updated builder instance
- See Also:
-
region
Explicit region. The configured region will be used by region provider. This may be ignored by authentication detail providers, as in most cases region is provided by them.- Parameters:
region- explicit region- Returns:
- updated builder instance
- See Also:
-
authenticationMethod
Authentication method to use. If the configured method is not available, an exception would be thrown for OCI related services.Known and supported authentication strategies for public OCI:
- "auto" - use the list of
OciConfig.allowedAuthenticationMethods()(in the provided order), and choose the first one capable of providing data - "config" -
use configuration of the application to obtain values needed to set up connectivity, uses
SimpleAuthenticationDetailsProvider - "config-file" -
use configuration file of OCI (
home/.oci/config), usesConfigFileAuthenticationDetailsProvider - "session-token" -
use configuration of the application to obtain values needed to set up connectivity, uses
SessionTokenAuthenticationDetailsProvider resource-principal- use identity of the OCI resource the service is executed on (fn), usesResourcePrincipalAuthenticationDetailsProvider, and is available in a separate modulehelidon-integrations-oci-authentication-resourceinstance-principal- use identity of the OCI instance the service is running on, usesInstancePrincipalsAuthenticationDetailsProvider, and is available in a separate modulehelidon-integrations-oci-authentication-resourceoke-workload-identity- use identity of the OCI Kubernetes workload, usescom.oracle.bmc.auth.okeworkloadidentity.OkeWorkloadIdentityAuthenticationDetailsProvider, and is available in a separate modulehelidon-integrations-oci-authentication-oke-workload
- Parameters:
authenticationMethod- the authentication method to apply- Returns:
- updated builder instance
- See Also:
- "auto" - use the list of
-
clearAllowedAuthenticationMethods
Clear all allowedAuthenticationMethods.- Returns:
- updated builder instance
- See Also:
-
allowedAuthenticationMethods
List of attempted authentication strategies in caseOciConfig.authenticationMethod()is set to "auto".In case the list is empty, all available strategies will be tried, ordered by their
Weight- Parameters:
allowedAuthenticationMethods- list of authentication strategies to be tried- Returns:
- updated builder instance
- See Also:
-
addAllowedAuthenticationMethods
List of attempted authentication strategies in caseOciConfig.authenticationMethod()is set to "auto".In case the list is empty, all available strategies will be tried, ordered by their
Weight- Parameters:
allowedAuthenticationMethods- list of authentication strategies to be tried- Returns:
- updated builder instance
- See Also:
-
clearConfigMethodConfig
Clear existing value of configMethodConfig.- Returns:
- updated builder instance
- See Also:
-
configMethodConfig
Config method configuration (if provided and used).- Parameters:
configMethodConfig- information needed for configOciConfig.authenticationMethod()- Returns:
- updated builder instance
- See Also:
-
configMethodConfig
Config method configuration (if provided and used).- Parameters:
consumer- consumer of builder of information needed for configOciConfig.authenticationMethod()- Returns:
- updated builder instance
- See Also:
-
configMethodConfig
Config method configuration (if provided and used).- Parameters:
supplier- supplier of information needed for configOciConfig.authenticationMethod()- Returns:
- updated builder instance
- See Also:
-
clearConfigFileMethodConfig
Clear existing value of configFileMethodConfig.- Returns:
- updated builder instance
- See Also:
-
configFileMethodConfig
Config file method configuration (if provided and used).- Parameters:
configFileMethodConfig- information to customize config forOciConfig.authenticationMethod()- Returns:
- updated builder instance
- See Also:
-
configFileMethodConfig
Config file method configuration (if provided and used).- Parameters:
consumer- consumer of builder of information to customize config forOciConfig.authenticationMethod()- Returns:
- updated builder instance
- See Also:
-
configFileMethodConfig
Config file method configuration (if provided and used).- Parameters:
supplier- supplier of information to customize config forOciConfig.authenticationMethod()- Returns:
- updated builder instance
- See Also:
-
clearSessionTokenMethodConfig
Clear existing value of sessionTokenMethodConfig.- Returns:
- updated builder instance
- See Also:
-
sessionTokenMethodConfig
Session token method configuration (if provided and used).- Parameters:
sessionTokenMethodConfig- information to customize config forOciConfig.authenticationMethod()- Returns:
- updated builder instance
- See Also:
-
sessionTokenMethodConfig
Session token method configuration (if provided and used).- Parameters:
consumer- consumer of builder of information to customize config forOciConfig.authenticationMethod()- Returns:
- updated builder instance
- See Also:
-
sessionTokenMethodConfig
Session token method configuration (if provided and used).- Parameters:
supplier- supplier of information to customize config forOciConfig.authenticationMethod()- Returns:
- updated builder instance
- See Also:
-
imdsTimeout
The OCI IMDS connection timeout. This is used to auto-detect availability.This configuration property is used when attempting to connect to the metadata service.
- Parameters:
imdsTimeout- the OCI IMDS connection timeout- Returns:
- updated builder instance
- See Also:
-
clearImdsBaseUri
Clear existing value of imdsBaseUri.- Returns:
- updated builder instance
- See Also:
-
imdsBaseUri
The OCI IMDS URI (http URL pointing to the metadata service, if customization needed).- Parameters:
imdsBaseUri- the OCI IMDS URI- Returns:
- updated builder instance
- See Also:
-
clearImdsDetectRetries
Clear existing value of imdsDetectRetries.- Returns:
- updated builder instance
- See Also:
-
imdsDetectRetries
Customize the number of retries to contact IMDS service.- Parameters:
imdsDetectRetries- number of retries, each provider has its own defaults- Returns:
- updated builder instance
- See Also:
-
authenticationTimeout
Timeout of authentication operations, where applicable. This is a timeout for each operation (if there are retries, each timeout will be this duration). Defaults to 10 seconds.- Parameters:
authenticationTimeout- authentication operation timeout- Returns:
- updated builder instance
- See Also:
-
clearFederationEndpoint
Clear existing value of federationEndpoint.- Returns:
- updated builder instance
- See Also:
-
federationEndpoint
Customization of federation endpoint for authentication providers.- Parameters:
federationEndpoint- custom federation endpoint URI- Returns:
- updated builder instance
- See Also:
-
clearTenantId
Clear existing value of tenantId.- Returns:
- updated builder instance
- See Also:
-
tenantId
OCI tenant id for Instance Principal, Resource Principal or OKE Workload.- Parameters:
tenantId- the OCI tenant id- Returns:
- updated builder instance
- See Also:
-
region
Explicit region. The configured region will be used by region provider. This may be ignored by authentication detail providers, as in most cases region is provided by them.- Returns:
- explicit region
-
authenticationMethod
Authentication method to use. If the configured method is not available, an exception would be thrown for OCI related services.Known and supported authentication strategies for public OCI:
- "auto" - use the list of
OciConfig.allowedAuthenticationMethods()(in the provided order), and choose the first one capable of providing data - "config" -
use configuration of the application to obtain values needed to set up connectivity, uses
SimpleAuthenticationDetailsProvider - "config-file" -
use configuration file of OCI (
home/.oci/config), usesConfigFileAuthenticationDetailsProvider - "session-token" -
use configuration of the application to obtain values needed to set up connectivity, uses
SessionTokenAuthenticationDetailsProvider resource-principal- use identity of the OCI resource the service is executed on (fn), usesResourcePrincipalAuthenticationDetailsProvider, and is available in a separate modulehelidon-integrations-oci-authentication-resourceinstance-principal- use identity of the OCI instance the service is running on, usesInstancePrincipalsAuthenticationDetailsProvider, and is available in a separate modulehelidon-integrations-oci-authentication-resourceoke-workload-identity- use identity of the OCI Kubernetes workload, usescom.oracle.bmc.auth.okeworkloadidentity.OkeWorkloadIdentityAuthenticationDetailsProvider, and is available in a separate modulehelidon-integrations-oci-authentication-oke-workload
- Returns:
- the authentication method to apply
- "auto" - use the list of
-
allowedAuthenticationMethods
List of attempted authentication strategies in caseOciConfig.authenticationMethod()is set to "auto".In case the list is empty, all available strategies will be tried, ordered by their
Weight- Returns:
- list of authentication strategies to be tried
- See Also:
-
configMethodConfig
Config method configuration (if provided and used).- Returns:
- information needed for config
OciConfig.authenticationMethod()
-
configFileMethodConfig
Config file method configuration (if provided and used).- Returns:
- information to customize config for
OciConfig.authenticationMethod()
-
sessionTokenMethodConfig
Session token method configuration (if provided and used).- Returns:
- information to customize config for
OciConfig.authenticationMethod()
-
imdsTimeout
The OCI IMDS connection timeout. This is used to auto-detect availability.This configuration property is used when attempting to connect to the metadata service.
- Returns:
- the OCI IMDS connection timeout
-
imdsBaseUri
The OCI IMDS URI (http URL pointing to the metadata service, if customization needed).- Returns:
- the OCI IMDS URI
-
imdsDetectRetries
Customize the number of retries to contact IMDS service.- Returns:
- number of retries, each provider has its own defaults
-
authenticationTimeout
Timeout of authentication operations, where applicable. This is a timeout for each operation (if there are retries, each timeout will be this duration). Defaults to 10 seconds.- Returns:
- authentication operation timeout
-
federationEndpoint
Customization of federation endpoint for authentication providers.- Returns:
- custom federation endpoint URI
-
tenantId
OCI tenant id for Instance Principal, Resource Principal or OKE Workload.- Returns:
- the OCI tenant id
-
config
Get the config used to update the builder.- Returns:
- configuration
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-
config(io.helidon.config.Config)