You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
oci-java-sdk provides an SDK for Java that you can use to manage your Oracle Cloud Infrastructure resources.
7
7
8
8
The project is open source and maintained by Oracle Corp. The home page for the project is [here](https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/javasdk.htm).
9
9
10
+
The OCI Java SDK versions `1.x.y` and `2.x.y` are now referred as OCI Legacy Java SDK. Any updates or bug fixes related to OCI Legacy Java SDK can be found in [legacy/v2/master branch](https://github.com/oracle/oci-java-sdk/tree/legacy/v2/master). Please refer [README.md](https://github.com/oracle/oci-java-sdk/blob/legacy/v2/master/README.md) to learn more about these legacy versions.
11
+
12
+
This Github repository will refer to OCI Java SDK version `3.x.y` by default where support for new features and services will be added.
13
+
14
+
10
15
## Documentation
11
16
12
17
Full documentation, including prerequisites, installation, supported JDK versions and configuration instructions, is available [here](https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/javasdk.htm).
@@ -24,48 +29,54 @@ For details on compatibility, advanced configurations, and add-ons, see [Configu
### 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`
39
+
40
+
### HTTP client library is pluggable
41
+
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.
42
+
- 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)
43
+
- 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)
44
+
27
45
## Examples
28
46
29
-
Examples can be found [here](/bmc-examples/src/main/java/).
47
+
### Example for Jersey 2 as HTTP client library (OCI Java SDK `3.x.y`)
48
+
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)
30
49
31
-
Please compile the `bmc-examples` module before running any example, specially if it is your first time working with the examples. Failure to do so can lead to exception like `ClassNotFoundException`. You can compile the source code of the examples as below:
32
-
```
33
-
cd bmc-examples/
34
-
mvn compile
35
-
```
50
+
Examples for Jersey 2 as HTTP client library can be found in [bmc-other-examples/bmc-jersey-examples](https://github.com/oracle/oci-java-sdk/blob/master/bmc-other-examples/bmc-jersey-examples)
36
51
37
-
You may run any example by invoking the `exec:java` goal and passing appropriate values for `exec.mainClass` and `.exec.arguments` properties,
38
-
for example: `ObjectStorageGetBucketExample` class requires 3 arguments which are OCID of the compartment, name of bucket, name of object. This example class can be executed as follows:
### Example for Jersey 3 as HTTP client library (OCI Java SDK `3.x.y`)
53
+
In order to use Jersey 3 as HTTP client library, a dependency on `oci-java-sdk-common-httpclient-jersey3` needs to be explicitly declared in application's `pom.xml`. Please refer [bmc-jersey3-examples/pom.xml](https://github.com/oracle/oci-java-sdk/blob/master/bmc-other-examples/bmc-jersey3-examples/pom.xml)
54
+
55
+
Examples for Jersey 3 as HTTP client library can be found in [bmc-other-examples/bmc-jersey3-examples](https://github.com/oracle/oci-java-sdk/blob/master/bmc-other-examples/bmc-jersey3-examples)
48
56
49
-
Where `compartment_id`, `bucket_name`, and `object_name` should be substituted with appropriate values according to your setup.
57
+
### Example for OCI Legacy Java SDK (OCI Java SDK `1.x.y` and `2.x.y`)
58
+
Examples for OCI Legacy Java SDK can be found [here](https://github.com/oracle/oci-java-sdk/tree/legacy/v2/master#examples).
50
59
51
60
## Help
52
61
53
62
For details on contributions, questions, or feedback, see [Contact Us](https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/javasdk.htm#ContactUs).
54
63
55
64
## Changes
56
65
57
-
See [CHANGELOG](/CHANGELOG.md).
66
+
See [CHANGELOG](https://github.com/oracle/oci-java-sdk/blob/master/CHANGELOG.md).
58
67
59
68
## Contributing
60
69
61
-
oci-java-sdk is an open source project. See [CONTRIBUTING](/CONTRIBUTING.md) for details.
70
+
oci-java-sdk is an open source project. See [CONTRIBUTING](https://github.com/oracle/oci-java-sdk/blob/master/CONTRIBUTING.md) for details.
62
71
63
72
Oracle gratefully acknowledges the contributions to oci-java-sdk that have been made by the community.
64
73
65
74
## Known Issues
66
75
67
76
You can find information on any known issues with the SDK [here](https://docs.cloud.oracle.com/iaas/Content/knownissues.htm) and under the [“Issues” tab of this GitHub repository](https://github.com/oracle/oci-java-sdk/issues).
68
77
78
+
To learn about known issues with OCI Legacy Java SDK, please refer [Known Issues in OCI Legacy Java SDK](https://github.com/oracle/oci-java-sdk/blob/legacy/v2/master/README.md#known-issues)
79
+
69
80
### Potential data corruption issue with OCI Java SDK on binary data upload with `RefreshableOnNotAuthenticatedProvider`
70
81
71
82
**Details**: When using version 1.25.1 or earlier of the OCI Java SDK clients that upload streams of data (for example `ObjectStorageClient` or `FunctionsInvokeClient`), either synchronously and asynchronously, and you use a `RefreshableOnNotAuthenticatedProvider` (for example, for Resource Principals or Instance Principals) you may be affected by **silent data corruption**.
@@ -90,18 +101,12 @@ Use `ApacheConnectionClosingStrategy.ImmediateClosingStrategy` for large files w
90
101
`ApacheConnectionClosingStrategy.ImmediateClosingStrategy` on the other hand takes longer when using partial read for smaller stream size (< 1MB). Please consider your use-case and change accordingly. For more info please look into : https://github.com/oracle/oci-java-sdk/blob/master/ApacheConnector-README.md.
91
102
92
103
Note : If both the above Apache Connection closing strategies do not give you optimal results for your use-cases, please consider switching back to Jersey Default `HttpUrlConnectorProvider`.
93
-
For more info on Apache Connector, please look into ApacheConnector-README.
94
-
95
-
### OCI Java SDK shows incorrect service details while displaying the logs for BmcException
96
-
97
-
OCI Java SDK displays wrong service details when a BmcException is thrown. For example, exception generated from service A could see information about service B. This behavior can be seen in versions `2.23.0` to `2.34.0` making it thread unsafe. Please update to version `2.35.0`, which has the fix for this issue, or later.
98
-
99
-
You can find information on any known issues with the SDK [here](https://docs.cloud.oracle.com/iaas/Content/knownissues.htm) and under the “Issues” tab of this GitHub repository.
104
+
For more info on Apache Connector, please look into [ApacheConnector-README](https://github.com/oracle/oci-java-sdk/blob/master/ApacheConnector-README.md).
100
105
101
106
## License
102
107
103
108
Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
104
109
This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl
105
110
or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
106
111
107
-
See [LICENSE](/LICENSE.txt) for more details.
112
+
See [LICENSE](https://github.com/oracle/oci-java-sdk/blob/master/LICENSE.txt) for more details.
Copy file name to clipboardExpand all lines: bmc-addons/bmc-apache-configurator-jersey-addon/src/main/java/com/oracle/bmc/http/client/jersey/apacheconfigurator/ApacheConfigurator.java
-8Lines changed: 0 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -81,14 +81,6 @@ public void customizeClient(HttpClientBuilder builder) {
81
81
setApacheConnectorProperties(builder);
82
82
83
83
setSslContext(builder);
84
-
85
-
// TODO: DEX-14784 - do we need the ContentLengthFilter?
86
-
// Required for calls to only allow Apache to set the content-length header.
87
-
// Otherwise, apache will throw an exception if it already exists. For example, such a case
88
-
// includes
89
-
// ObjectStorage where the content-length is explicitly set in the header based on the value
Copy file name to clipboardExpand all lines: bmc-addons/bmc-apache-configurator-jersey3-addon/src/main/java/com/oracle/bmc/http/client/jersey3/apacheconfigurator/ApacheConfigurator.java
-8Lines changed: 0 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -81,14 +81,6 @@ public void customizeClient(HttpClientBuilder builder) {
81
81
setApacheConnectorProperties(builder);
82
82
83
83
setSslContext(builder);
84
-
85
-
// TODO: DEX-14784 - do we need the ContentLengthFilter?
86
-
// Required for calls to only allow Apache to set the content-length header.
87
-
// Otherwise, apache will throw an exception if it already exists. For example, such a case
88
-
// includes
89
-
// ObjectStorage where the content-length is explicitly set in the header based on the value
0 commit comments