Skip to content

Commit ecc36a5

Browse files
committed
Updated OCI regions
1 parent a355ecc commit ecc36a5

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed

CHANGELOG.md

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

77
### Changed
88
- Allow application to retry a QueryRequest if it gets a timeout exception and the query only does reads
9+
- Cloud only: Updated OCI regions
910

1011
## [5.3.6] 2022-08-23
1112

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

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ public class Region {
5050
private static final Map<String, Region> OC1_REGIONS = new HashMap<>();
5151
private static final Map<String, Region> GOV_REGIONS = new HashMap<>();
5252
private static final Map<String, Region> OC4_REGIONS = new HashMap<>();
53+
private static final Map<String, Region> OC5_REGIONS = new HashMap<>();
5354
private static final Map<String, Region> OC8_REGIONS = new HashMap<>();
5455
private static final Map<String, Region> OC9_REGIONS = new HashMap<>();
5556
private static final Map<String, Region> OC10_REGIONS = new HashMap<>();
57+
private static final Map<String, Region> OC14_REGIONS = new HashMap<>();
5658

5759
/* OC1 */
5860
public static final Region AF_JOHANNESBURG_1 = new Region("af-johannesburg-1");
@@ -111,6 +113,9 @@ public class Region {
111113
public static final Region UK_GOV_LONDON_1 = new Region("uk-gov-london-1");
112114
public static final Region UK_GOV_CARDIFF_1 = new Region("uk-gov-cardiff-1");
113115

116+
/* OC5 */
117+
public static final Region US_TACOMA_1 = new Region("us-tacoma-1");
118+
114119
/* OC8 */
115120
public static final Region AP_CHIYODA_1 = new Region("ap-chiyoda-1");
116121
public static final Region AP_IBARAKI_1 = new Region("ap-ibaraki-1");
@@ -121,6 +126,9 @@ public class Region {
121126
/* OC10 */
122127
public static final Region AP_DCC_CANBERRA_1 = new Region("ap-dcc-canberra-1");
123128

129+
/* OC14 */
130+
public static final Region AP_DCC_MILAN_1 = new Region("eu-dcc-milan-1");
131+
124132
static {
125133
/* OC1 */
126134
/* AF */
@@ -184,6 +192,9 @@ public class Region {
184192
OC4_REGIONS.put(UK_GOV_LONDON_1.getRegionId(), UK_GOV_LONDON_1);
185193
OC4_REGIONS.put(UK_GOV_CARDIFF_1.getRegionId(), UK_GOV_CARDIFF_1);
186194

195+
/* OC5 */
196+
OC5_REGIONS.put(US_TACOMA_1.getRegionId(), US_TACOMA_1);
197+
187198
/* OC8 */
188199
OC8_REGIONS.put(AP_CHIYODA_1.getRegionId(), AP_CHIYODA_1);
189200
OC8_REGIONS.put(AP_IBARAKI_1.getRegionId(), AP_IBARAKI_1);
@@ -193,6 +204,9 @@ public class Region {
193204

194205
/* OC10 */
195206
OC10_REGIONS.put(AP_DCC_CANBERRA_1.getRegionId(), AP_DCC_CANBERRA_1);
207+
208+
/* OC14 */
209+
OC14_REGIONS.put(AP_DCC_MILAN_1.getRegionId(), AP_DCC_MILAN_1);
196210
}
197211

198212
private final static MessageFormat OC1_EP_BASE = new MessageFormat(
@@ -201,12 +215,16 @@ public class Region {
201215
"https://nosql.{0}.oci.oraclegovcloud.com");
202216
private final static MessageFormat OC4_EP_BASE = new MessageFormat(
203217
"https://nosql.{0}.oci.oraclegovcloud.uk");
218+
private final static MessageFormat OC5_EP_BASE = new MessageFormat(
219+
"https://nosql.{0}.oci.oraclerealm5.com");
204220
private final static MessageFormat OC8_EP_BASE = new MessageFormat(
205221
"https://nosql.{0}.oci.oraclecloud8.com");
206222
private final static MessageFormat OC9_EP_BASE = new MessageFormat(
207223
"https://nosql.{0}.oci.oraclecloud9.com");
208224
private final static MessageFormat OC10_EP_BASE = new MessageFormat(
209225
"https://nosql.{0}.oci.oraclecloud10.com");
226+
private final static MessageFormat OC14_EP_BASE = new MessageFormat(
227+
"https://nosql.{0}.oci.oraclecloud14.com");
210228

211229
private String regionId;
212230

@@ -228,6 +246,9 @@ public String endpoint() {
228246
if (isOC4Region(regionId)) {
229247
return OC4_EP_BASE.format(new Object[] { regionId });
230248
}
249+
if (isOC5Region(regionId)) {
250+
return OC5_EP_BASE.format(new Object[] { regionId });
251+
}
231252
if (isOC8Region(regionId)) {
232253
return OC8_EP_BASE.format(new Object[] { regionId });
233254
}
@@ -237,6 +258,9 @@ public String endpoint() {
237258
if (isOC10Region(regionId)) {
238259
return OC10_EP_BASE.format(new Object[] { regionId });
239260
}
261+
if (isOC14Region(regionId)) {
262+
return OC14_EP_BASE.format(new Object[] { regionId });
263+
}
240264
throw new IllegalArgumentException(
241265
"Unable to find endpoint for unknwon region" + regionId);
242266
}
@@ -258,6 +282,9 @@ public static Region fromRegionId(String regionId) {
258282
if (region == null) {
259283
region = OC4_REGIONS.get(regionId);
260284
}
285+
if (region == null) {
286+
region = OC5_REGIONS.get(regionId);
287+
}
261288
if (region == null) {
262289
region = GOV_REGIONS.get(regionId);
263290
}
@@ -270,6 +297,9 @@ public static Region fromRegionId(String regionId) {
270297
if (region == null) {
271298
region = OC10_REGIONS.get(regionId);
272299
}
300+
if (region == null) {
301+
region = OC14_REGIONS.get(regionId);
302+
}
273303

274304
return region;
275305
}
@@ -313,6 +343,16 @@ public static boolean isOC4Region(String regionId) {
313343
return (OC4_REGIONS.get(regionId) != null);
314344
}
315345

346+
/**
347+
* @hidden
348+
* Internal use only
349+
* @param regionId the region id
350+
* @return the value
351+
*/
352+
public static boolean isOC5Region(String regionId) {
353+
return (OC5_REGIONS.get(regionId) != null);
354+
}
355+
316356
/**
317357
* @hidden
318358
* Internal use only
@@ -343,6 +383,16 @@ public static boolean isOC10Region(String regionId) {
343383
return (OC10_REGIONS.get(regionId) != null);
344384
}
345385

386+
/**
387+
* @hidden
388+
* Internal use only
389+
* @param regionId the region id
390+
* @return the value
391+
*/
392+
public static boolean isOC14Region(String regionId) {
393+
return (OC14_REGIONS.get(regionId) != null);
394+
}
395+
346396
/**
347397
* @hidden
348398
* Internal use only
@@ -370,6 +420,15 @@ public static Collection<Region> getOC4Regions() {
370420
return OC4_REGIONS.values();
371421
}
372422

423+
/**
424+
* @hidden
425+
* Internal use only
426+
* @return the regions
427+
*/
428+
public static Collection<Region> getOC5Regions() {
429+
return OC5_REGIONS.values();
430+
}
431+
373432
/**
374433
* @hidden
375434
* Internal use only
@@ -397,6 +456,15 @@ public static Collection<Region> getOC10Regions() {
397456
return OC10_REGIONS.values();
398457
}
399458

459+
/**
460+
* @hidden
461+
* Internal use only
462+
* @return the regions
463+
*/
464+
public static Collection<Region> getOC14Regions() {
465+
return OC14_REGIONS.values();
466+
}
467+
400468
/**
401469
* @hidden
402470
* Internal use only

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,16 @@ class Utils {
9797
"https://auth.{0}.oraclegovcloud.com");
9898
private final static MessageFormat OC4_EP_BASE = new MessageFormat(
9999
"https://auth.{0}.oraclegovcloud.uk");
100+
private final static MessageFormat OC5_EP_BASE = new MessageFormat(
101+
"https://auth.{0}.oraclerealm5.com");
100102
private final static MessageFormat OC8_EP_BASE = new MessageFormat(
101103
"https://auth.{0}.oraclecloud8.com");
102104
private final static MessageFormat OC9_EP_BASE = new MessageFormat(
103105
"https://auth.{0}.oraclecloud9.com");
104106
private final static MessageFormat OC10_EP_BASE = new MessageFormat(
105107
"https://auth.{0}.oraclecloud10.com");
108+
private final static MessageFormat OC14_EP_BASE = new MessageFormat(
109+
"https://auth.{0}.oraclecloud14.com");
106110

107111
static {
108112
/* OC1 */
@@ -162,6 +166,9 @@ class Utils {
162166
IAM_URI.put("ltn", OC4_EP_BASE.format(new Object[] {"uk-gov-london-1"}));
163167
IAM_URI.put("brs", OC4_EP_BASE.format(new Object[] {"uk-gov-cardiff-1"}));
164168

169+
/* OC5 */
170+
IAM_URI.put("tiw", OC5_EP_BASE.format(new Object[] {"us-tacoma-1"}));
171+
165172
/* OC8 */
166173
IAM_URI.put("nja", OC8_EP_BASE.format(new Object[] {"ap-chiyoda-1"}));
167174
IAM_URI.put("ukb", OC8_EP_BASE.format(new Object[] {"ap-ibaraki-1"}));
@@ -171,6 +178,9 @@ class Utils {
171178

172179
/* OC10 */
173180
IAM_URI.put("wga", OC10_EP_BASE.format(new Object[] {"ap-dcc-canberra-1"}));
181+
182+
/* OC14 */
183+
IAM_URI.put("bgy", OC14_EP_BASE.format(new Object[] {"eu-dcc-milan-1"}));
174184
}
175185

176186
static String getIAMURL(String regionIdOrCode) {
@@ -185,6 +195,9 @@ static String getIAMURL(String regionIdOrCode) {
185195
if (Region.isOC4Region(regionIdOrCode)) {
186196
return OC4_EP_BASE.format(new Object[] {regionIdOrCode});
187197
}
198+
if (Region.isOC5Region(regionIdOrCode)) {
199+
return OC5_EP_BASE.format(new Object[] {regionIdOrCode});
200+
}
188201
if (Region.isOC8Region(regionIdOrCode)) {
189202
return OC8_EP_BASE.format(new Object[] {regionIdOrCode});
190203
}
@@ -194,6 +207,9 @@ static String getIAMURL(String regionIdOrCode) {
194207
if (Region.isOC10Region(regionIdOrCode)) {
195208
return OC10_EP_BASE.format(new Object[] {regionIdOrCode});
196209
}
210+
if (Region.isOC14Region(regionIdOrCode)) {
211+
return OC14_EP_BASE.format(new Object[] {regionIdOrCode});
212+
}
197213
}
198214

199215
return uri;

0 commit comments

Comments
 (0)