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 builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, Prototype.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 Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for OciConfig.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(OciConfig prototype)
      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

      public BUILDER from(OciConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface Prototype.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

      public BUILDER clearRegion()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • region

      public BUILDER region(com.oracle.bmc.Region 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

      public BUILDER authenticationMethod(String 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 OciConfigBlueprint.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), uses ConfigFileAuthenticationDetailsProvider
      • resource-principal - use identity of the OCI resource the service is executed on (fn), uses ResourcePrincipalAuthenticationDetailsProvider, and is available in a separate module helidon-integrations-oci-authentication-resource
      • instance-principal - use identity of the OCI instance the service is running on, uses InstancePrincipalsAuthenticationDetailsProvider, and is available in a separate module helidon-integrations-oci-authentication-resource
      • workload - use workload identity of the OCI Kubernetes workload, available in a separate module helidon-integrations-oci-authentication-workload
      Parameters:
      authenticationMethod - the authentication method to apply
      Returns:
      updated builder instance
      See Also:
    • allowedAuthenticationMethods

      public BUILDER allowedAuthenticationMethods(List<? extends String> allowedAuthenticationMethods)
      List of attempted authentication strategies in case OciConfigBlueprint.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

      public BUILDER addAllowedAuthenticationMethods(List<? extends String> allowedAuthenticationMethods)
      List of attempted authentication strategies in case OciConfigBlueprint.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

      public BUILDER clearConfigMethodConfig()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • configMethodConfig

      public BUILDER configMethodConfig(ConfigMethodConfig configMethodConfig)
      Config method configuration (if provided and used).
      Parameters:
      configMethodConfig - information needed for config OciConfigBlueprint.authenticationMethod()
      Returns:
      updated builder instance
      See Also:
    • configMethodConfig

      public BUILDER configMethodConfig(Consumer<ConfigMethodConfig.Builder> consumer)
      Config method configuration (if provided and used).
      Parameters:
      consumer - information needed for config OciConfigBlueprint.authenticationMethod()
      Returns:
      updated builder instance
      See Also:
    • clearConfigFileMethodConfig

      public BUILDER clearConfigFileMethodConfig()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • configFileMethodConfig

      public BUILDER configFileMethodConfig(ConfigFileMethodConfig configFileMethodConfig)
      Config file method configuration (if provided and used).
      Parameters:
      configFileMethodConfig - information to customize config for OciConfigBlueprint.authenticationMethod()
      Returns:
      updated builder instance
      See Also:
    • configFileMethodConfig

      public BUILDER configFileMethodConfig(Consumer<ConfigFileMethodConfig.Builder> consumer)
      Config file method configuration (if provided and used).
      Parameters:
      consumer - information to customize config for OciConfigBlueprint.authenticationMethod()
      Returns:
      updated builder instance
      See Also:
    • clearSessionTokenMethodConfig

      public BUILDER clearSessionTokenMethodConfig()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • sessionTokenMethodConfig

      public BUILDER sessionTokenMethodConfig(SessionTokenMethodConfig sessionTokenMethodConfig)
      Session token method configuration (if provided and used).
      Parameters:
      sessionTokenMethodConfig - information to customize config for OciConfigBlueprint.authenticationMethod()
      Returns:
      updated builder instance
      See Also:
    • sessionTokenMethodConfig

      public BUILDER sessionTokenMethodConfig(Consumer<SessionTokenMethodConfig.Builder> consumer)
      Session token method configuration (if provided and used).
      Parameters:
      consumer - information to customize config for OciConfigBlueprint.authenticationMethod()
      Returns:
      updated builder instance
      See Also:
    • imdsTimeout

      public BUILDER imdsTimeout(Duration 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

      public BUILDER clearImdsBaseUri()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • imdsBaseUri

      public BUILDER imdsBaseUri(URI 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

      public BUILDER clearImdsDetectRetries()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • imdsDetectRetries

      public BUILDER imdsDetectRetries(int 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

      public BUILDER authenticationTimeout(Duration 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

      public BUILDER clearFederationEndpoint()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • federationEndpoint

      public BUILDER federationEndpoint(URI federationEndpoint)
      Customization of federation endpoint for authentication providers.
      Parameters:
      federationEndpoint - custom federation endpoint URI
      Returns:
      updated builder instance
      See Also:
    • region

      public Optional<com.oracle.bmc.Region> 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:
      the region
    • authenticationMethod

      public String 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 OciConfigBlueprint.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), uses ConfigFileAuthenticationDetailsProvider
      • resource-principal - use identity of the OCI resource the service is executed on (fn), uses ResourcePrincipalAuthenticationDetailsProvider, and is available in a separate module helidon-integrations-oci-authentication-resource
      • instance-principal - use identity of the OCI instance the service is running on, uses InstancePrincipalsAuthenticationDetailsProvider, and is available in a separate module helidon-integrations-oci-authentication-resource
      • workload - use workload identity of the OCI Kubernetes workload, available in a separate module helidon-integrations-oci-authentication-workload
      Returns:
      the authentication method
    • allowedAuthenticationMethods

      public List<String> allowedAuthenticationMethods()
      List of attempted authentication strategies in case OciConfigBlueprint.authenticationMethod() is set to "auto".

      In case the list is empty, all available strategies will be tried, ordered by their Weight

      Returns:
      the allowed authentication methods
      See Also:
      • OciConfigBlueprint.authenticationMethod()
    • configMethodConfig

      public Optional<ConfigMethodConfig> configMethodConfig()
      Config method configuration (if provided and used).
      Returns:
      the config method config
    • configFileMethodConfig

      public Optional<ConfigFileMethodConfig> configFileMethodConfig()
      Config file method configuration (if provided and used).
      Returns:
      the config file method config
    • sessionTokenMethodConfig

      public Optional<SessionTokenMethodConfig> sessionTokenMethodConfig()
      Session token method configuration (if provided and used).
      Returns:
      the session token method config
    • imdsTimeout

      public Duration 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 imds timeout
    • imdsBaseUri

      public Optional<URI> imdsBaseUri()
      The OCI IMDS URI (http URL pointing to the metadata service, if customization needed).
      Returns:
      the imds base uri
    • imdsDetectRetries

      public Optional<Integer> imdsDetectRetries()
      Customize the number of retries to contact IMDS service.
      Returns:
      the imds detect retries
    • authenticationTimeout

      public Duration 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:
      the authentication timeout
    • federationEndpoint

      public Optional<URI> federationEndpoint()
      Customization of federation endpoint for authentication providers.
      Returns:
      the federation endpoint
    • config

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.