- CDI extension for OCI Object storage
This CDI portable extension provides support for injecting an Oracle Cloud Infrastructure Object Storage client in your Helidon MicroProfile applications.
Prerequisites
Declare the following dependency in your project:
<dependency>
<groupId>io.helidon.integrations.cdi</groupId>
<artifactId>helidon-integrations-cdi-oci-objectstorage</artifactId>
</dependency>content_copy
Injecting an Object Storage client
Field-injection example
@Inject
private ObjectStorage client;content_copy
Constructor-injection example
private final ObjectStorage client;
@Inject
public YourConstructor(@Named("orders") ObjectStorage client) {
super();
this.client = client;
}content_copy
The extension implements this injection point by creating an Object Storage client object in the application scope.
You can configure the object using MicroProfile config. For example, the Object Storage client created above can be configured as follows:
META-INF/microprofile-config.properties
oci.auth.fingerprint=
oci.auth.keyFile=
oci.auth.passphraseCharacters=
oci.auth.user=
oci.auth.tenancy=
oci.objectstorage.region=
oci.objectstorage.namespace=content_copy
These properties are described in the Oracle Cloud Infrastructure Object Storage Java SDK documentation.