From 75670f7d478adc7a615480b52a96554b8e7e3feb Mon Sep 17 00:00:00 2001 From: Derek Shelby Date: Thu, 15 Nov 2018 17:31:40 +0000 Subject: [PATCH] Releasing version 1.3.1 --- CHANGELOG.md | 7 + .../bmc-apache-connector-provider/pom.xml | 4 +- bmc-addons/pom.xml | 2 +- bmc-audit/pom.xml | 4 +- bmc-bom/pom.xml | 30 +- bmc-common/pom.xml | 2 +- .../main/java/com/oracle/bmc/Services.java | 10 + ...questingAuthenticationDetailsProvider.java | 21 +- .../oracle/bmc/auth/SessionKeySupplier.java | 11 + .../SimpleAuthenticationDetailsProvider.java | 1 - .../auth/URLBasedX509CertificateSupplier.java | 3 +- .../oracle/bmc/auth/internal/AuthUtils.java | 1 - .../bmc/auth/internal/RestClientUtils.java | 6 +- .../auth/internal/SecurityTokenAdapter.java | 4 +- .../auth/internal/X509FederationClient.java | 39 +- .../bmc/http/internal/EntityFactory.java | 3 +- .../http/internal/ExplicitlySetFilter.java | 18 +- .../internal/ForwardingInvocationBuilder.java | 7 +- .../bmc/http/internal/ResponseHelper.java | 1 - .../oracle/bmc/http/internal/RestClient.java | 7 +- .../bmc/http/internal/RestClientFactory.java | 9 +- .../internal/WrappedInvocationBuilder.java | 6 +- .../bmc/http/internal/WrappedWebTarget.java | 3 +- .../signing/internal/BouncyCastleHelper.java | 15 +- .../bmc/http/signing/internal/Constants.java | 2 +- .../internal/DefaultRequestSignerFactory.java | 1 - .../PEMFileRSAPrivateKeySupplier.java | 17 +- .../signing/internal/RequestSignerImpl.java | 18 +- .../internal/AbstractResponseIterator.java | 3 - .../com/oracle/bmc/requests/BmcRequest.java | 3 +- .../oracle/bmc/util/internal/HttpUtils.java | 2 - .../bmc/util/internal/ReflectionUtils.java | 2 +- .../RefreshAuthTokenTransformingFuture.java | 15 +- .../RefreshAuthTokenWrappingAsyncHandler.java | 1 - .../internal/ExplicitlySetFilterTest.java | 60 +- bmc-containerengine/pom.xml | 4 +- bmc-core/pom.xml | 4 +- .../model/CreateDrgAttachmentDetails.java | 27 +- .../CreateLocalPeeringGatewayDetails.java | 28 +- .../oracle/bmc/core/model/DrgAttachment.java | 17 + .../bmc/core/model/LocalPeeringGateway.java | 49 +- .../model/UpdateDrgAttachmentDetails.java | 21 +- .../UpdateLocalPeeringGatewayDetails.java | 21 +- bmc-database/pom.xml | 4 +- bmc-dns/pom.xml | 4 +- bmc-email/pom.xml | 4 +- bmc-examples/pom.xml | 4 +- .../src/main/java/RawRestCallExample.java | 4 + .../src/main/java/VcnTransitRouting.java | 648 ++++++++++++++++++ bmc-filestorage/pom.xml | 4 +- bmc-full/pom.xml | 4 +- bmc-identity/pom.xml | 4 +- bmc-keymanagement/pom.xml | 4 +- bmc-loadbalancer/pom.xml | 4 +- .../bmc-objectstorage-combined/pom.xml | 6 +- .../bmc-objectstorage-extensions/pom.xml | 6 +- .../bmc-objectstorage-generated/pom.xml | 4 +- bmc-objectstorage/pom.xml | 2 +- bmc-resourcesearch/pom.xml | 4 +- bmc-shaded/bmc-shaded-full/pom.xml | 12 +- bmc-shaded/pom.xml | 2 +- pom.xml | 2 +- 62 files changed, 1069 insertions(+), 166 deletions(-) create mode 100644 bmc-examples/src/main/java/VcnTransitRouting.java diff --git a/CHANGELOG.md b/CHANGELOG.md index f0d6a708cb5..60968bde225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added - N/A +## 1.3.1 - 2018-11-15 +### Added +- Support for VCN transit routing in the Networking service + +### Changed +- Bouncy Castle jar is no longer bundled within the shaded distribution `oci-java-sdk-shaded-full` and now must be included in the CLASSPATH. + ## 1.3.0 - 2018-11-01 ### Added - Support for modifying the route table, DHCP options, and security lists associated with a subnet in the Networking service. diff --git a/bmc-addons/bmc-apache-connector-provider/pom.xml b/bmc-addons/bmc-apache-connector-provider/pom.xml index 51add9b72ba..d3c93c8a8a2 100644 --- a/bmc-addons/bmc-apache-connector-provider/pom.xml +++ b/bmc-addons/bmc-apache-connector-provider/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk-addons - 1.3.0 + 1.3.1 ../pom.xml @@ -37,7 +37,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-addons/pom.xml b/bmc-addons/pom.xml index 8196852fb73..45e5ef0b793 100644 --- a/bmc-addons/pom.xml +++ b/bmc-addons/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml diff --git a/bmc-audit/pom.xml b/bmc-audit/pom.xml index 3f5df263bfe..a2b6c136ca6 100644 --- a/bmc-audit/pom.xml +++ b/bmc-audit/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-bom/pom.xml b/bmc-bom/pom.xml index c968a715a7f..72685590a73 100644 --- a/bmc-bom/pom.xml +++ b/bmc-bom/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml oci-java-sdk-bom @@ -19,86 +19,86 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-audit - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-containerengine - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-core - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-database - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-dns - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-email - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-filestorage - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-identity - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-loadbalancer - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-objectstorage - 1.3.0 + 1.3.1 false com.oracle.oci.sdk oci-java-sdk-resourcesearch false - 1.3.0 + 1.3.1 com.oracle.oci.sdk false oci-java-sdk-addons-apache - 1.3.0 + 1.3.1 com.oracle.oci.sdk oci-java-sdk-keymanagement - 1.3.0 + 1.3.1 false diff --git a/bmc-common/pom.xml b/bmc-common/pom.xml index 6fbba12d206..32b26b6b020 100644 --- a/bmc-common/pom.xml +++ b/bmc-common/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml diff --git a/bmc-common/src/main/java/com/oracle/bmc/Services.java b/bmc-common/src/main/java/com/oracle/bmc/Services.java index 1efebd91c81..8a8bc4ee627 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/Services.java +++ b/bmc-common/src/main/java/com/oracle/bmc/Services.java @@ -38,6 +38,16 @@ public static Service create(final String serviceName, final String serviceEndpo .build(); } + /** + * Get Service instance based on service name. + * + * @param serviceName service name should be UPPER CASE. + * @return service instance + */ + public static Service getServiceByName(final String serviceName) { + return SERVICE_CACHE.get(serviceName); + } + @Builder(builderClassName = "ServiceBuilder", builderMethodName = "serviceBuilder") private static synchronized Service create( final String serviceName, diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/AbstractRequestingAuthenticationDetailsProvider.java b/bmc-common/src/main/java/com/oracle/bmc/auth/AbstractRequestingAuthenticationDetailsProvider.java index dc055286cb6..be91f486b91 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/AbstractRequestingAuthenticationDetailsProvider.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/AbstractRequestingAuthenticationDetailsProvider.java @@ -15,7 +15,6 @@ import java.security.NoSuchAlgorithmException; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; -import java.util.Arrays; import java.util.Set; /** @@ -125,15 +124,22 @@ protected static class CachingSessionKeySupplier implements SessionKeySupplier { protected CachingSessionKeySupplier(final SessionKeySupplier delegate) { this.delegate = delegate; - this.setPrivateKeyBytes(delegate.getPrivateKey()); + this.setPrivateKeyBytes((RSAPrivateKey) delegate.getKeyPair().getPrivate()); } @Override + public KeyPair getKeyPair() { + return delegate.getKeyPair(); + } + + @Override + @Deprecated public synchronized RSAPublicKey getPublicKey() { return delegate.getPublicKey(); } @Override + @Deprecated public synchronized RSAPrivateKey getPrivateKey() { return delegate.getPrivateKey(); } @@ -145,7 +151,7 @@ public synchronized void refreshKeys() { // private keys can be refreshed asynchronously, always update first protected synchronized byte[] getPrivateKeyBytes() { - setPrivateKeyBytes(this.getPrivateKey()); + setPrivateKeyBytes((RSAPrivateKey) this.getKeyPair().getPrivate()); return this.privateKeyBytes; } @@ -181,11 +187,18 @@ protected SessionKeySupplierImpl() { this.keyPair = GENERATOR.generateKeyPair(); } + @Override + public KeyPair getKeyPair() { + return keyPair; + } + /** * Gets the public key * @return the public key, not null + * @deprecated use getKeyPair() instead */ @Override + @Deprecated public RSAPublicKey getPublicKey() { return (RSAPublicKey) keyPair.getPublic(); } @@ -193,8 +206,10 @@ public RSAPublicKey getPublicKey() { /** * Gets the private key * @return the private key, not null + * @deprecated use getKeyPair() instead */ @Override + @Deprecated public RSAPrivateKey getPrivateKey() { return (RSAPrivateKey) keyPair.getPrivate(); } diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/SessionKeySupplier.java b/bmc-common/src/main/java/com/oracle/bmc/auth/SessionKeySupplier.java index ec5f2337458..5d259992eb1 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/SessionKeySupplier.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/SessionKeySupplier.java @@ -3,6 +3,7 @@ */ package com.oracle.bmc.auth; +import java.security.KeyPair; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; @@ -14,16 +15,26 @@ */ public interface SessionKeySupplier { + /** + * Returns the current RSA key pair. + * @return The RSA key pair. + */ + KeyPair getKeyPair(); + /** * Gets the public key * @return the public key, not null + * @deprecated use getKeyPair instead */ + @Deprecated RSAPublicKey getPublicKey(); /** * Gets the private key * @return the private key, not null + * @deprecated use getKeyPair instead */ + @Deprecated RSAPrivateKey getPrivateKey(); /** diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/SimpleAuthenticationDetailsProvider.java b/bmc-common/src/main/java/com/oracle/bmc/auth/SimpleAuthenticationDetailsProvider.java index f230b19a93f..3aea7e833d2 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/SimpleAuthenticationDetailsProvider.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/SimpleAuthenticationDetailsProvider.java @@ -4,7 +4,6 @@ package com.oracle.bmc.auth; import java.io.InputStream; -import java.nio.charset.StandardCharsets; import com.google.common.base.Supplier; import com.oracle.bmc.Region; diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/URLBasedX509CertificateSupplier.java b/bmc-common/src/main/java/com/oracle/bmc/auth/URLBasedX509CertificateSupplier.java index ae32faa165b..5203aad37ce 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/URLBasedX509CertificateSupplier.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/URLBasedX509CertificateSupplier.java @@ -7,7 +7,8 @@ import com.oracle.bmc.util.StreamUtils; import javax.security.auth.Refreshable; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/AuthUtils.java b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/AuthUtils.java index ff384c5ed25..c9b14b2b2d5 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/AuthUtils.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/AuthUtils.java @@ -7,7 +7,6 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.math.BigInteger; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.security.KeyFactory; import java.security.MessageDigest; diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/RestClientUtils.java b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/RestClientUtils.java index 0b17b8147af..844bc7a4de6 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/RestClientUtils.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/RestClientUtils.java @@ -11,6 +11,7 @@ import com.oracle.bmc.http.internal.RestClientFactory; import com.oracle.bmc.http.internal.RestClientFactoryBuilder; import com.oracle.bmc.http.signing.RequestSigner; +import com.oracle.bmc.http.signing.SigningStrategy; import com.oracle.bmc.http.signing.internal.Constants; import com.oracle.bmc.http.signing.internal.KeySupplier; import com.oracle.bmc.http.signing.internal.RequestSignerImpl; @@ -18,6 +19,7 @@ import java.security.cert.X509Certificate; import java.security.interfaces.RSAPrivateKey; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -119,7 +121,9 @@ private static RestClient createRestClient( RestClientFactory restClientFactory = RestClientFactoryBuilder.builder().clientConfigurator(clientConfigurator).build(); - RestClient restClient = restClientFactory.create(requestSigner); + RestClient restClient = + restClientFactory.create( + requestSigner, Collections.emptyMap()); restClient.setEndpoint(endpoint); return restClient; } diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/SecurityTokenAdapter.java b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/SecurityTokenAdapter.java index 07206a87330..86ab61f741a 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/SecurityTokenAdapter.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/SecurityTokenAdapter.java @@ -72,7 +72,9 @@ boolean isValid() { Optional jwkRsa = AuthUtils.toPublicKeyFromJson(jwk); if (jwkRsa.isPresent() && isEqualPublicKey( - jwkRsa.get(), sessionKeySupplier.getPublicKey())) { + jwkRsa.get(), + (RSAPublicKey) + sessionKeySupplier.getKeyPair().getPublic())) { LOG.debug( "Security token is still valid. Public key matches with the JWK."); diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/X509FederationClient.java b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/X509FederationClient.java index fc44f1a6454..9bde4d12771 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/X509FederationClient.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/X509FederationClient.java @@ -7,22 +7,15 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; -import com.google.common.base.Optional; import com.google.common.base.Preconditions; -import com.google.common.base.Supplier; import com.oracle.bmc.auth.SessionKeySupplier; import com.oracle.bmc.auth.X509CertificateSupplier; import com.oracle.bmc.http.ClientConfigurator; import com.oracle.bmc.http.internal.ResponseConversionFunctionFactory; import com.oracle.bmc.http.internal.RestClient; -import com.oracle.bmc.http.internal.RestClientFactory; -import com.oracle.bmc.http.internal.RestClientFactoryBuilder; import com.oracle.bmc.http.internal.WithHeaders; import com.oracle.bmc.http.internal.WrappedInvocationBuilder; -import com.oracle.bmc.http.signing.RequestSigner; import com.oracle.bmc.http.signing.internal.Constants; -import com.oracle.bmc.http.signing.internal.KeySupplier; -import com.oracle.bmc.http.signing.internal.RequestSignerImpl; import com.oracle.bmc.model.BmcException; import com.oracle.bmc.requests.BmcRequest; import lombok.AllArgsConstructor; @@ -36,14 +29,13 @@ import javax.ws.rs.client.Invocation.Builder; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Response; +import java.security.KeyPair; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; -import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; /** @@ -62,7 +54,9 @@ public class X509FederationClient implements FederationClient { private final RestClient federationHttpClient; - private SecurityTokenAdapter securityTokenAdapter = null; + // needs to be volatile to make double-checked locking work + // see https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html + private volatile SecurityTokenAdapter securityTokenAdapter = null; /** * The constructor. @@ -210,17 +204,28 @@ private static String keyIdForX509Request(String tenantId, X509Certificate certi private SecurityTokenAdapter getSecurityTokenFromServer() { LOG.info("Getting security token from the auth server"); - RSAPublicKey publicKey = sessionKeySupplier.getPublicKey(); + KeyPair keyPair = sessionKeySupplier.getKeyPair(); + if (keyPair == null) { + throw new IllegalStateException("Keypair for session was not provided"); + } + + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); if (publicKey == null) { throw new IllegalArgumentException("Public key is not present"); } - X509Certificate leafCertificate = leafCertificateSupplier.getCertificate(); + X509CertificateSupplier.CertificateAndPrivateKeyPair certificateAndKeyPair = + leafCertificateSupplier.getCertificateAndKeyPair(); + if (certificateAndKeyPair == null) { + throw new IllegalArgumentException("Certificate and key pair are not present"); + } + + X509Certificate leafCertificate = certificateAndKeyPair.getCertificate(); if (leafCertificate == null) { throw new IllegalArgumentException("Leaf certificate is not present"); } - if (leafCertificateSupplier.getPrivateKey() == null) { + if (certificateAndKeyPair.getPrivateKey() == null) { throw new IllegalArgumentException("Leaf certificate's private key is not present"); } @@ -233,9 +238,13 @@ private SecurityTokenAdapter getSecurityTokenFromServer() { intermediateStrings = new HashSet<>(); for (X509CertificateSupplier supplier : intermediateCertificateSuppliers) { - if (supplier.getCertificate() != null) { + X509CertificateSupplier.CertificateAndPrivateKeyPair + supplierCertificateAndKeyPair = supplier.getCertificateAndKeyPair(); + if (supplierCertificateAndKeyPair != null + && supplierCertificateAndKeyPair.getCertificate() != null) { intermediateStrings.add( - AuthUtils.base64EncodeNoChunking(supplier.getCertificate())); + AuthUtils.base64EncodeNoChunking( + supplierCertificateAndKeyPair.getCertificate())); } } } diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/internal/EntityFactory.java b/bmc-common/src/main/java/com/oracle/bmc/http/internal/EntityFactory.java index 1d7d4e39d27..9b3750016fd 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/internal/EntityFactory.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/internal/EntityFactory.java @@ -11,7 +11,6 @@ import javax.ws.rs.core.Variant; import com.fasterxml.jackson.core.JsonProcessingException; -import org.glassfish.jersey.client.ClientRequest; import com.oracle.bmc.util.internal.ReflectionUtils; @@ -98,7 +97,7 @@ Entity forPut(Object request, Object body) { /** * Need to preserve the content headers that get overridden by the Variant provided - * by the Entity. See {@link ClientRequest#variant(javax.ws.rs.core.Variant)}. + * by the Entity. See {@link org.glassfish.jersey.client.ClientRequest#variant(javax.ws.rs.core.Variant)}. *

