oracle / ojdbc-extensions

The Oracle JDBC Driver Extensions include providers for centralized configuration or token providers for authentication with the DB.
Universal Permissive License v1.0
13 stars 5 forks source link

38 multi region support in oci #47

Closed norah-li closed 11 months ago

norah-li commented 11 months ago

In this upload, a new Class Ocid is created. We can use the constructor to create an Ocid object: Ocid ocid = new Ocid(ocidString);

And retrieve ocid string using ocid.getContent(), retrieve region using ocid.getRegion().

The parser in Class Ocid parse the region from string ocid. This region can be empty, considering that in some cases, an ocid string does not represent regional resources.

In this upload, database tools connection and secret are using the new Ocid Class to parse region and set region to resolve multi region issue. (Recall multi region issue: there is region 'us-XXX-1' in profile, but we want to support resources in other regions, without changing the profile) When building the client to send request, the region of client is set by client.setRegion(ocid.getRegion)

Please take a look.