Class OciConfigConfigSource

  • All Implemented Interfaces:
    ConfigSource

    public final class OciConfigConfigSource
    extends Object
    implements ConfigSource
    A ConfigSource implementation that is backed by a ConfigFileAuthenticationDetailsProvider.
    • Method Detail

      • getName

        public String getName()
        Returns the name of this OciConfigConfigSource.

        This method never returns null.

        This method returns the same value every time it is invoked.

        Overrides of this method must not return null.

        Overrides of this method must return the same value every time they are invoked.

        The default return value of this method is subject to change without notice.

        Specified by:
        getName in interface ConfigSource
        Returns:
        the name of this OciConfigConfigSource; never null
        See Also:
        ConfigSource.getName()
      • getOrdinal

        public int getOrdinal()
        Returns the ordinal of this OciConfigConfigSource.

        This implementation returns 101, which will ensure values from this ConfigSource implementation will trump those from /META-INF/microprofile-config.properties but none other.

        Specified by:
        getOrdinal in interface ConfigSource
        Returns:
        the ordinal of this OciConfigConfigSource; 101 by default
      • getValue

        public String getValue​(String propertyName)
        Returns a value for the supplied propertyName, or null if there is no such value.

        This method may return null.

        Specified by:
        getValue in interface ConfigSource
        Parameters:
        propertyName - the name of the property for which a value should be returned; may be null in which case null will be returned
        Returns:
        a value for the supplied propertyName, or null
      • getProperties

        public Map<String,​String> getProperties()
        Returns a Map consisting of all property names and their values that this OciConfigConfigSource knows about at the time that this method is invoked.

        This method never returns null.

        The returned Map is immutable and safe for concurrent use by multiple threads.

        This method may return different Map instances when invoked at different times.

        The returned Map, if non-empty, is guaranteed to contain at least the following keys:

        • oci.auth.fingerprint
        • oci.auth.passphraseCharacters
        • oci.auth.tenancy
        • oci.auth.user

        The MicroProfile Config specification does not give any guidance on whether the return value of an implementation of the ConfigSource.getProperties() method should be immutable and/or threadsafe. This implementation returns an immutable Map.

        Specified by:
        getProperties in interface ConfigSource
        Returns:
        a non-null Map of properties known to this OciConfigConfigSource
        Throws:
        IllegalStateException - if there was a problem reading the OCI config file
        See Also:
        ConfigSource.getProperties()