Skip to content

Commit faad631

Browse files
Releasing version 3.1.0
Releasing version 3.1.0
2 parents ac95d81 + 90e279e commit faad631

File tree

757 files changed

+89350
-1653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

757 files changed

+89350
-1653
lines changed

ApacheConnector-README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ or Jersey 3:
9898

9999
The SDK for Java also provides an environment variable to switch back to the old Jersey Default Connector at the global level. To achieve the same, please set the value of the environment variable - `OCI_JAVASDK_JERSEY_CLIENT_DEFAULT_CONNECTOR_ENABLED` to true. By default, this value is set as false.
100100

101+
## Maximum size of stream with BufferedInputStream
102+
103+
When using the `BufferedInputStream` with API operations to upload streams to the service, e.g. to upload objects to the Object Storage service using `putObject`, the stream is buffered into the memory. The maximum buffer size in this case is `Integer.MAX_VALUE - 8` as defined in the [source code](https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/java.base/share/classes/java/io/InputStream.java#L297). Hence, don't use or wrap the object into `BufferedInputStream` when the size of the object to upload is greater than `2.14 GB`. This would lead to `Connection pool shutdown`/`Out of memory` errors.
104+
101105
# Switching off auto-close of streams
102106

103107
For API calls that return binary/stream response, the SDK will auto-close the stream once the stream has been completely read by the customer. If reading the stream completely, the SDK will automatically try to close the stream to release the connection from the connection pool, to disable this feature of auto-closing streams on full read, please call `com.oracle.bmc.http.client.Options.shouldAutoCloseResponseInputStream(false)`. This is because the SDK for Java supports the Apache Connector for sending requests and managing connections to the service. By default, the Apache Connector supports connection pooling and in the cases where the stream from the response is not closed, the connections don't get released from the connection pool and in turn results in an indefinite wait time.

CHANGELOG.md

Lines changed: 168 additions & 2 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 143 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,157 @@ export OCI_SDK_DEFAULT_CIRCUITBREAKER_ENABLED=FALSE
3030
```
3131

3232
## Changes Introduced In OCI Java SDK `3.x.y`
33-
### Removed dependencies on the following third-party libraries:
34-
1. Guava: Guava types have been replaced with JDK types:
35-
- `com.google.common.base.Optional` has been replaced with `java.util.Optional`
36-
- `com.google.common.base.Function` has been replaced with `java.util.function.Function`
37-
- `com.google.common.base.Predicate` has been replaced with `java.util.function.Predicate`
38-
- `com.google.common.base.Supplier` has been replaced with `java.util.function.Supplier`
33+
34+
For full details, look at the changelog for version [`3.0.0-beta1`](https://github.com/oracle/oci-java-sdk/blob/master/CHANGELOG.md#300-beta1---2022-10-25).
3935

4036
### HTTP client library is pluggable
4137
There is no HTTP client library configured by default. The OCI Java SDK offers the following two choices for HTTP client libraries to choose from.
4238
- Jakarta EE 8/Jersey 2 - [bmc-common-httpclient-jersey](https://github.com/oracle/oci-java-sdk/tree/master/bmc-common-httpclient-choices/bmc-common-httpclient-jersey)
4339
- Jakarta EE 9/Jersey 3 - [bmc-common-httpclient-jersey3](https://github.com/oracle/oci-java-sdk/tree/master/bmc-common-httpclient-choices/bmc-common-httpclient-jersey3)
4440

41+
- The OCI Java SDK does not choose an HTTP client library for you, and there is no default. You have to explicitly choose one, by declaring a dependency on `oci-java-sdk-common-httpclient-jersey` or `oci-java-sdk-common-httpclient-jersey3`
42+
- Example:
43+
44+
<dependency>
45+
<!-- Since this is the "application" pom.xml, we do want to
46+
choose the httpclient to use. -->
47+
<groupId>com.oracle.oci.sdk</groupId>
48+
<artifactId>oci-java-sdk-common-httpclient-jersey</artifactId>
49+
</dependency>
50+
51+
52+
### Invocation callbacks
53+
Instead of using `com.oracle.bmc.util.internal.Consumer<Invocation.Builder>` to register invocation callbacks, use `com.oracle.bmc.http.client.RequestInterceptor` instead, to decouple the implementation from the choice of the HTTP client.
54+
55+
### Client configuration has been simplified
56+
`com.oracle.bmc.http.ClientConfigurator` has a single `customizeClient(HttpClientBuilder builder)` method, instead of `customizeBuilder`, `customizeClient`, and `customizeRequest` methods. Example:
57+
58+
IdentityClient.builder()
59+
.clientConfigurator(
60+
builder -> {
61+
builder.property(
62+
StandardClientProperties.BUFFER_REQUEST, false);
63+
})
64+
// ...
65+
.build(authenticationDetailsProvider);
66+
67+
- For a comprehensive list of pre-defined settable properties, see
68+
- [StandardClientProperties.java](https://github.com/oracle/oci-java-sdk/blob/v3.0.0/bmc-common-httpclient/src/main/java/com/oracle/bmc/http/client/StandardClientProperties.java)
69+
- [ApacheClientProperties.java](https://github.com/oracle/oci-java-sdk/blob/d4b2f51c9c69bf64deb124ca921deeac333c3d03/bmc-common-httpclient-choices/bmc-common-httpclient-jersey/src/main/java/com/oracle/bmc/http/client/jersey/ApacheClientProperties.java) or [ApacheClientProperties.java](https://github.com/oracle/oci-java-sdk/blob/d4b2f51c9c69bf64deb124ca921deeac333c3d03/bmc-common-httpclient-choices/bmc-common-httpclient-jersey3/src/main/java/com/oracle/bmc/http/client/jersey3/ApacheClientProperties.java) (Jersey 3)
70+
- You can also define your own properties.
71+
- The actual properties that can be set depends on the HTTP client you are using.
72+
73+
#### Specific client configuration examples
74+
75+
##### Setting whether to buffer a request
76+
77+
builder.property(
78+
StandardClientProperties.BUFFER_REQUEST, shouldBuffer);
79+
80+
##### Setting an Apache connection manager
81+
82+
builder.property(
83+
ApacheClientProperties.CONNECTION_MANAGER,
84+
connectionManager);
85+
86+
##### Setting a trust store
87+
88+
// Server CA goes into the trust store
89+
KeyStore trustStore =
90+
keystoreGenerator.createTrustStoreWithServerCa(tlsConfig.getCaBundle());
91+
builder.property(StandardClientProperties.TRUST_STORE, trustStore);
92+
93+
##### Setting a key store
94+
95+
builder.property(
96+
StandardClientProperties.KEY_STORE,
97+
new KeyStoreWithPassword(keyStore, keystorePassword));
98+
99+
##### Setting the SSL context
100+
101+
builder.property(
102+
StandardClientProperties.SSL_CONTEXT, sslContext);
103+
104+
##### Setting a proxy
105+
106+
builder.property(
107+
StandardClientProperties.PROXY, proxyConfig);
108+
109+
##### Setting a hostname verifier
110+
111+
builder.property(
112+
StandardClientProperties.HOSTNAME_VERIFIER,
113+
NoopHostnameVerifier.INSTANCE);
114+
115+
#### More client configuration examples
116+
- [ApacheConnectorPropertiesExample.java](https://github.com/oracle/oci-java-sdk/blob/v3.0.0/bmc-examples/src/main/java/ApacheConnectorPropertiesExample.java)
117+
- [HttpProxyExample.java](https://github.com/oracle/oci-java-sdk/blob/v3.0.0/bmc-examples/src/main/java/HttpProxyExample.java)
118+
- [DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java](https://github.com/oracle/oci-java-sdk/blob/v3.0.0/bmc-other-examples/bmc-jersey-examples/src/main/java/DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java) and [DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java](https://github.com/oracle/oci-java-sdk/blob/v3.0.0/bmc-other-examples/bmc-jersey3-examples/src/main/java/DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java) (Jersey 3)
119+
120+
### Apache Connector changes
121+
122+
There were numerous changes to decouple the implementation from the choice of the HTTP client.
123+
- `com.oracle.bmc.http.ApacheConfigurator`, has been replaced by `com.oracle.bmc.http.client.jersey.ApacheClientProperties` or `com.oracle.bmc.http.client.jersey3.ApacheClientProperties` (for Jersey 3).
124+
- For clients that should not buffer requests into memory:
125+
126+
ObjectStorageClient nonBufferingObjectStorageClient = ObjectStorageClient
127+
.builder()
128+
.clientConfigurator(builder -> {
129+
builder.property(StandardClientProperties.BUFFER_REQUEST, false);
130+
builder.property(ApacheClientProperties.RETRY_HANDLER, null);
131+
builder.property(ApacheClientProperties.REUSE_STRATEGY, null);
132+
})
133+
.region(Region.US_PHOENIX_1)
134+
.build(provider);
135+
136+
- For clients that should buffer requests into memory:
137+
138+
IdentityClient bufferingIdentityClient = IdentityClient
139+
.builder()
140+
.clientConfigurator(builder -> {
141+
builder.property(StandardClientProperties.BUFFER_REQUEST, true);
142+
builder.property(ApacheClientProperties.RETRY_HANDLER, null);
143+
builder.property(ApacheClientProperties.REUSE_STRATEGY, null);
144+
})
145+
.region(Region.US_PHOENIX_1)
146+
.build(provider);
147+
148+
- See [DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java](https://github.com/oracle/oci-java-sdk/blob/v3.0.0/bmc-other-examples/bmc-jersey-examples/src/main/java/DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java) and [DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java](https://github.com/oracle/oci-java-sdk/blob/v3.0.0/bmc-other-examples/bmc-jersey3-examples/src/main/java/DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java) (Jersey 3)
149+
150+
- Also consider using `com.oracle.bmc.http.client.jersey.apacheconfigurator.ApacheConfigurator from the `oci-java-sdk-addons-apache-configurator-jersey` add-on module; or `com.oracle.bmc.http.client.jersey3.apacheconfigurator.ApacheConfigurator` from the `oci-java-sdk-addons-apache-configurator-jersey3` add-on module.
151+
- See [DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java](https://github.com/oracle/oci-java-sdk/blob/v3.0.0/bmc-other-examples/bmc-jersey-examples/src/main/java/DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java) and [DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java](https://github.com/oracle/oci-java-sdk/blob/v3.0.0/bmc-other-examples/bmc-jersey3-examples/src/main/java/DisableNoConnectionReuseStrategyUsingApacheConfiguratorExample.java) (Jersey 3)
152+
153+
### Circuit breaker changes
154+
- The circuit breaker interface has been renamed from `com.oracle.bmc.circuitbreaker.JaxRsCircuitBreaker` to `com.oracle.bmc.circuitbreaker.OciCircuitBreaker`
155+
- Instead of using the constructor of `com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration`, use the builder. The constructor is not public anymore.
156+
- The `com.oracle.bmc.util.CircuitBreakerUtils` class does not deal with actual circuit breakers anymore, just with `com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration`. As such, the `DEFAULT_CIRCUIT_BREAKER` field and the `getUserDefinedCircuitBreaker` method were removed. Construct a new circuit breaker from the default configuration if necessary using the build methods in `com.oracle.bmc.circuitbreaker.CircuitBreakerFactory`.
157+
158+
### Moved classes
159+
- Class `com.oracle.bmc.Options` was moved to `com.oracle.bmc.http.client.Options`
160+
- Class `com.oracle.bmc.http.Serialization` was moved to `com.oracle.bmc.http.client.Serialization`
161+
- Class `com.oracle.bmc.io.DuplicatableInputStream` was moved to `com.oracle.bmc.http.client.io.DuplicatableInputStream`
162+
163+
### Long deprecated code was removed
164+
- The signing strategy `OBJECT_STORAGE` was removed from `com.oracle.bmc.http.signing.SigningStrategy`; it had been deprecated for years and had been replaced by `EXCLUDE_BODY`.
165+
- The `getPublicKey()` and `getPrivateKey()` methods were removed from `com.oracle.bmc.auth.SessionKeySupplier` and implementing classes; they had been deprecated for years and had been replaced by the `getKeyPair()` method.
166+
167+
168+
### Removed code
169+
- The `setInstanceMetadataServiceClientConfig` method in `com.oracle.bmc.Region` was removed; it never had any effect.
170+
- `AbstractFederationClientAuthenticationDetailsProviderBuilder.simpleRetry` method has been removed without replacement, since it is not needed in the OCI Java SDK 3.0.0 and higher.
171+
- You can copy and paste the [previous implementation](https://github.com/oracle/oci-java-sdk/blob/v2.47.0/bmc-common/src/main/java/com/oracle/bmc/auth/AbstractFederationClientAuthenticationDetailsProviderBuilder.java#L494-L528) if you need it.
172+
173+
### Removed dependencies on the following third-party libraries
174+
- Guava: Guava types have been replaced with JDK types:
175+
- `com.google.common.base.Optional` has been replaced with `java.util.Optional`
176+
- `com.google.common.base.Function` has been replaced with `java.util.function.Function`
177+
- `com.google.common.base.Predicate` has been replaced with `java.util.function.Predicate`
178+
- `com.google.common.base.Supplier` has been replaced with `java.util.function.Supplier`
179+
45180
## Examples
46181

182+
Examples for OCI Java SDK 3.x.y can be found [bmc-examples/src/main/java](https://github.com/oracle/oci-java-sdk/tree/master/bmc-examples/src/main/java).
183+
47184
### Example for Jersey 2 as HTTP client library (OCI Java SDK `3.x.y`)
48185
In order to use Jersey 2 as HTTP client library, a dependency on `oci-java-sdk-common-httpclient-jersey` needs to be explicitly declared in application's `pom.xml`. Please refer [bmc-jersey-examples/pom.xml](https://github.com/oracle/oci-java-sdk/blob/master/bmc-other-examples/bmc-jersey-examples/pom.xml)
49186

bmc-addons/bmc-apache-configurator-jersey-addon/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.oracle.oci.sdk</groupId>
66
<artifactId>oci-java-sdk-addons</artifactId>
7-
<version>3.0.1</version>
7+
<version>3.1.0</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

@@ -18,14 +18,14 @@
1818
<dependency>
1919
<groupId>com.oracle.oci.sdk</groupId>
2020
<artifactId>oci-java-sdk-bom</artifactId>
21-
<version>3.0.1</version>
21+
<version>3.1.0</version>
2222
<type>pom</type>
2323
<scope>import</scope>
2424
</dependency>
2525
<dependency>
2626
<groupId>com.oracle.oci.sdk</groupId>
2727
<artifactId>oci-java-sdk-common-httpclient-jersey</artifactId>
28-
<version>3.0.1</version>
28+
<version>3.1.0</version>
2929
<type>pom</type>
3030
<scope>import</scope>
3131
</dependency>

bmc-addons/bmc-apache-configurator-jersey3-addon/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.oracle.oci.sdk</groupId>
66
<artifactId>oci-java-sdk-addons</artifactId>
7-
<version>3.0.1</version>
7+
<version>3.1.0</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

@@ -18,14 +18,14 @@
1818
<dependency>
1919
<groupId>com.oracle.oci.sdk</groupId>
2020
<artifactId>oci-java-sdk-bom</artifactId>
21-
<version>3.0.1</version>
21+
<version>3.1.0</version>
2222
<type>pom</type>
2323
<scope>import</scope>
2424
</dependency>
2525
<dependency>
2626
<groupId>com.oracle.oci.sdk</groupId>
2727
<artifactId>oci-java-sdk-common-httpclient-jersey3</artifactId>
28-
<version>3.0.1</version>
28+
<version>3.1.0</version>
2929
<type>pom</type>
3030
<scope>import</scope>
3131
</dependency>

bmc-addons/bmc-apache-connector-provider/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.oci.sdk</groupId>
77
<artifactId>oci-java-sdk-addons</artifactId>
8-
<version>3.0.1</version>
8+
<version>3.1.0</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>com.oracle.oci.sdk</groupId>
2121
<artifactId>oci-java-sdk-common</artifactId>
22-
<version>3.0.1</version>
22+
<version>3.1.0</version>
2323
</dependency>
2424
</dependencies>
2525
</project>

bmc-addons/bmc-graalvm-addon/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.oracle.oci.sdk</groupId>
66
<artifactId>oci-java-sdk-addons</artifactId>
7-
<version>3.0.1</version>
7+
<version>3.1.0</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>oci-java-sdk-addons-graalvm</artifactId>
@@ -145,37 +145,37 @@
145145
<dependency>
146146
<groupId>com.oracle.oci.sdk</groupId>
147147
<artifactId>oci-java-sdk-common</artifactId>
148-
<version>3.0.1</version>
148+
<version>3.1.0</version>
149149
<scope>provided</scope>
150150
</dependency>
151151
<dependency>
152152
<groupId>com.oracle.oci.sdk</groupId>
153153
<artifactId>oci-java-sdk-common-httpclient</artifactId>
154-
<version>3.0.1</version>
154+
<version>3.1.0</version>
155155
<scope>provided</scope>
156156
</dependency>
157157
<dependency>
158158
<groupId>com.oracle.oci.sdk</groupId>
159159
<artifactId>oci-java-sdk-core</artifactId>
160-
<version>3.0.1</version>
160+
<version>3.1.0</version>
161161
<scope>test</scope>
162162
</dependency>
163163
<dependency>
164164
<groupId>com.oracle.oci.sdk</groupId>
165165
<artifactId>oci-java-sdk-identity</artifactId>
166-
<version>3.0.1</version>
166+
<version>3.1.0</version>
167167
<scope>test</scope>
168168
</dependency>
169169
<dependency>
170170
<groupId>com.oracle.oci.sdk</groupId>
171171
<artifactId>oci-java-sdk-objectstorage-extensions</artifactId>
172-
<version>3.0.1</version>
172+
<version>3.1.0</version>
173173
<scope>test</scope>
174174
</dependency>
175175
<dependency>
176176
<groupId>com.oracle.oci.sdk</groupId>
177177
<artifactId>oci-java-sdk-objectstorage-generated</artifactId>
178-
<version>3.0.1</version>
178+
<version>3.1.0</version>
179179
<scope>test</scope>
180180
</dependency>
181181
</dependencies>

bmc-addons/bmc-graalvm-addon/src/main/java/com/oracle/bmc/graalvm/SdkAutomaticFeatureMetadata.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"com.oracle.bmc.adm.SdkClientsMetadata",
1010
"com.oracle.bmc.aianomalydetection.SdkClientsMetadata",
1111
"com.oracle.bmc.aidocument.SdkClientsMetadata",
12+
"com.oracle.bmc.aidocument.SdkClientsMetadata",
1213
"com.oracle.bmc.aiforecasting.SdkClientsMetadata",
1314
"com.oracle.bmc.ailanguage.SdkClientsMetadata",
1415
"com.oracle.bmc.aispeech.SdkClientsMetadata",
@@ -44,6 +45,7 @@
4445
"com.oracle.bmc.compdocsapi.SdkClientsMetadata",
4546
"com.oracle.bmc.computeinstanceagent.SdkClientsMetadata",
4647
"com.oracle.bmc.containerengine.SdkClientsMetadata",
48+
"com.oracle.bmc.containerinstances.SdkClientsMetadata",
4749
"com.oracle.bmc.core.SdkClientsMetadata",
4850
"com.oracle.bmc.dashboardservice.SdkClientsMetadata",
4951
"com.oracle.bmc.database.SdkClientsMetadata",

bmc-addons/bmc-graalvm-jersey3-addon/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.oracle.oci.sdk</groupId>
66
<artifactId>oci-java-sdk-addons</artifactId>
7-
<version>3.0.1</version>
7+
<version>3.1.0</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>oci-java-sdk-addons-graalvm-jersey3</artifactId>
@@ -146,37 +146,37 @@
146146
<dependency>
147147
<groupId>com.oracle.oci.sdk</groupId>
148148
<artifactId>oci-java-sdk-common</artifactId>
149-
<version>3.0.1</version>
149+
<version>3.1.0</version>
150150
<scope>provided</scope>
151151
</dependency>
152152
<dependency>
153153
<groupId>com.oracle.oci.sdk</groupId>
154154
<artifactId>oci-java-sdk-common-httpclient</artifactId>
155-
<version>3.0.1</version>
155+
<version>3.1.0</version>
156156
<scope>provided</scope>
157157
</dependency>
158158
<dependency>
159159
<groupId>com.oracle.oci.sdk</groupId>
160160
<artifactId>oci-java-sdk-core</artifactId>
161-
<version>3.0.1</version>
161+
<version>3.1.0</version>
162162
<scope>test</scope>
163163
</dependency>
164164
<dependency>
165165
<groupId>com.oracle.oci.sdk</groupId>
166166
<artifactId>oci-java-sdk-identity</artifactId>
167-
<version>3.0.1</version>
167+
<version>3.1.0</version>
168168
<scope>test</scope>
169169
</dependency>
170170
<dependency>
171171
<groupId>com.oracle.oci.sdk</groupId>
172172
<artifactId>oci-java-sdk-objectstorage-extensions</artifactId>
173-
<version>3.0.1</version>
173+
<version>3.1.0</version>
174174
<scope>test</scope>
175175
</dependency>
176176
<dependency>
177177
<groupId>com.oracle.oci.sdk</groupId>
178178
<artifactId>oci-java-sdk-objectstorage-generated</artifactId>
179-
<version>3.0.1</version>
179+
<version>3.1.0</version>
180180
<scope>test</scope>
181181
</dependency>
182182
</dependencies>

0 commit comments

Comments
 (0)