Skip to content

Commit ec02ea7

Browse files
authored
Added new regions (NAP, AVZ, AGA, VAP)
Add regions: eu-dcc-rome-1, eu-dcc-zurich-1, us-saltlake-2, sa-valparaiso-1
1 parent c678dad commit ec02ea7

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
44

55
## Unreleased
66

7+
### Added
8+
- Cloud only: added new OCI regions (NAP, AVZ, AGA, VAP)
9+
710
### Changed
811
- Moved a couple internal log messages to FINE instead of INFO
912
- Cleaned up messaging when can't connect to server

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public class Region {
5959
private static final Map<String, Region> OC17_REGIONS = new HashMap<>();
6060
private static final Map<String, Region> OC19_REGIONS = new HashMap<>();
6161
private static final Map<String, Region> OC20_REGIONS = new HashMap<>();
62+
private static final Map<String, Region> OC22_REGIONS = new HashMap<>();
63+
private static final Map<String, Region> OC24_REGIONS = new HashMap<>();
6264

6365
/* OC1 */
6466
public static final Region AF_JOHANNESBURG_1 = new Region("af-johannesburg-1");
@@ -97,13 +99,15 @@ public class Region {
9799
public static final Region US_ASHBURN_1 = new Region("us-ashburn-1");
98100
public static final Region US_PHOENIX_1 = new Region("us-phoenix-1");
99101
public static final Region US_SANJOSE_1 = new Region("us-sanjose-1");
102+
public static final Region US_SALTLAKE_2 = new Region("us-saltlake-2");
100103
public static final Region US_CHICAGO_1 = new Region("us-chicago-1");
101104

102105
public static final Region CA_MONTREAL_1 = new Region("ca-montreal-1");
103106
public static final Region CA_TORONTO_1 = new Region("ca-toronto-1");
104107

105108
public static final Region SA_SAOPAULO_1 = new Region("sa-saopaulo-1");
106109
public static final Region SA_SANTIAGO_1 = new Region("sa-santiago-1");
110+
public static final Region SA_VALPARAISO_1 = new Region("sa-valparaiso-1");
107111
public static final Region SA_VINHEDO_1 = new Region("sa-vinhedo-1");
108112

109113
/* OC2 */
@@ -155,6 +159,12 @@ public class Region {
155159
/* OC20 */
156160
public static final Region EU_JOVANOVAC_1 = new Region("eu-jovanovac-1");
157161

162+
/* OC22 */
163+
public static final Region EU_DCC_ROME_1 = new Region("eu-dcc-rome-1");
164+
165+
/* OC24 */
166+
public static final Region EU_DCC_ZURICH_1 = new Region("eu-dcc-zurich-1");
167+
158168
static {
159169
/* OC1 */
160170
/* AF */
@@ -196,12 +206,14 @@ public class Region {
196206
/* LAD */
197207
OC1_REGIONS.put(SA_SAOPAULO_1.getRegionId(), SA_SAOPAULO_1);
198208
OC1_REGIONS.put(SA_SANTIAGO_1.getRegionId(), SA_SANTIAGO_1);
209+
OC1_REGIONS.put(SA_VALPARAISO_1.getRegionId(), SA_VALPARAISO_1);
199210
OC1_REGIONS.put(SA_VINHEDO_1.getRegionId(), SA_VINHEDO_1);
200211

201212
/* North America */
202213
OC1_REGIONS.put(US_ASHBURN_1.getRegionId(), US_ASHBURN_1);
203214
OC1_REGIONS.put(US_PHOENIX_1.getRegionId(), US_PHOENIX_1);
204215
OC1_REGIONS.put(US_SANJOSE_1.getRegionId(), US_SANJOSE_1);
216+
OC1_REGIONS.put(US_SALTLAKE_2.getRegionId(), US_SALTLAKE_2);
205217
OC1_REGIONS.put(US_CHICAGO_1.getRegionId(), US_CHICAGO_1);
206218

207219
OC1_REGIONS.put(CA_MONTREAL_1.getRegionId(), CA_MONTREAL_1);
@@ -255,6 +267,12 @@ public class Region {
255267

256268
/* OC20 */
257269
OC20_REGIONS.put(EU_JOVANOVAC_1.getRegionId(), EU_JOVANOVAC_1);
270+
271+
/* OC22 */
272+
OC22_REGIONS.put(EU_DCC_ROME_1.getRegionId(), EU_DCC_ROME_1);
273+
274+
/* OC24 */
275+
OC24_REGIONS.put(EU_DCC_ZURICH_1.getRegionId(), EU_DCC_ZURICH_1);
258276
}
259277

260278
private final static MessageFormat OC1_EP_BASE = new MessageFormat(
@@ -281,6 +299,10 @@ public class Region {
281299
"https://nosql.{0}.oci.oraclecloud.eu");
282300
private final static MessageFormat OC20_EP_BASE = new MessageFormat(
283301
"https://nosql.{0}.oci.oraclecloud20.com");
302+
private final static MessageFormat OC22_EP_BASE = new MessageFormat(
303+
"https://nosql.{0}.oci.oraclecloud22.com");
304+
private final static MessageFormat OC24_EP_BASE = new MessageFormat(
305+
"https://nosql.{0}.oci.oraclecloud24.com");
284306

285307
private String regionId;
286308

@@ -329,6 +351,12 @@ public String endpoint() {
329351
if (isOC20Region(regionId)) {
330352
return OC20_EP_BASE.format(new Object[] { regionId });
331353
}
354+
if (isOC22Region(regionId)) {
355+
return OC22_EP_BASE.format(new Object[] { regionId });
356+
}
357+
if (isOC24Region(regionId)) {
358+
return OC24_EP_BASE.format(new Object[] { regionId });
359+
}
332360
throw new IllegalArgumentException(
333361
"Unable to find endpoint for unknwon region" + regionId);
334362
}
@@ -380,6 +408,12 @@ public static Region fromRegionId(String regionId) {
380408
if (region == null) {
381409
region = OC20_REGIONS.get(regionId);
382410
}
411+
if (region == null) {
412+
region = OC22_REGIONS.get(regionId);
413+
}
414+
if (region == null) {
415+
region = OC24_REGIONS.get(regionId);
416+
}
383417

384418
return region;
385419
}
@@ -513,6 +547,26 @@ public static boolean isOC20Region(String regionId) {
513547
return (OC20_REGIONS.get(regionId) != null);
514548
}
515549

550+
/**
551+
* @hidden
552+
* Internal use only
553+
* @param regionId the region id
554+
* @return the value
555+
*/
556+
public static boolean isOC22Region(String regionId) {
557+
return (OC22_REGIONS.get(regionId) != null);
558+
}
559+
560+
/**
561+
* @hidden
562+
* Internal use only
563+
* @param regionId the region id
564+
* @return the value
565+
*/
566+
public static boolean isOC24Region(String regionId) {
567+
return (OC24_REGIONS.get(regionId) != null);
568+
}
569+
516570
/**
517571
* @hidden
518572
* Internal use only

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ class Utils {
115115
"https://auth.{0}.oraclecloud.eu");
116116
private final static MessageFormat OC20_EP_BASE = new MessageFormat(
117117
"https://auth.{0}.oraclecloud20.com");
118+
private final static MessageFormat OC22_EP_BASE = new MessageFormat(
119+
"https://auth.{0}.oraclecloud22.com");
120+
private final static MessageFormat OC24_EP_BASE = new MessageFormat(
121+
"https://auth.{0}.oraclecloud24.com");
118122

119123
static {
120124
/* OC1 */
@@ -154,9 +158,11 @@ class Utils {
154158
IAM_URI.put("gru", OC1_EP_BASE.format(new Object[] {"sa-saopaulo-1"}));
155159
IAM_URI.put("scl", OC1_EP_BASE.format(new Object[] {"sa-santiago-1"}));
156160
IAM_URI.put("vcp", OC1_EP_BASE.format(new Object[] {"sa-vinhedo-1"}));
161+
IAM_URI.put("vap", OC1_EP_BASE.format(new Object[] {"sa-valparaiso-1"}));
157162

158163
IAM_URI.put("phx", OC1_EP_BASE.format(new Object[] {"us-phoenix-1"}));
159164
IAM_URI.put("iad", OC1_EP_BASE.format(new Object[] {"us-ashburn-1"}));
165+
IAM_URI.put("aga", OC1_EP_BASE.format(new Object[] {"us-saltlake-2"}));
160166
IAM_URI.put("sjc", OC1_EP_BASE.format(new Object[] {"us-sanjose-1"}));
161167
IAM_URI.put("ord", OC1_EP_BASE.format(new Object[] {"us-chicago-1"}));
162168

@@ -211,6 +217,12 @@ class Utils {
211217

212218
/* OC20 */
213219
IAM_URI.put("beg", OC20_EP_BASE.format(new Object[] {"eu-jovanovac-1"}));
220+
221+
/* OC22 */
222+
IAM_URI.put("nap", OC22_EP_BASE.format(new Object[] {"eu-dcc-rome-1"}));
223+
224+
/* OC24 */
225+
IAM_URI.put("avz", OC24_EP_BASE.format(new Object[] {"eu-dcc-zurich-1"}));
214226
}
215227

216228
static String getIAMURL(String regionIdOrCode) {
@@ -252,6 +264,12 @@ static String getIAMURL(String regionIdOrCode) {
252264
if (Region.isOC20Region(regionIdOrCode)) {
253265
return OC20_EP_BASE.format(new Object[] {regionIdOrCode});
254266
}
267+
if (Region.isOC22Region(regionIdOrCode)) {
268+
return OC22_EP_BASE.format(new Object[] {regionIdOrCode});
269+
}
270+
if (Region.isOC24Region(regionIdOrCode)) {
271+
return OC24_EP_BASE.format(new Object[] {regionIdOrCode});
272+
}
255273
}
256274

257275
return uri;

0 commit comments

Comments
 (0)