Skip to content

Commit 90dec04

Browse files
authored
New OCI region code: IZQ / OC31 / ap-hobsonville-1 (#109)
1 parent 5f4ea09 commit 90dec04

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
55
## Unreleased
66

77
### Added
8-
- Cloud only: added new OCI regions (TYO, AHU, DAC, DOH)
8+
- Cloud only: added new OCI regions (TYO, AHU, DAC, DOH, IZQ)
99
- Cloud only: added use of ETag in AddReplicaRequest and DropReplicaRequest
1010

1111
## [5.4.14] 2023-11-17

driver/src/main/java/oracle/nosql/driver/Region.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public class Region {
6666
private static final Map<String, Region> OC26_REGIONS = new HashMap<>();
6767
private static final Map<String, Region> OC27_REGIONS = new HashMap<>();
6868
private static final Map<String, Region> OC28_REGIONS = new HashMap<>();
69+
private static final Map<String, Region> OC31_REGIONS = new HashMap<>();
6970

7071
/* OC1 */
7172
/** JNB */
@@ -259,6 +260,10 @@ public class Region {
259260
/** DRS */
260261
public static final Region US_DCC_SWJORDAN_2 = new Region("us-dcc-swjordan-2");
261262

263+
/* OC31 */
264+
/** IZQ */
265+
public static final Region AP_HOBSONVILLE_1 = new Region("ap-hobsonville-1");
266+
262267
static {
263268
/* OC1 */
264269
/* AF */
@@ -386,6 +391,9 @@ public class Region {
386391

387392
/* OC28 */
388393
OC28_REGIONS.put(US_DCC_SWJORDAN_2.getRegionId(), US_DCC_SWJORDAN_2);
394+
395+
/* OC31 */
396+
OC31_REGIONS.put(AP_HOBSONVILLE_1.getRegionId(), AP_HOBSONVILLE_1);
389397
}
390398

391399
private final static MessageFormat OC1_EP_BASE = new MessageFormat(
@@ -428,6 +436,8 @@ public class Region {
428436
"https://nosql.{0}.oci.oraclecloud27.com");
429437
private final static MessageFormat OC28_EP_BASE = new MessageFormat(
430438
"https://nosql.{0}.oci.oraclecloud28.com");
439+
private final static MessageFormat OC31_EP_BASE = new MessageFormat(
440+
"https://nosql.{0}.oci.sovereigncloud.nz");
431441

432442
private String regionId;
433443

@@ -500,6 +510,9 @@ public String endpoint() {
500510
if (isOC28Region(regionId)) {
501511
return OC28_EP_BASE.format(new Object[] { regionId });
502512
}
513+
if (isOC31Region(regionId)) {
514+
return OC31_EP_BASE.format(new Object[] { regionId });
515+
}
503516
throw new IllegalArgumentException(
504517
"Unable to find endpoint for unknown region" + regionId);
505518
}
@@ -575,6 +588,9 @@ public static Region fromRegionId(String regionId) {
575588
if (region == null) {
576589
region = OC28_REGIONS.get(regionId);
577590
}
591+
if (region == null) {
592+
region = OC31_REGIONS.get(regionId);
593+
}
578594

579595
return region;
580596
}
@@ -788,6 +804,16 @@ public static boolean isOC28Region(String regionId) {
788804
return (OC28_REGIONS.get(regionId) != null);
789805
}
790806

807+
/**
808+
* @hidden
809+
* Internal use only
810+
* @param regionId the region id
811+
* @return the value
812+
*/
813+
public static boolean isOC31Region(String regionId) {
814+
return (OC31_REGIONS.get(regionId) != null);
815+
}
816+
791817
/**
792818
* @hidden
793819
* Internal use only

driver/src/main/java/oracle/nosql/driver/iam/Utils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ class Utils {
131131
"https://auth.{0}.oraclecloud27.com");
132132
private final static MessageFormat OC28_EP_BASE = new MessageFormat(
133133
"https://auth.{0}.oraclecloud28.com");
134+
private final static MessageFormat OC31_EP_BASE = new MessageFormat(
135+
"https://auth.{0}.sovereigncloud.nz");
134136

135137
static {
136138
/* OC1 */
@@ -254,6 +256,9 @@ class Utils {
254256

255257
/* OC28 */
256258
IAM_URI.put("drs", OC28_EP_BASE.format(new Object[] {"us-dcc-swjordan-2"}));
259+
260+
/* OC31 */
261+
IAM_URI.put("izq", OC31_EP_BASE.format(new Object[] {"ap-hobsonville-1"}));
257262
}
258263

259264
static String getIAMURL(String regionIdOrCode) {
@@ -319,6 +324,9 @@ static String getIAMURL(String regionIdOrCode) {
319324
if (Region.isOC28Region(regionIdOrCode)) {
320325
return OC28_EP_BASE.format(new Object[] {regionIdOrCode});
321326
}
327+
if (Region.isOC31Region(regionIdOrCode)) {
328+
return OC31_EP_BASE.format(new Object[] {regionIdOrCode});
329+
}
322330
}
323331

324332
return uri;

0 commit comments

Comments
 (0)