* NOTE: this should ideally only be inspecting the headers (in case there were query * params with the same names, for example), but we don't have access to just the headers diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/internal/ExplicitlySetFilter.java b/bmc-common/src/main/java/com/oracle/bmc/http/internal/ExplicitlySetFilter.java index 357ea2d5d23..e859cafa7e7 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/internal/ExplicitlySetFilter.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/internal/ExplicitlySetFilter.java @@ -8,10 +8,13 @@ import com.fasterxml.jackson.databind.ser.BeanPropertyWriter; import com.fasterxml.jackson.databind.ser.PropertyWriter; import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter; +import com.google.common.base.CaseFormat; +import lombok.extern.slf4j.Slf4j; import java.lang.reflect.Field; import java.util.Set; +@Slf4j public class ExplicitlySetFilter extends SimpleBeanPropertyFilter { public static final ExplicitlySetFilter INSTANCE = new ExplicitlySetFilter(); public static final String NAME = "explicitlySetFilter"; @@ -24,7 +27,7 @@ public void serializeAsField( Object pojo, JsonGenerator jgen, SerializerProvider provider, PropertyWriter writer) throws Exception { if (include(writer)) { - Field field = getDeclaredField(pojo.getClass(), writer.getName()); + Field field = getMatchingDeclaredField(pojo.getClass(), writer.getName()); boolean accessible = field.isAccessible(); try { field.setAccessible(true); @@ -69,6 +72,19 @@ private static Field getDeclaredField(Class pojoClass, String fieldName) } } + private static Field getMatchingDeclaredField(Class pojoClass, String fieldName) + throws NoSuchFieldException { + // Try matching the exact field name + try { + return getDeclaredField(pojoClass, fieldName); + } catch (NoSuchFieldException nsfe) { + LOG.debug("Exact field name match failed for {}", fieldName); + } + // If not found, try converting the field name from snake case to camel case + return getDeclaredField( + pojoClass, CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, fieldName)); + } + @Override protected boolean include(BeanPropertyWriter writer) { return !FIELD_NAME.equals(writer.getName()); diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/internal/ForwardingInvocationBuilder.java b/bmc-common/src/main/java/com/oracle/bmc/http/internal/ForwardingInvocationBuilder.java index 226e22111fd..0c518af8aaf 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/internal/ForwardingInvocationBuilder.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/internal/ForwardingInvocationBuilder.java @@ -6,7 +6,12 @@ import javax.ws.rs.client.AsyncInvoker; import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.*; +import javax.ws.rs.core.CacheControl; +import javax.ws.rs.core.Cookie; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; import java.util.Locale; public abstract class ForwardingInvocationBuilder implements Invocation.Builder { diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/internal/ResponseHelper.java b/bmc-common/src/main/java/com/oracle/bmc/http/internal/ResponseHelper.java index 3238208a0e1..9b77f9e6219 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/internal/ResponseHelper.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/internal/ResponseHelper.java @@ -6,7 +6,6 @@ import java.io.InputStream; import java.util.HashMap; import java.util.Map; -import java.util.Locale; import javax.ws.rs.ProcessingException; import javax.ws.rs.core.GenericType; diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClient.java b/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClient.java index b7feed3f492..5ea866a4169 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClient.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClient.java @@ -16,7 +16,12 @@ import javax.annotation.Nullable; import javax.ws.rs.ProcessingException; -import javax.ws.rs.client.*; +import javax.ws.rs.client.AsyncInvoker; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.InvocationCallback; +import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.GenericType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClientFactory.java b/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClientFactory.java index 7ff6a6e6e06..f9e42fee9f2 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClientFactory.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClientFactory.java @@ -11,7 +11,6 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.oracle.bmc.ClientConfiguration; -import com.oracle.bmc.auth.AuthenticationDetailsProvider; import com.oracle.bmc.http.ClientConfigurator; import com.oracle.bmc.http.signing.RequestSigner; import com.oracle.bmc.http.signing.SigningStrategy; @@ -70,7 +69,7 @@ public RestClientFactory(@Nonnull ClientConfigurator clientConfigurator) { /** * Creates a new client that will use the given - * {@link AuthenticationDetailsProvider}. + * {@link com.oracle.bmc.auth.AuthenticationDetailsProvider}. * * @param requestSigner The strategy used to sign requests. * @return A new RestClient instance. @@ -84,7 +83,7 @@ public RestClient create(RequestSigner requestSigner) { /** * Creates a new client that will use the given - * {@link AuthenticationDetailsProvider} and {@link ClientConfiguration}. + * {@link com.oracle.bmc.auth.AuthenticationDetailsProvider} and {@link ClientConfiguration}. * * @param requestSigner The strategy used to sign requests. * @param configuration @@ -104,7 +103,7 @@ public RestClient create(RequestSigner requestSigner, ClientConfiguration config /** * Creates a new client that will use the given - * {@link AuthenticationDetailsProvider}. + * {@link com.oracle.bmc.auth.AuthenticationDetailsProvider}. * * @param defaultRequestSigner * The default strategy used to sign requests. @@ -120,7 +119,7 @@ public RestClient create( /** * Creates a new client that will use the given - * {@link AuthenticationDetailsProvider} and {@link ClientConfiguration}. + * {@link com.oracle.bmc.auth.AuthenticationDetailsProvider} and {@link ClientConfiguration}. * * @param defaultRequestSigner * The default strategy used to sign requests. diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/internal/WrappedInvocationBuilder.java b/bmc-common/src/main/java/com/oracle/bmc/http/internal/WrappedInvocationBuilder.java index 5aec6e306e2..750e441c58a 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/internal/WrappedInvocationBuilder.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/internal/WrappedInvocationBuilder.java @@ -6,11 +6,9 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; -import javax.ws.rs.client.AsyncInvoker; -import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.*; -import java.util.Locale; +import javax.ws.rs.core.MultivaluedHashMap; +import javax.ws.rs.core.MultivaluedMap; /** * An {@link Invocation.Builder} that stores the headers being set, allowing access to them. diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/internal/WrappedWebTarget.java b/bmc-common/src/main/java/com/oracle/bmc/http/internal/WrappedWebTarget.java index 20c309c1bbc..b4c113597b9 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/internal/WrappedWebTarget.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/internal/WrappedWebTarget.java @@ -5,7 +5,6 @@ import lombok.AllArgsConstructor; -import javax.ws.rs.client.Invocation; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Configuration; import javax.ws.rs.core.MediaType; @@ -15,7 +14,7 @@ /** * A {@link WebTarget} that delegates to another {@link WebTarget}, but creates {@link WrappedInvocationBuilder} - * instances instead of plain {@link Invocation.Builder} instances. + * instances instead of plain {@link javax.ws.rs.client.Invocation.Builder} instances. */ @AllArgsConstructor public class WrappedWebTarget implements WebTarget { diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/BouncyCastleHelper.java b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/BouncyCastleHelper.java index 23a61be52f9..a42024ba4a1 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/BouncyCastleHelper.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/BouncyCastleHelper.java @@ -23,7 +23,7 @@ private BouncyCastleHelper() { LOG.info("Instantiated provider: " + bouncyCastleProviderClass.getName()); } catch (InstantiationException | IllegalAccessException ex) { LOG.error("Failed to instantiate provider", ex); - throw Throwables.propagate(ex); + throw new BouncyCastleHelperException(ex); } } @@ -60,4 +60,17 @@ private static Class getBouncyCastleProviderClass() { throw new IllegalStateException("No matching BouncyCastle provider found."); } + + /** + * An exception in the {@link BouncyCastleHelper}. + */ + public static class BouncyCastleHelperException extends RuntimeException { + public BouncyCastleHelperException(String message, Throwable cause) { + super(message, cause); + } + + public BouncyCastleHelperException(Throwable cause) { + super(cause); + } + } } diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/Constants.java b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/Constants.java index c936761bbfa..3019ff1ccca 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/Constants.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/Constants.java @@ -22,8 +22,8 @@ public class Constants { public static final String HOST = "host"; // Optional - static final String CROSS_TENANCY_REQUEST_HEADER_NAME = "x-cross-tenancy-request"; static final String X_SUBSCRIPTION = "x-subscription"; + public static final String CROSS_TENANCY_REQUEST_HEADER_NAME = "x-cross-tenancy-request"; static final String JSON_CONTENT_TYPE = "application/json"; diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/DefaultRequestSignerFactory.java b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/DefaultRequestSignerFactory.java index d256f92236d..aa775830a54 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/DefaultRequestSignerFactory.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/DefaultRequestSignerFactory.java @@ -4,7 +4,6 @@ package com.oracle.bmc.http.signing.internal; import java.security.interfaces.RSAPrivateKey; -import java.util.HashMap; import java.util.Map; import com.google.common.base.Optional; diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/PEMFileRSAPrivateKeySupplier.java b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/PEMFileRSAPrivateKeySupplier.java index 5703e952560..6055d04a7da 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/PEMFileRSAPrivateKeySupplier.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/PEMFileRSAPrivateKeySupplier.java @@ -6,8 +6,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.security.Provider; -import java.security.Security; import java.security.interfaces.RSAPrivateKey; import javax.annotation.Nonnull; @@ -119,7 +117,7 @@ public PEMFileRSAPrivateKeySupplier( } } catch (IOException ex) { LOG.debug("Failed to read RSA private key from file", ex); - throw Throwables.propagate(ex); + throw new PEMFileRSAPrivateKeySupplierException(ex); } } @@ -144,4 +142,17 @@ public Optional getKey(@Nonnull String ignored) { public Optional getKey() { return Optional.of(key); } + + /** + * An exception in the {@link PEMFileRSAPrivateKeySupplier}. + */ + public static class PEMFileRSAPrivateKeySupplierException extends RuntimeException { + public PEMFileRSAPrivateKeySupplierException(String message, Throwable cause) { + super(message, cause); + } + + public PEMFileRSAPrivateKeySupplierException(Throwable cause) { + super(cause); + } + } } diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/RequestSignerImpl.java b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/RequestSignerImpl.java index 429a80f1ed7..a524bd49ed4 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/RequestSignerImpl.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/RequestSignerImpl.java @@ -323,15 +323,13 @@ static Map calculateMissingHeaders( // the one exception for the below is when doing a PUT if the body is an InputStream // and the configuration allows it to be skipped - if (isPut || isPatch) { - if (body instanceof InputStream) { - if (signingConfiguration.skipContentHeadersForStreamingPutRequests) { - return missingHeaders; - } else { - // TODO: support DuplicatableInputStream to be able to calculate length/sha-256 - throw new IllegalArgumentException( - "Streaming body not supported for signing strategy"); - } + if ((isPut || isPatch) && (body instanceof InputStream)) { + if (signingConfiguration.skipContentHeadersForStreamingPutRequests) { + return missingHeaders; + } else { + // TODO: support DuplicatableInputStream to be able to calculate length/sha-256 + throw new IllegalArgumentException( + "Streaming body not supported for signing strategy"); } } @@ -468,7 +466,7 @@ private static List getIgnoreCaseHeaders(List headerNames) { if (headerNames == null) { return new ArrayList<>(0); } - ArrayList result = new ArrayList<>(); + ArrayList result = new ArrayList<>(headerNames.size()); for (String headerName : headerNames) { result.add(headerName.toLowerCase()); } diff --git a/bmc-common/src/main/java/com/oracle/bmc/paginator/internal/AbstractResponseIterator.java b/bmc-common/src/main/java/com/oracle/bmc/paginator/internal/AbstractResponseIterator.java index fb8e0d18e40..15a465c2124 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/paginator/internal/AbstractResponseIterator.java +++ b/bmc-common/src/main/java/com/oracle/bmc/paginator/internal/AbstractResponseIterator.java @@ -6,9 +6,6 @@ import com.google.common.base.Function; import com.google.common.base.Optional; -import java.util.Iterator; -import java.util.NoSuchElementException; - /** * Contains common functionality for classes which will iterate over the results of paginated * list operations in a service. diff --git a/bmc-common/src/main/java/com/oracle/bmc/requests/BmcRequest.java b/bmc-common/src/main/java/com/oracle/bmc/requests/BmcRequest.java index 1bdfd7996f1..667057bc878 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/requests/BmcRequest.java +++ b/bmc-common/src/main/java/com/oracle/bmc/requests/BmcRequest.java @@ -4,7 +4,6 @@ package com.oracle.bmc.requests; import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.MultivaluedMap; import com.oracle.bmc.util.internal.Consumer; @@ -18,7 +17,7 @@ public class BmcRequest { * configurable otherwise. Attempting to invoke or build the builder in any * way will result in an exception. * - * For the {@link Invocation.Builder#headers(MultivaluedMap)} method, note that + * For the {@link Invocation.Builder#headers(javax.ws.rs.core.MultivaluedMap)} method, note that * modifying the passed in {@code headers} map after the call does not have any * effect on headers set. */ diff --git a/bmc-common/src/main/java/com/oracle/bmc/util/internal/HttpUtils.java b/bmc-common/src/main/java/com/oracle/bmc/util/internal/HttpUtils.java index 0b26d80e2c1..bdf5672e6dc 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/util/internal/HttpUtils.java +++ b/bmc-common/src/main/java/com/oracle/bmc/util/internal/HttpUtils.java @@ -13,10 +13,8 @@ import java.util.UUID; import javax.annotation.Nonnull; -import javax.ws.rs.client.WebTarget; import com.oracle.bmc.http.internal.HttpDateUtils; -import com.oracle.bmc.http.internal.WrappedInvocationBuilder; import com.oracle.bmc.http.internal.WrappedWebTarget; import org.apache.commons.lang3.StringUtils; diff --git a/bmc-common/src/main/java/com/oracle/bmc/util/internal/ReflectionUtils.java b/bmc-common/src/main/java/com/oracle/bmc/util/internal/ReflectionUtils.java index 4e92c634260..77c5a62ae55 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/util/internal/ReflectionUtils.java +++ b/bmc-common/src/main/java/com/oracle/bmc/util/internal/ReflectionUtils.java @@ -28,7 +28,7 @@ public class ReflectionUtils { public static Object invokeGetter(Object instance, String methodName) { try { Method method = instance.getClass().getMethod(methodName, NO_ARGS); - return method.invoke(instance, NO_ARGS); + return method.invoke(instance, (Object[]) NO_ARGS); } catch (Exception e) { return null; } diff --git a/bmc-common/src/main/java/com/oracle/bmc/util/internal/RefreshAuthTokenTransformingFuture.java b/bmc-common/src/main/java/com/oracle/bmc/util/internal/RefreshAuthTokenTransformingFuture.java index 626ea3c227e..43b26ba42c3 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/util/internal/RefreshAuthTokenTransformingFuture.java +++ b/bmc-common/src/main/java/com/oracle/bmc/util/internal/RefreshAuthTokenTransformingFuture.java @@ -3,25 +3,18 @@ */ package com.oracle.bmc.util.internal; -import com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider; +import com.google.common.base.Function; +import com.google.common.base.Supplier; import com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider; -import com.oracle.bmc.http.internal.WrappedInvocationBuilder; import com.oracle.bmc.model.BmcException; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import javax.ws.rs.core.Response; - -import com.google.common.base.Function; -import com.google.common.base.Supplier; - -import lombok.Getter; -import lombok.NonNull; -import lombok.RequiredArgsConstructor; - /** * Future that both delegates to another one and provides the ability to transform * the response to another type. This is intended to work with some authenticated calls, like instance principals, diff --git a/bmc-common/src/main/java/com/oracle/bmc/util/internal/RefreshAuthTokenWrappingAsyncHandler.java b/bmc-common/src/main/java/com/oracle/bmc/util/internal/RefreshAuthTokenWrappingAsyncHandler.java index f035fc2337e..11c616be01e 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/util/internal/RefreshAuthTokenWrappingAsyncHandler.java +++ b/bmc-common/src/main/java/com/oracle/bmc/util/internal/RefreshAuthTokenWrappingAsyncHandler.java @@ -3,7 +3,6 @@ */ package com.oracle.bmc.util.internal; -import com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider; import com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider; import com.oracle.bmc.model.BmcException; import com.oracle.bmc.responses.AsyncHandler; diff --git a/bmc-common/src/test/java/com/oracle/bmc/http/internal/ExplicitlySetFilterTest.java b/bmc-common/src/test/java/com/oracle/bmc/http/internal/ExplicitlySetFilterTest.java index c6ca1cb3f5b..3d3f518f771 100644 --- a/bmc-common/src/test/java/com/oracle/bmc/http/internal/ExplicitlySetFilterTest.java +++ b/bmc-common/src/test/java/com/oracle/bmc/http/internal/ExplicitlySetFilterTest.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.PropertyWriter; -import com.oracle.bmc.ClientConfiguration; -import com.oracle.bmc.http.signing.RequestSigner; import com.oracle.bmc.requests.BmcRequest; import org.junit.Ignore; import org.junit.Test; @@ -15,7 +13,6 @@ import javax.ws.rs.client.Client; import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.Response; import java.io.IOException; import static org.junit.Assert.assertEquals; @@ -121,22 +118,8 @@ public void testNullInSubclass() throws Exception { @Test public void deserializeNoDiscriminator() throws IOException { Subclass sub = Subclass.builder().baseVal(1).subVal("two").build(); + String serialized = serializeForPost(sub); - RequestSigner signer = mock(RequestSigner.class); - - Client client = mock(Client.class); - EntityFactory ef = mock(EntityFactory.class); - RestClient rc = new RestClient(client, ef); - - Invocation.Builder ib = mock(Invocation.Builder.class); - rc.post(new WrappedInvocationBuilder(ib), sub, new BmcRequest()); - - ArgumentCaptor bodyCaptor = ArgumentCaptor.forClass(Object.class); - verify(ef).forPost(any(), bodyCaptor.capture()); - - Object value = bodyCaptor.getValue(); - - String serialized = value.toString(); assertTrue(serialized.contains("\"type\":\"sub\"")); String replaced = serialized.replace("sub", "unknown"); assertTrue(replaced.contains("\"type\":\"unknown\"")); @@ -149,6 +132,29 @@ public void deserializeNoDiscriminator() throws IOException { assertEquals(Baseclass.class, parsedUnknown.getClass()); } + @Test + public void serializeSnakeCasedParameter() { + Subclass sub = Subclass.builder().baseVal(1).subVal("two").majorVersion("1.0").build(); + String serializedBody = serializeForPost(sub); + + assertTrue(serializedBody.contains("\"major_version\":\"1.0\"")); + } + + private static String serializeForPost(Object o) { + Client client = mock(Client.class); + EntityFactory ef = mock(EntityFactory.class); + try (RestClient rc = new RestClient(client, ef)) { + + Invocation.Builder ib = mock(Invocation.Builder.class); + rc.post(new WrappedInvocationBuilder(ib), o, new BmcRequest()); + + ArgumentCaptor bodyCaptor = ArgumentCaptor.forClass(Object.class); + verify(ef).forPost(any(), bodyCaptor.capture()); + + return bodyCaptor.getValue().toString(); + } + } + @lombok.Value @lombok.experimental.NonFinal @lombok.AllArgsConstructor(access = lombok.AccessLevel.PROTECTED) @@ -167,6 +173,9 @@ static class Baseclass { @com.fasterxml.jackson.annotation.JsonProperty("baseVal") Integer baseVal; + @com.fasterxml.jackson.annotation.JsonProperty("major_version") + String majorVersion; + @com.fasterxml.jackson.annotation.JsonIgnore private final java.util.Set __explicitlySet__ = new java.util.HashSet(); } @@ -195,6 +204,15 @@ public Builder baseVal(Integer baseVal) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("major_version") + private String majorVersion; + + public Builder majorVersion(String majorVersion) { + this.majorVersion = majorVersion; + this.__explicitlySet__.add("majorVersion"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("subVal") private String subVal; @@ -208,7 +226,7 @@ public Builder subVal(String subVal) { private final java.util.Set __explicitlySet__ = new java.util.HashSet(); public Subclass build() { - Subclass __instance__ = new Subclass(baseVal, subVal); + Subclass __instance__ = new Subclass(baseVal, majorVersion, subVal); __instance__.__explicitlySet__.addAll(__explicitlySet__); return __instance__; } @@ -226,8 +244,8 @@ public static Builder builder() { return new Builder(); } - public Subclass(Integer baseVal, String subVal) { - super(baseVal); + public Subclass(Integer baseVal, String majorVersion, String subVal) { + super(baseVal, majorVersion); this.subVal = subVal; } diff --git a/bmc-containerengine/pom.xml b/bmc-containerengine/pom.xml index 87aef838901..5eea79584f7 100644 --- a/bmc-containerengine/pom.xml +++ b/bmc-containerengine/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-core/pom.xml b/bmc-core/pom.xml index ef6725e619e..96d7e810907 100644 --- a/bmc-core/pom.xml +++ b/bmc-core/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateDrgAttachmentDetails.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateDrgAttachmentDetails.java index 37ca3c3db25..39e3c6c1af2 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateDrgAttachmentDetails.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateDrgAttachmentDetails.java @@ -42,6 +42,15 @@ public Builder drgId(String drgId) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + private String routeTableId; + + public Builder routeTableId(String routeTableId) { + this.routeTableId = routeTableId; + this.__explicitlySet__.add("routeTableId"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("vcnId") private String vcnId; @@ -56,7 +65,7 @@ public Builder vcnId(String vcnId) { public CreateDrgAttachmentDetails build() { CreateDrgAttachmentDetails __instance__ = - new CreateDrgAttachmentDetails(displayName, drgId, vcnId); + new CreateDrgAttachmentDetails(displayName, drgId, routeTableId, vcnId); __instance__.__explicitlySet__.addAll(__explicitlySet__); return __instance__; } @@ -64,7 +73,10 @@ public CreateDrgAttachmentDetails build() { @com.fasterxml.jackson.annotation.JsonIgnore public Builder copy(CreateDrgAttachmentDetails o) { Builder copiedBuilder = - displayName(o.getDisplayName()).drgId(o.getDrgId()).vcnId(o.getVcnId()); + displayName(o.getDisplayName()) + .drgId(o.getDrgId()) + .routeTableId(o.getRouteTableId()) + .vcnId(o.getVcnId()); copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); return copiedBuilder; @@ -90,6 +102,17 @@ public static Builder builder() { @com.fasterxml.jackson.annotation.JsonProperty("drgId") String drgId; + /** + * The OCID of the route table the DRG attachment will use. + *

+ * If you don't specify a route table here, the DRG attachment is created without an associated route + * table. The Networking service does NOT automatically associate the attached VCN's default route table + * with the DRG attachment. + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + String routeTableId; + /** * The OCID of the VCN. **/ diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateLocalPeeringGatewayDetails.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateLocalPeeringGatewayDetails.java index 390c7ab5ea8..0574da033b4 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateLocalPeeringGatewayDetails.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/CreateLocalPeeringGatewayDetails.java @@ -61,6 +61,15 @@ public Builder freeformTags(java.util.Map freeformTags) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + private String routeTableId; + + public Builder routeTableId(String routeTableId) { + this.routeTableId = routeTableId; + this.__explicitlySet__.add("routeTableId"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("vcnId") private String vcnId; @@ -76,7 +85,12 @@ public Builder vcnId(String vcnId) { public CreateLocalPeeringGatewayDetails build() { CreateLocalPeeringGatewayDetails __instance__ = new CreateLocalPeeringGatewayDetails( - compartmentId, definedTags, displayName, freeformTags, vcnId); + compartmentId, + definedTags, + displayName, + freeformTags, + routeTableId, + vcnId); __instance__.__explicitlySet__.addAll(__explicitlySet__); return __instance__; } @@ -88,6 +102,7 @@ public Builder copy(CreateLocalPeeringGatewayDetails o) { .definedTags(o.getDefinedTags()) .displayName(o.getDisplayName()) .freeformTags(o.getFreeformTags()) + .routeTableId(o.getRouteTableId()) .vcnId(o.getVcnId()); copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); @@ -137,6 +152,17 @@ public static Builder builder() { @com.fasterxml.jackson.annotation.JsonProperty("freeformTags") java.util.Map freeformTags; + /** + * The OCID of the route table the LPG will use. + *

+ * If you don't specify a route table here, the LPG is created without an associated route + * table. The Networking service does NOT automatically associate the attached VCN's default route table + * with the LPG. + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + String routeTableId; + /** * The OCID of the VCN the LPG belongs to. **/ diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/DrgAttachment.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/DrgAttachment.java index d867b92be10..9a6bf19f9b6 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/DrgAttachment.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/DrgAttachment.java @@ -72,6 +72,15 @@ public Builder lifecycleState(LifecycleState lifecycleState) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + private String routeTableId; + + public Builder routeTableId(String routeTableId) { + this.routeTableId = routeTableId; + this.__explicitlySet__.add("routeTableId"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("timeCreated") private java.util.Date timeCreated; @@ -101,6 +110,7 @@ public DrgAttachment build() { drgId, id, lifecycleState, + routeTableId, timeCreated, vcnId); __instance__.__explicitlySet__.addAll(__explicitlySet__); @@ -115,6 +125,7 @@ public Builder copy(DrgAttachment o) { .drgId(o.getDrgId()) .id(o.getId()) .lifecycleState(o.getLifecycleState()) + .routeTableId(o.getRouteTableId()) .timeCreated(o.getTimeCreated()) .vcnId(o.getVcnId()); @@ -209,6 +220,12 @@ public static LifecycleState create(String key) { @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") LifecycleState lifecycleState; + /** + * The OCID of the route table the DRG attachment is using. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + String routeTableId; + /** * The date and time the DRG attachment was created, in the format defined by RFC3339. *

diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/LocalPeeringGateway.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/LocalPeeringGateway.java index 07ce0fced6f..423ce9acd51 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/LocalPeeringGateway.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/LocalPeeringGateway.java @@ -109,6 +109,15 @@ public Builder peerAdvertisedCidr(String peerAdvertisedCidr) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("peerAdvertisedCidrDetails") + private java.util.List peerAdvertisedCidrDetails; + + public Builder peerAdvertisedCidrDetails(java.util.List peerAdvertisedCidrDetails) { + this.peerAdvertisedCidrDetails = peerAdvertisedCidrDetails; + this.__explicitlySet__.add("peerAdvertisedCidrDetails"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("peeringStatus") private PeeringStatus peeringStatus; @@ -127,6 +136,15 @@ public Builder peeringStatusDetails(String peeringStatusDetails) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + private String routeTableId; + + public Builder routeTableId(String routeTableId) { + this.routeTableId = routeTableId; + this.__explicitlySet__.add("routeTableId"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("timeCreated") private java.util.Date timeCreated; @@ -159,8 +177,10 @@ public LocalPeeringGateway build() { isCrossTenancyPeering, lifecycleState, peerAdvertisedCidr, + peerAdvertisedCidrDetails, peeringStatus, peeringStatusDetails, + routeTableId, timeCreated, vcnId); __instance__.__explicitlySet__.addAll(__explicitlySet__); @@ -178,8 +198,10 @@ public Builder copy(LocalPeeringGateway o) { .isCrossTenancyPeering(o.getIsCrossTenancyPeering()) .lifecycleState(o.getLifecycleState()) .peerAdvertisedCidr(o.getPeerAdvertisedCidr()) + .peerAdvertisedCidrDetails(o.getPeerAdvertisedCidrDetails()) .peeringStatus(o.getPeeringStatus()) .peeringStatusDetails(o.getPeeringStatusDetails()) + .routeTableId(o.getRouteTableId()) .timeCreated(o.getTimeCreated()) .vcnId(o.getVcnId()); @@ -299,16 +321,27 @@ public static LifecycleState create(String key) { LifecycleState lifecycleState; /** - * The range of IP addresses available on the VCN at the other - * end of the peering from this LPG. The value is `null` if the LPG is not peered. - * You can use this as the destination CIDR for a route rule to route a subnet's - * traffic to this LPG. + * The smallest aggregate CIDR that contains all the CIDR routes advertised by the VCN + * at the other end of the peering from this LPG. See `peerAdvertisedCidrDetails` for + * the individual CIDRs. The value is `null` if the LPG is not peered. *

- * Example: `192.168.0.0/16` + * Example: `192.168.0.0/16`, or if aggregated with `172.16.0.0/24` then `128.0.0.0/1` * **/ @com.fasterxml.jackson.annotation.JsonProperty("peerAdvertisedCidr") String peerAdvertisedCidr; + + /** + * The specific ranges of IP addresses available on or via the VCN at the other + * end of the peering from this LPG. The value is `null` if the LPG is not peered. + * You can use these as destination CIDRs for route rules to route a subnet's + * traffic to this LPG. + *

+ * Example: [`192.168.0.0/16`, `172.16.0.0/24`] + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("peerAdvertisedCidrDetails") + java.util.List peerAdvertisedCidrDetails; /** * Whether the LPG is peered with another LPG. `NEW` means the LPG has not yet been * peered. `PENDING` means the peering is being established. `REVOKED` means the @@ -376,6 +409,12 @@ public static PeeringStatus create(String key) { @com.fasterxml.jackson.annotation.JsonProperty("peeringStatusDetails") String peeringStatusDetails; + /** + * The OCID of the route table the LPG is using. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + String routeTableId; + /** * The date and time the LPG was created, in the format defined by RFC3339. *

diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateDrgAttachmentDetails.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateDrgAttachmentDetails.java index 86d405f3807..b8f23822217 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateDrgAttachmentDetails.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateDrgAttachmentDetails.java @@ -33,18 +33,29 @@ public Builder displayName(String displayName) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + private String routeTableId; + + public Builder routeTableId(String routeTableId) { + this.routeTableId = routeTableId; + this.__explicitlySet__.add("routeTableId"); + return this; + } + @com.fasterxml.jackson.annotation.JsonIgnore private final java.util.Set __explicitlySet__ = new java.util.HashSet(); public UpdateDrgAttachmentDetails build() { - UpdateDrgAttachmentDetails __instance__ = new UpdateDrgAttachmentDetails(displayName); + UpdateDrgAttachmentDetails __instance__ = + new UpdateDrgAttachmentDetails(displayName, routeTableId); __instance__.__explicitlySet__.addAll(__explicitlySet__); return __instance__; } @com.fasterxml.jackson.annotation.JsonIgnore public Builder copy(UpdateDrgAttachmentDetails o) { - Builder copiedBuilder = displayName(o.getDisplayName()); + Builder copiedBuilder = + displayName(o.getDisplayName()).routeTableId(o.getRouteTableId()); copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); return copiedBuilder; @@ -66,6 +77,12 @@ public static Builder builder() { @com.fasterxml.jackson.annotation.JsonProperty("displayName") String displayName; + /** + * The OCID of the route table the DRG attachment will use. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + String routeTableId; + @com.fasterxml.jackson.annotation.JsonIgnore private final java.util.Set __explicitlySet__ = new java.util.HashSet(); } diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateLocalPeeringGatewayDetails.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateLocalPeeringGatewayDetails.java index e1745975841..117d3d19344 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateLocalPeeringGatewayDetails.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/UpdateLocalPeeringGatewayDetails.java @@ -52,12 +52,22 @@ public Builder freeformTags(java.util.Map freeformTags) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + private String routeTableId; + + public Builder routeTableId(String routeTableId) { + this.routeTableId = routeTableId; + this.__explicitlySet__.add("routeTableId"); + return this; + } + @com.fasterxml.jackson.annotation.JsonIgnore private final java.util.Set __explicitlySet__ = new java.util.HashSet(); public UpdateLocalPeeringGatewayDetails build() { UpdateLocalPeeringGatewayDetails __instance__ = - new UpdateLocalPeeringGatewayDetails(definedTags, displayName, freeformTags); + new UpdateLocalPeeringGatewayDetails( + definedTags, displayName, freeformTags, routeTableId); __instance__.__explicitlySet__.addAll(__explicitlySet__); return __instance__; } @@ -67,7 +77,8 @@ public Builder copy(UpdateLocalPeeringGatewayDetails o) { Builder copiedBuilder = definedTags(o.getDefinedTags()) .displayName(o.getDisplayName()) - .freeformTags(o.getFreeformTags()); + .freeformTags(o.getFreeformTags()) + .routeTableId(o.getRouteTableId()); copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); return copiedBuilder; @@ -110,6 +121,12 @@ public static Builder builder() { @com.fasterxml.jackson.annotation.JsonProperty("freeformTags") java.util.Map freeformTags; + /** + * The OCID of the route table the LPG will use. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("routeTableId") + String routeTableId; + @com.fasterxml.jackson.annotation.JsonIgnore private final java.util.Set __explicitlySet__ = new java.util.HashSet(); } diff --git a/bmc-database/pom.xml b/bmc-database/pom.xml index 7f973b4bd95..9d0746b13ee 100644 --- a/bmc-database/pom.xml +++ b/bmc-database/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-dns/pom.xml b/bmc-dns/pom.xml index 0e73bdfe710..b252da55b3c 100644 --- a/bmc-dns/pom.xml +++ b/bmc-dns/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-email/pom.xml b/bmc-email/pom.xml index 9b5c2a4ad8b..1c249f59903 100644 --- a/bmc-email/pom.xml +++ b/bmc-email/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-examples/pom.xml b/bmc-examples/pom.xml index 5148a677ee1..680b4dbc191 100644 --- a/bmc-examples/pom.xml +++ b/bmc-examples/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-bom - 1.3.0 + 1.3.1 pom import diff --git a/bmc-examples/src/main/java/RawRestCallExample.java b/bmc-examples/src/main/java/RawRestCallExample.java index 45d2e49930b..8e1aec63e73 100644 --- a/bmc-examples/src/main/java/RawRestCallExample.java +++ b/bmc-examples/src/main/java/RawRestCallExample.java @@ -38,6 +38,10 @@ public static void main(String[] args) throws Exception { String configurationFilePath = "~/.oci/config"; String profile = "DEFAULT"; + // Pre-Requirement: Allow setting of restricted headers. This is required to allow the SigningFilter + // to set the host header that gets computed during signing of the request. + System.setProperty("sun.net.http.allowRestrictedHeaders", "true"); + // 1) Create your auth provider and request signer AuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configurationFilePath, profile); diff --git a/bmc-examples/src/main/java/VcnTransitRouting.java b/bmc-examples/src/main/java/VcnTransitRouting.java new file mode 100644 index 00000000000..a956eea762f --- /dev/null +++ b/bmc-examples/src/main/java/VcnTransitRouting.java @@ -0,0 +1,648 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import com.oracle.bmc.Region; +import com.oracle.bmc.auth.AuthenticationDetailsProvider; +import com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider; +import com.oracle.bmc.core.VirtualNetwork; +import com.oracle.bmc.core.VirtualNetworkClient; +import com.oracle.bmc.core.model.ConnectLocalPeeringGatewaysDetails; +import com.oracle.bmc.core.model.CreateDrgAttachmentDetails; +import com.oracle.bmc.core.model.CreateDrgDetails; +import com.oracle.bmc.core.model.CreateLocalPeeringGatewayDetails; +import com.oracle.bmc.core.model.CreateRouteTableDetails; +import com.oracle.bmc.core.model.CreateSubnetDetails; +import com.oracle.bmc.core.model.CreateVcnDetails; +import com.oracle.bmc.core.model.Drg; +import com.oracle.bmc.core.model.DrgAttachment; +import com.oracle.bmc.core.model.LocalPeeringGateway; +import com.oracle.bmc.core.model.RouteRule; +import com.oracle.bmc.core.model.RouteTable; +import com.oracle.bmc.core.model.Subnet; +import com.oracle.bmc.core.model.UpdateDrgAttachmentDetails; +import com.oracle.bmc.core.model.UpdateLocalPeeringGatewayDetails; +import com.oracle.bmc.core.model.UpdateRouteTableDetails; +import com.oracle.bmc.core.model.Vcn; +import com.oracle.bmc.core.requests.ConnectLocalPeeringGatewaysRequest; +import com.oracle.bmc.core.requests.CreateDrgAttachmentRequest; +import com.oracle.bmc.core.requests.CreateDrgRequest; +import com.oracle.bmc.core.requests.CreateLocalPeeringGatewayRequest; +import com.oracle.bmc.core.requests.CreateRouteTableRequest; +import com.oracle.bmc.core.requests.CreateSubnetRequest; +import com.oracle.bmc.core.requests.CreateVcnRequest; +import com.oracle.bmc.core.requests.DeleteDrgAttachmentRequest; +import com.oracle.bmc.core.requests.DeleteDrgRequest; +import com.oracle.bmc.core.requests.DeleteLocalPeeringGatewayRequest; +import com.oracle.bmc.core.requests.DeleteRouteTableRequest; +import com.oracle.bmc.core.requests.DeleteSubnetRequest; +import com.oracle.bmc.core.requests.DeleteVcnRequest; +import com.oracle.bmc.core.requests.GetDrgAttachmentRequest; +import com.oracle.bmc.core.requests.GetDrgRequest; +import com.oracle.bmc.core.requests.GetLocalPeeringGatewayRequest; +import com.oracle.bmc.core.requests.GetRouteTableRequest; +import com.oracle.bmc.core.requests.GetSubnetRequest; +import com.oracle.bmc.core.requests.GetVcnRequest; +import com.oracle.bmc.core.requests.UpdateDrgAttachmentRequest; +import com.oracle.bmc.core.requests.UpdateLocalPeeringGatewayRequest; +import com.oracle.bmc.core.requests.UpdateRouteTableRequest; +import com.oracle.bmc.core.responses.ConnectLocalPeeringGatewaysResponse; +import com.oracle.bmc.core.responses.CreateDrgAttachmentResponse; +import com.oracle.bmc.core.responses.CreateDrgResponse; +import com.oracle.bmc.core.responses.CreateLocalPeeringGatewayResponse; +import com.oracle.bmc.core.responses.CreateRouteTableResponse; +import com.oracle.bmc.core.responses.CreateSubnetResponse; +import com.oracle.bmc.core.responses.CreateVcnResponse; +import com.oracle.bmc.core.responses.UpdateDrgAttachmentResponse; +import com.oracle.bmc.core.responses.UpdateLocalPeeringGatewayResponse; +import com.oracle.bmc.core.responses.UpdateRouteTableResponse; +import com.oracle.bmc.identity.IdentityClient; +import com.oracle.bmc.identity.model.AvailabilityDomain; +import com.oracle.bmc.identity.requests.ListAvailabilityDomainsRequest; +import com.oracle.bmc.identity.responses.ListAvailabilityDomainsResponse; + +/** + * Sample to demonstrate setting up VCN Transit Routing + *

+ * The sample relies on the correct IAM policies already being in place for a given compartment ID. + *

+ * + * TOPOLOGY + * spokeVcn hubVcn + * 11.0.0.0/16 10.0.0.0/16 + * +----------------------------+ +-------------------- + + * | | | | + * | | +---------------+ | + * | | | | | | + * | +-----------+ | v | | | + * | | +----+ +-----+ +-----+----+ | | + * | | SUBNET | RT |------->| LPG +------------------+ LPG | RT | | | + * | | +----+ +-----+ +-----+--+-+ | | + * | +-----------+ | | | | | + * | | | | +----+---+ | + * | | | | | RT | | + * | | +--|----+--------+----+ + * +----------------------------+ | | DrgAtt | + * | +----+---+ + * | | + * | +----+---+ + * +--->| DRG | + * +----+---+ + * | + * | + * + + * to OnPrem Network 172.16.0.0/16 + * + * Vcn Transit Routing allows your OnPrem network to access your connected VCN as well as any + * Peered VCN(s). VCN Transit Routing is achieved through the use of LocalPeeringGateway in conjunction + * with a dynamically routing gateway (or DRG). + * + * The order of operations and waiting for the appropriate state is important. This sample + * demonstrates the creation of resources on a single thread to more clearly demonstrate the + * setup for VCN Transit Routing. + * + * It is also worth noting that the Hub VCN utilizes a dynamic routing gateway. DRGs are a + * finite resource and may require contacting customer support if limits have been exceeded + * for a given tenancy. + */ +public class VcnTransitRouting { + // Set this with your own compartment ID + private static final String COMPARTMENT_ID = ""; + + private static final String HUB_VCN_CIDR = "10.0.0.0/16"; + private static final String SPOKE_VCN_CIDR = "11.0.0.0/16"; + private static final String SPOKE_VCN_SUBNET_CIDR = "11.0.1.0/24"; + private static final String ON_PREM_NETWORK_CIDR = "172.16.0.0/16"; + + private static final String TIMESTAMP_SUFFIX = + String.valueOf(System.currentTimeMillis() % TimeUnit.SECONDS.toMillis(10L)); + + private final VirtualNetworkClient virtualNetworkClient; + private final Region region; + + public VcnTransitRouting(VirtualNetworkClient virtualNetworkClient, Region region) { + this.virtualNetworkClient = virtualNetworkClient; + this.region = region; + } + + public static void main(final String... args) throws Exception { + if ("".equals(COMPARTMENT_ID)) { + throw new IllegalStateException("A compartment ID must be defined"); + } + + final AuthenticationDetailsProvider authProvider = + new ConfigFileAuthenticationDetailsProvider("~/.oci/config", "DEFAULT"); + + final VirtualNetworkClient phxVirtualNetworkClient = new VirtualNetworkClient(authProvider); + phxVirtualNetworkClient.setRegion(Region.US_PHOENIX_1); + final VcnTransitRouting example = + new VcnTransitRouting(phxVirtualNetworkClient, Region.US_PHOENIX_1); + final IdentityClient identityClient = new IdentityClient(authProvider); + identityClient.setRegion(Region.US_PHOENIX_1); + + example.run(identityClient); + } + + public void run(IdentityClient identityClient) throws Exception { + System.out.println("Setting up Hub Vcn."); + + System.out.println("Creating Hub Vcn."); + Vcn hubVcn = createVcn(virtualNetworkClient, region, HUB_VCN_CIDR, "HUBVCN"); + + System.out.println("Creating DRG in the hub Vcn."); + Drg drg = createDrg(virtualNetworkClient, region); + + System.out.println("Creating DRG Attachment in the hub Vcn."); + DrgAttachment drgAttachment = + createDrgAttachment(virtualNetworkClient, region, hubVcn, drg); + + System.out.println("Creating LPG the hub Vcn."); + LocalPeeringGateway hubLpg = createLpg(virtualNetworkClient, hubVcn, "hub-VCN-LPG"); + + System.out.println( + "Creating Route Table that will be associated with Drg Attachment in the hub Vcn."); + RouteRule routeToSpoke = + RouteRule.builder() + .cidrBlock(SPOKE_VCN_CIDR) + .networkEntityId(hubLpg.getId()) + .build(); + RouteTable drgAttRT = + createRouteTable( + virtualNetworkClient, + "drgAttRT", + hubVcn, + Collections.singletonList(routeToSpoke)); + + System.out.println("Associating drgAttRT with Drg Attachment in the hub Vcn."); + drgAttachment = + associateRouteTableWithDrgAttachment(virtualNetworkClient, drgAttachment, drgAttRT); + + System.out.println( + "Creating Route Table that will be associated with hubLpg in the hub Vcn."); + RouteRule routeToOnPrem = + RouteRule.builder() + .cidrBlock(ON_PREM_NETWORK_CIDR) + .networkEntityId(drg.getId()) + .build(); + RouteTable hubLpgRT = + createRouteTable( + virtualNetworkClient, + "hubLpgRT", + hubVcn, + Collections.singletonList(routeToOnPrem)); + + System.out.println("Associating hubLpgRT with hubLpg in the hub Vcn."); + hubLpg = associateRouteTableWithLpg(virtualNetworkClient, hubLpg, hubLpgRT); + + System.out.println( + "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"); + + System.out.println("Setting up Spoke Vcn."); + Vcn spokeVcn = createVcn(virtualNetworkClient, region, SPOKE_VCN_CIDR, "SPOKEVCN"); + + System.out.println("Creating LPG the spoke Vcn."); + LocalPeeringGateway spokeLpg = createLpg(virtualNetworkClient, spokeVcn, "spoke-vcn-lpg"); + + System.out.println("Creating Subnet Route Table in the spoke Vcn."); + List subnetRTRules = new ArrayList<>(); + + System.out.println("Adding peer route to subnet route table in spoke VCN"); + subnetRTRules.add( + RouteRule.builder() + .cidrBlock(HUB_VCN_CIDR) + .networkEntityId(spokeLpg.getId()) + .build()); + + System.out.println("Adding on-prem route to subnet route table in spoke VCN"); + subnetRTRules.add( + RouteRule.builder() + .cidrBlock(ON_PREM_NETWORK_CIDR) + .networkEntityId(spokeLpg.getId()) + .build()); + + RouteTable subnetRT = + createRouteTable(virtualNetworkClient, "spoke-subnet-RT", spokeVcn, subnetRTRules); + + System.out.println("Creating Subnet with Route Table the spoke Vcn."); + final List availabilityDomains = + getAvailabilityDomains(identityClient, COMPARTMENT_ID); + + Subnet spokeSubnet = + createSubnet( + virtualNetworkClient, + spokeVcn, + "spoke-subnet", + availabilityDomains.get(0), + subnetRT); + + System.out.println( + "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"); + System.out.println("Establishing peering betwwen hub and spoke vcn"); + connectLpg(virtualNetworkClient, hubLpg, spokeLpg); + + System.out.println( + "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"); + System.out.println("Setup Completed"); + + // Start the cleanup process + System.out.println( + "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"); + System.out.println("Cleaning up Hub Vcn."); + + // Cleaning up the route tables must happen before deleting any associated entities. + System.out.println("Clearing the route tables in Hub Vcn."); + drgAttRT = updateRouteTable(virtualNetworkClient, drgAttRT, Collections.EMPTY_LIST); + hubLpgRT = updateRouteTable(virtualNetworkClient, hubLpgRT, Collections.EMPTY_LIST); + + System.out.println("Deleting the Drg Attachment in Hub Vcn."); + deleteDrgAttachment(virtualNetworkClient, drgAttachment); + + System.out.println("Deleting the Drg in Hub Vcn."); + deleteDrg(virtualNetworkClient, drg); + + System.out.println("Deleting the Hub Lpg in Hub Vcn."); + deleteLpg(virtualNetworkClient, hubLpg); + + // Route tables can only be deleted after the associated entities are deleted. + System.out.println("Deleting route table associated with hubLpg Hub Vcn."); + deleteRouteTable(virtualNetworkClient, hubLpgRT); + + System.out.println("Deleting route table associated with drgAttachment Hub Vcn."); + deleteRouteTable(virtualNetworkClient, drgAttRT); + + System.out.println("Deleting the the Hub Vcn."); + deleteVcn(virtualNetworkClient, hubVcn); + + System.out.println( + "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"); + System.out.println("Cleaning up Spoke Vcn."); + + System.out.println("Clearing the route tables in Spoke Vcn."); + subnetRT = updateRouteTable(virtualNetworkClient, subnetRT, Collections.EMPTY_LIST); + + System.out.println("Deleting the Spoke Lpg in Spoke Vcn."); + deleteLpg(virtualNetworkClient, spokeLpg); + + System.out.println("Deleting the subnet in Spoke Vcn."); + deleteSubnet(virtualNetworkClient, spokeSubnet); + + System.out.println("Deleting the subnet route tbale in Spoke Vcn."); + deleteRouteTable(virtualNetworkClient, subnetRT); + + System.out.println("Deleting the the Spoke Vcn."); + deleteVcn(virtualNetworkClient, spokeVcn); + } + + private static List getAvailabilityDomains( + final IdentityClient identityClient, final String compartmentId) { + ListAvailabilityDomainsResponse listAvailabilityDomainsResponse = + identityClient.listAvailabilityDomains( + ListAvailabilityDomainsRequest.builder() + .compartmentId(compartmentId) + .build()); + + return listAvailabilityDomainsResponse.getItems(); + } + + private static Vcn createVcn( + final VirtualNetwork virtualNetwork, + final Region region, + final String cidrBlock, + final String label) + throws Exception { + final CreateVcnRequest request = + CreateVcnRequest.builder() + .createVcnDetails( + CreateVcnDetails.builder() + .cidrBlock(cidrBlock) + .compartmentId(COMPARTMENT_ID) + .displayName( + String.format( + "%s-%s-%s", + region.getRegionId(), + label, + TIMESTAMP_SUFFIX)) + .dnsLabel( + String.format( + "dns%s%s", region.getRegionCode(), label)) + .build()) + .build(); + + final CreateVcnResponse response = virtualNetwork.createVcn(request); + + virtualNetwork + .getWaiters() + .forVcn( + GetVcnRequest.builder().vcnId(response.getVcn().getId()).build(), + Vcn.LifecycleState.Available) + .execute(); + return response.getVcn(); + } + + private static Drg createDrg(final VirtualNetwork virtualNetwork, final Region region) + throws Exception { + final CreateDrgRequest request = + CreateDrgRequest.builder() + .createDrgDetails( + CreateDrgDetails.builder() + .compartmentId(COMPARTMENT_ID) + .displayName( + String.format( + "Drg-%s-%s", + region.getRegionId(), + TIMESTAMP_SUFFIX)) + .build()) + .build(); + + final CreateDrgResponse response = virtualNetwork.createDrg(request); + + virtualNetwork + .getWaiters() + .forDrg( + GetDrgRequest.builder().drgId(response.getDrg().getId()).build(), + Drg.LifecycleState.Available) + .execute(); + return response.getDrg(); + } + + private static DrgAttachment createDrgAttachment( + final VirtualNetwork virtualNetwork, final Region region, final Vcn vcn, final Drg drg) + throws Exception { + final CreateDrgAttachmentRequest request = + CreateDrgAttachmentRequest.builder() + .createDrgAttachmentDetails( + CreateDrgAttachmentDetails.builder() + .displayName( + String.format( + "DrgAttachment-%s-%s", + region.getRegionId(), + TIMESTAMP_SUFFIX)) + .drgId(drg.getId()) + .vcnId(vcn.getId()) + .build()) + .build(); + + final CreateDrgAttachmentResponse response = virtualNetwork.createDrgAttachment(request); + + virtualNetwork + .getWaiters() + .forDrgAttachment( + GetDrgAttachmentRequest.builder() + .drgAttachmentId(response.getDrgAttachment().getId()) + .build(), + DrgAttachment.LifecycleState.Attached) + .execute(); + return response.getDrgAttachment(); + } + + private static DrgAttachment associateRouteTableWithDrgAttachment( + VirtualNetwork virtualNetwork, DrgAttachment drgAttachment, RouteTable routeTable) + throws Exception { + UpdateDrgAttachmentResponse response = + virtualNetwork.updateDrgAttachment( + UpdateDrgAttachmentRequest.builder() + .drgAttachmentId(drgAttachment.getId()) + .updateDrgAttachmentDetails( + UpdateDrgAttachmentDetails.builder() + .routeTableId(routeTable.getId()) + .build()) + .build()); + return response.getDrgAttachment(); + } + + private static RouteTable createRouteTable( + VirtualNetwork virtualNetwork, String displayName, Vcn vcn, List routeRules) + throws Exception { + CreateRouteTableResponse response = + virtualNetwork.createRouteTable( + CreateRouteTableRequest.builder() + .createRouteTableDetails( + CreateRouteTableDetails.builder() + .compartmentId(COMPARTMENT_ID) + .vcnId(vcn.getId()) + .displayName(displayName) + .routeRules(routeRules) + .build()) + .build()); + + virtualNetwork + .getWaiters() + .forRouteTable( + GetRouteTableRequest.builder() + .rtId(response.getRouteTable().getId()) + .build(), + RouteTable.LifecycleState.Available) + .execute(); + return response.getRouteTable(); + } + + private static RouteTable updateRouteTable( + VirtualNetwork virtualNetwork, RouteTable routeTable, List routeRules) + throws Exception { + UpdateRouteTableResponse response = + virtualNetwork.updateRouteTable( + UpdateRouteTableRequest.builder() + .rtId(routeTable.getId()) + .updateRouteTableDetails( + UpdateRouteTableDetails.builder() + .routeRules(routeRules) + .build()) + .build()); + return response.getRouteTable(); + } + + private static Subnet createSubnet( + VirtualNetwork virtualNetwork, + Vcn vcn, + String displayName, + AvailabilityDomain availabilityDomain, + RouteTable routeTable) + throws Exception { + CreateSubnetResponse response = + virtualNetwork.createSubnet( + CreateSubnetRequest.builder() + .createSubnetDetails( + CreateSubnetDetails.builder() + .compartmentId(vcn.getCompartmentId()) + .availabilityDomain(availabilityDomain.getName()) + .displayName(displayName) + .vcnId(vcn.getId()) + .cidrBlock(SPOKE_VCN_SUBNET_CIDR) + .dnsLabel("javasdksubex") + .routeTableId(routeTable.getId()) + .build()) + .build()); + + virtualNetwork + .getWaiters() + .forSubnet( + GetSubnetRequest.builder().subnetId(response.getSubnet().getId()).build(), + Subnet.LifecycleState.Available) + .execute(); + System.out.println("Created Subnet: " + response.getSubnet().getId()); + return response.getSubnet(); + } + + private static LocalPeeringGateway createLpg( + VirtualNetwork virtualNetwork, Vcn vcn, String displayName) throws Exception { + CreateLocalPeeringGatewayResponse response = + virtualNetwork.createLocalPeeringGateway( + CreateLocalPeeringGatewayRequest.builder() + .createLocalPeeringGatewayDetails( + CreateLocalPeeringGatewayDetails.builder() + .compartmentId(vcn.getCompartmentId()) + .displayName(displayName) + .vcnId(vcn.getId()) + .build()) + .build()); + + virtualNetwork + .getWaiters() + .forLocalPeeringGateway( + GetLocalPeeringGatewayRequest.builder() + .localPeeringGatewayId(response.getLocalPeeringGateway().getId()) + .build(), + LocalPeeringGateway.LifecycleState.Available) + .execute(); + System.out.println("Created LPG: " + response.getLocalPeeringGateway().getId()); + return response.getLocalPeeringGateway(); + } + + private static void connectLpg( + VirtualNetwork virtualNetwork, LocalPeeringGateway lpg1, LocalPeeringGateway lpg2) + throws Exception { + ConnectLocalPeeringGatewaysResponse response = + virtualNetwork.connectLocalPeeringGateways( + ConnectLocalPeeringGatewaysRequest.builder() + .connectLocalPeeringGatewaysDetails( + ConnectLocalPeeringGatewaysDetails.builder() + .peerId(lpg2.getId()) + .build()) + .localPeeringGatewayId(lpg1.getId()) + .build()); + virtualNetwork + .getWaiters() + .forLocalPeeringGateway( + GetLocalPeeringGatewayRequest.builder() + .localPeeringGatewayId(lpg1.getId()) + .build(), + LocalPeeringGateway.PeeringStatus.Peered) + .execute(); + + virtualNetwork + .getWaiters() + .forLocalPeeringGateway( + GetLocalPeeringGatewayRequest.builder() + .localPeeringGatewayId(lpg2.getId()) + .build(), + LocalPeeringGateway.PeeringStatus.Peered) + .execute(); + } + + private static LocalPeeringGateway associateRouteTableWithLpg( + VirtualNetwork virtualNetwork, LocalPeeringGateway lpg, RouteTable routeTable) + throws Exception { + UpdateLocalPeeringGatewayResponse response = + virtualNetwork.updateLocalPeeringGateway( + UpdateLocalPeeringGatewayRequest.builder() + .localPeeringGatewayId(lpg.getId()) + .updateLocalPeeringGatewayDetails( + UpdateLocalPeeringGatewayDetails.builder() + .routeTableId(routeTable.getId()) + .build()) + .build()); + return response.getLocalPeeringGateway(); + } + + private static void deleteLpg(VirtualNetwork virtualNetwork, LocalPeeringGateway lpg) + throws Exception { + virtualNetwork.deleteLocalPeeringGateway( + DeleteLocalPeeringGatewayRequest.builder() + .localPeeringGatewayId(lpg.getId()) + .build()); + virtualNetwork + .getWaiters() + .forLocalPeeringGateway( + GetLocalPeeringGatewayRequest.builder() + .localPeeringGatewayId(lpg.getId()) + .build(), + LocalPeeringGateway.LifecycleState.Terminated) + .execute(); + System.out.println("Deleted Lpg: " + lpg.getId()); + } + + private static void deleteSubnet(VirtualNetwork virtualNetwork, Subnet subnet) + throws Exception { + virtualNetwork.deleteSubnet(DeleteSubnetRequest.builder().subnetId(subnet.getId()).build()); + virtualNetwork + .getWaiters() + .forSubnet( + GetSubnetRequest.builder().subnetId(subnet.getId()).build(), + Subnet.LifecycleState.Terminated) + .execute(); + System.out.println("Deleted Subnet: " + subnet.getId()); + } + + private static void deleteRouteTable(VirtualNetwork virtualNetwork, RouteTable routeTable) + throws Exception { + virtualNetwork.deleteRouteTable( + DeleteRouteTableRequest.builder().rtId(routeTable.getId()).build()); + virtualNetwork + .getWaiters() + .forRouteTable( + GetRouteTableRequest.builder().rtId(routeTable.getId()).build(), + RouteTable.LifecycleState.Terminated) + .execute(); + System.out.println("Deleted Route Table: " + routeTable.getId()); + } + + private static void deleteDrgAttachment( + final VirtualNetwork virtualNetwork, final DrgAttachment drgAttachment) + throws Exception { + final DeleteDrgAttachmentRequest request = + DeleteDrgAttachmentRequest.builder().drgAttachmentId(drgAttachment.getId()).build(); + virtualNetwork.deleteDrgAttachment(request); + + virtualNetwork + .getWaiters() + .forDrgAttachment( + GetDrgAttachmentRequest.builder() + .drgAttachmentId(drgAttachment.getId()) + .build(), + DrgAttachment.LifecycleState.Detached) + .execute(); + System.out.println("Deleted DrgAttachment: " + drgAttachment.getId()); + } + + private static void deleteDrg(final VirtualNetwork virtualNetwork, final Drg drg) + throws Exception { + final DeleteDrgRequest request = DeleteDrgRequest.builder().drgId(drg.getId()).build(); + virtualNetwork.deleteDrg(request); + + virtualNetwork + .getWaiters() + .forDrg( + GetDrgRequest.builder().drgId(drg.getId()).build(), + Drg.LifecycleState.Terminated) + .execute(); + System.out.println("Deleted Drg: " + drg.getId()); + } + + private static void deleteVcn(final VirtualNetwork virtualNetwork, final Vcn vcn) + throws Exception { + final DeleteVcnRequest request = DeleteVcnRequest.builder().vcnId(vcn.getId()).build(); + virtualNetwork.deleteVcn(request); + + virtualNetwork + .getWaiters() + .forVcn( + GetVcnRequest.builder().vcnId(vcn.getId()).build(), + Vcn.LifecycleState.Terminated) + .execute(); + System.out.println("Deleted Vcn: " + vcn.getId()); + } +} diff --git a/bmc-filestorage/pom.xml b/bmc-filestorage/pom.xml index 585227d1586..06f34e01de8 100644 --- a/bmc-filestorage/pom.xml +++ b/bmc-filestorage/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-full/pom.xml b/bmc-full/pom.xml index 9da9786cee6..ec7f7a62c1a 100644 --- a/bmc-full/pom.xml +++ b/bmc-full/pom.xml @@ -4,7 +4,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml oci-java-sdk-full @@ -16,7 +16,7 @@ com.oracle.oci.sdk oci-java-sdk-bom - 1.3.0 + 1.3.1 pom import diff --git a/bmc-identity/pom.xml b/bmc-identity/pom.xml index fbf176f9d55..82789f106a3 100644 --- a/bmc-identity/pom.xml +++ b/bmc-identity/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-keymanagement/pom.xml b/bmc-keymanagement/pom.xml index 65c1b2200bc..c1ab789099a 100644 --- a/bmc-keymanagement/pom.xml +++ b/bmc-keymanagement/pom.xml @@ -4,7 +4,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml oci-java-sdk-keymanagement @@ -17,7 +17,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-loadbalancer/pom.xml b/bmc-loadbalancer/pom.xml index caf27291111..6b6d6c70098 100644 --- a/bmc-loadbalancer/pom.xml +++ b/bmc-loadbalancer/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-objectstorage/bmc-objectstorage-combined/pom.xml b/bmc-objectstorage/bmc-objectstorage-combined/pom.xml index bdf2f53251c..acb26755334 100644 --- a/bmc-objectstorage/bmc-objectstorage-combined/pom.xml +++ b/bmc-objectstorage/bmc-objectstorage-combined/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk-objectstorage-parent - 1.3.0 + 1.3.1 ../pom.xml @@ -18,12 +18,12 @@ com.oracle.oci.sdk oci-java-sdk-objectstorage-generated - 1.3.0 + 1.3.1 com.oracle.oci.sdk oci-java-sdk-objectstorage-extensions - 1.3.0 + 1.3.1 diff --git a/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml b/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml index 4e709358c04..8315c0e6264 100644 --- a/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml +++ b/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk-objectstorage-parent - 1.3.0 + 1.3.1 ../pom.xml @@ -19,12 +19,12 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 com.oracle.oci.sdk oci-java-sdk-objectstorage-generated - 1.3.0 + 1.3.1 diff --git a/bmc-objectstorage/bmc-objectstorage-generated/pom.xml b/bmc-objectstorage/bmc-objectstorage-generated/pom.xml index 6b2d801178b..0aea05368ec 100644 --- a/bmc-objectstorage/bmc-objectstorage-generated/pom.xml +++ b/bmc-objectstorage/bmc-objectstorage-generated/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk-objectstorage-parent - 1.3.0 + 1.3.1 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-objectstorage/pom.xml b/bmc-objectstorage/pom.xml index b577cd292e7..c1558073070 100644 --- a/bmc-objectstorage/pom.xml +++ b/bmc-objectstorage/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml diff --git a/bmc-resourcesearch/pom.xml b/bmc-resourcesearch/pom.xml index a785b2ada93..ece52fd1adf 100644 --- a/bmc-resourcesearch/pom.xml +++ b/bmc-resourcesearch/pom.xml @@ -4,7 +4,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml oci-java-sdk-resourcesearch @@ -17,7 +17,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.3.0 + 1.3.1 diff --git a/bmc-shaded/bmc-shaded-full/pom.xml b/bmc-shaded/bmc-shaded-full/pom.xml index 13f2840332e..15532ff4c38 100644 --- a/bmc-shaded/bmc-shaded-full/pom.xml +++ b/bmc-shaded/bmc-shaded-full/pom.xml @@ -4,7 +4,7 @@ com.oracle.oci.sdk oci-java-sdk-shaded - 1.3.0 + 1.3.1 ../pom.xml oci-java-sdk-shaded-full @@ -43,6 +43,16 @@ javax.ws.rs-api ${javax.ws.rs-api.version} + + org.bouncycastle + bcpkix-jdk15on + ${bouncycastle.version} + + + org.bouncycastle + bcprov-jdk15on + ${bouncycastle.version} + diff --git a/bmc-shaded/pom.xml b/bmc-shaded/pom.xml index e13fbaed2e6..3f31632f231 100644 --- a/bmc-shaded/pom.xml +++ b/bmc-shaded/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 ../pom.xml diff --git a/pom.xml b/pom.xml index 52cb07f1f07..21944ee1516 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.oracle.oci.sdk oci-java-sdk - 1.3.0 + 1.3.1 pom Oracle Cloud Infrastructure SDK This project contains the SDK used for Oracle Cloud Infrastructure