Skip to content

Commit d1b2ef5

Browse files
committed
Releasing version 1.2.4 of the Java SDK for Oracle Bare Metal Cloud Services.
1 parent cd6403f commit d1b2ef5

File tree

241 files changed

+7171
-476
lines changed

Some content is hidden

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

241 files changed

+7171
-476
lines changed

.gitignore

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# git
2+
**/.gitignore
3+
**/*.orig
4+
5+
# intellij
16
.idea/
27
*.iml
3-
*/target
8+
9+
# maven
10+
**/target/*
11+
**/*.versionsBackup
12+
13+
# eclipse
14+
**/.settings/*
15+
**/.classpath
16+
**/.project
17+
18+
# mac
19+
**/.DS_Store

CHANGELOG.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
1313
### Added
1414
- N/A
1515

16+
## 1.2.4 - 2017-03-28
17+
### Fixed
18+
- Allow UUID in path elements
19+
- Better validate path parameters before making requests (https://github.com/oracle/bmcs-java-sdk/issues/5)
20+
21+
### Changed
22+
- Simplified classes that perform signing a little
23+
- Move auth caching to an annotation
24+
25+
### Added
26+
- New low level APIs for multi-part upload in Object Storage
27+
- New high level abstractions for uploading (UploadManager, MultipartObjectAssembler) in Object Storage
28+
1629
## 1.2.3 - 2017-03-16
1730
### Fixed
1831
- Allow service responses to deserialize to base classes when unknown discriminators returned (vs. throwing exceptions)
@@ -23,9 +36,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
2336
### Added
2437
- New DNS label feature
2538
- New request signer classes to use directly with other HTTP clients
26-
- New client contructors to allow more control over how requests are signed
39+
- New client constructors to allow more control over how requests are signed
2740

28-
## 1.2.2 - 2016-02-23
41+
## 1.2.2 - 2017-02-23
2942
### Fixed
3043
- Bugs in config file parsing
3144

LICENSE.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Copyright (c) 2016, Oracle and/or its affiliates.  All rights reserved.
1+
Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
22

33
This software is dual-licensed to you under the Universal Permissive License (UPL) and Apache License 2.0.  See below for license terms.  You may choose either license, or both.
44
 ____________________________
55
The Universal Permissive License (UPL), Version 1.0
6-
Copyright (c) 2016, Oracle and/or its affiliates.  All rights reserved.
6+
Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
77

88
Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this software, associated documentation and/or data (collectively the "Software"), free of charge and under any and all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below), to deal in both
99

@@ -19,7 +19,7 @@ The above copyright notice and either this complete permission notice or at a mi
1919
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2020

2121
The Apache Software License, Version 2.0
22-
Copyright (c) 2016, Oracle and/or its affiliates.  All rights reserved.
22+
Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2323

2424
Licensed under the Apache License, Version 2.0 (the "License"); You may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A copy of the license is also reproduced below. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
2525

bmc-audit/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.bmc.sdk</groupId>
77
<artifactId>oracle-bmc-java-sdk</artifactId>
8-
<version>1.2.4-SNAPSHOT</version>
8+
<version>1.2.4</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

@@ -18,7 +18,7 @@
1818
<dependency>
1919
<groupId>com.oracle.bmc.sdk</groupId>
2020
<artifactId>oracle-bmc-java-sdk-common</artifactId>
21-
<version>1.2.4-SNAPSHOT</version>
21+
<version>1.2.4</version>
2222
</dependency>
2323
</dependencies>
2424

bmc-audit/src/main/java/com/oracle/bmc/audit/AuditAsyncClient.java

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public Future<ListEventsResponse> listEvents(
140140
ListEventsRequest request,
141141
AsyncHandler<ListEventsRequest, ListEventsResponse> handler) {
142142
LOG.trace("Called async listEvents");
143+
request = ListEventsConverter.interceptRequest(request);
143144
Invocation.Builder ib = ListEventsConverter.fromRequest(client, request);
144145
Function<Response, ListEventsResponse> transformer = ListEventsConverter.fromResponse();
145146

bmc-audit/src/main/java/com/oracle/bmc/audit/AuditClient.java

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public void close() {
137137
@Override
138138
public ListEventsResponse listEvents(ListEventsRequest request) {
139139
LOG.trace("Called listEvents");
140+
request = ListEventsConverter.interceptRequest(request);
140141
Invocation.Builder ib = ListEventsConverter.fromRequest(client, request);
141142
Function<Response, ListEventsResponse> transformer = ListEventsConverter.fromResponse();
142143

bmc-audit/src/main/java/com/oracle/bmc/audit/internal/http/ListEventsConverter.java

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public class ListEventsConverter {
3030
private static final ResponseConversionFunctionFactory RESPONSE_CONVERSION_FACTORY =
3131
new ResponseConversionFunctionFactory();
3232

33+
public static ListEventsRequest interceptRequest(ListEventsRequest request) {
34+
35+
return request;
36+
}
37+
3338
public static Invocation.Builder fromRequest(RestClient client, ListEventsRequest request) {
3439
if (request == null) {
3540
throw new NullPointerException("request instance is required");
@@ -107,6 +112,7 @@ public ListEventsResponse apply(Response rawResponse) {
107112
}
108113

109114
ListEventsResponse responseWrapper = builder.build();
115+
110116
return responseWrapper;
111117
}
112118
};

bmc-bom/pom.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.oracle.bmc.sdk</groupId>
99
<artifactId>oracle-bmc-java-sdk</artifactId>
10-
<version>1.2.4-SNAPSHOT</version>
10+
<version>1.2.4</version>
1111
<relativePath>../pom.xml</relativePath>
1212
</parent>
1313

@@ -24,7 +24,7 @@
2424
<dependency>
2525
<groupId>com.oracle.bmc.sdk</groupId>
2626
<artifactId>oracle-bmc-java-sdk-common</artifactId>
27-
<version>1.2.4-SNAPSHOT</version>
27+
<version>1.2.4</version>
2828
<optional>false</optional>
2929
</dependency>
3030

@@ -33,25 +33,25 @@
3333
<dependency>
3434
<groupId>com.oracle.bmc.sdk</groupId>
3535
<artifactId>oracle-bmc-java-sdk-audit</artifactId>
36-
<version>1.2.4-SNAPSHOT</version>
36+
<version>1.2.4</version>
3737
<optional>false</optional>
3838
</dependency>
3939
<dependency>
4040
<groupId>com.oracle.bmc.sdk</groupId>
4141
<artifactId>oracle-bmc-java-sdk-core</artifactId>
42-
<version>1.2.4-SNAPSHOT</version>
42+
<version>1.2.4</version>
4343
<optional>false</optional>
4444
</dependency>
4545
<dependency>
4646
<groupId>com.oracle.bmc.sdk</groupId>
4747
<artifactId>oracle-bmc-java-sdk-identity</artifactId>
48-
<version>1.2.4-SNAPSHOT</version>
48+
<version>1.2.4</version>
4949
<optional>false</optional>
5050
</dependency>
5151
<dependency>
5252
<groupId>com.oracle.bmc.sdk</groupId>
5353
<artifactId>oracle-bmc-java-sdk-objectstorage</artifactId>
54-
<version>1.2.4-SNAPSHOT</version>
54+
<version>1.2.4</version>
5555
<optional>false</optional>
5656
</dependency>
5757
</dependencies>

bmc-common/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.bmc.sdk</groupId>
77
<artifactId>oracle-bmc-java-sdk</artifactId>
8-
<version>1.2.4-SNAPSHOT</version>
8+
<version>1.2.4</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

bmc-common/src/main/java/com/oracle/bmc/Services.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static synchronized Service create(
3838
}
3939
throw new IllegalArgumentException(
4040
String.format(
41-
"Cannot redefine service '%s' with with new endpoint prefix '%s', alread set to '%s'",
41+
"Cannot redefine service '%s' with with new endpoint prefix '%s', already set to '%s'",
4242
serviceName,
4343
serviceEndpointPrefix,
4444
existing.getServiceEndpointPrefix()));

bmc-common/src/main/java/com/oracle/bmc/auth/AbstractAuthenticationDetailsProvider.java

+1-8
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,4 @@
77
* Root interface for classes providing some information needed to authenticate
88
* requests.
99
*/
10-
public interface AbstractAuthenticationDetailsProvider {
11-
12-
/**
13-
* Decorator interface to indicate that credentials provided by the
14-
* provider should not be cached and should always be fetched on every request.
15-
*/
16-
interface DisableAuthCaching {}
17-
}
10+
public interface AbstractAuthenticationDetailsProvider {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3+
*/
4+
package com.oracle.bmc.auth;
5+
6+
import java.lang.annotation.ElementType;
7+
import java.lang.annotation.Retention;
8+
import java.lang.annotation.RetentionPolicy;
9+
import java.lang.annotation.Target;
10+
11+
/**
12+
* AuthCachingPolicy provides the ability to annotation basic auth providers with what level
13+
* of caching a request signer should try to follow.
14+
*/
15+
@Target(ElementType.TYPE)
16+
@Retention(RetentionPolicy.RUNTIME)
17+
public @interface AuthCachingPolicy {
18+
/**
19+
* Param to set whether or not keyIds can be cached.
20+
* @return true to enable caching, false if the keyId should be retrieved for every request.
21+
*/
22+
boolean cacheKeyId();
23+
24+
/**
25+
* Param to set whether or not private can be cached.
26+
* @return true to enable caching, false if the private key should be retrieved for every request.
27+
*/
28+
boolean cachePrivateKey();
29+
}

bmc-common/src/main/java/com/oracle/bmc/auth/BasicAuthenticationDetailsProvider.java

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
/**
99
* Base interface used provide required information to sign requests to Oracle Bare Metal Services.
10+
* <p>
11+
* Implementations may choose to provide hints about the cacheability of the keyId and privateKey using
12+
* {@link AuthCachingPolicy} (optional).
1013
*/
1114
public interface BasicAuthenticationDetailsProvider extends AbstractAuthenticationDetailsProvider {
1215
/**

bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClient.java

+11-8
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,17 @@ public Future<Response> get(
129129
*
130130
* @param ib
131131
* An invocation builder to execute requests with.
132+
* @param body
133+
* The content body to post to the web target.
132134
* @param request
133135
* The original client request object given to the service
134136
* client.
135-
* @param body
136-
* The content body to post to the web target.
137137
* @return The {@link Response} object.
138138
* @throws BmcException
139139
* If an error was encountered while invoking the request.
140140
*/
141-
public Response post(@NonNull Invocation.Builder ib, Object body, @NonNull Object request)
141+
public Response post(
142+
@NonNull Invocation.Builder ib, @Nullable Object body, @NonNull Object request)
142143
throws BmcException {
143144
try {
144145
Entity<?> requestBody = this.entityFactory.forPost(request, body);
@@ -171,7 +172,7 @@ public Response post(@NonNull Invocation.Builder ib, Object body, @NonNull Objec
171172
*/
172173
public Future<Response> post(
173174
@NonNull Invocation.Builder ib,
174-
Object body,
175+
@Nullable Object body,
175176
@NonNull Object request,
176177
@Nullable Consumer<Response> onSuccess,
177178
@Nullable Consumer<Throwable> onError) {
@@ -237,7 +238,8 @@ public Future<Response> post(
237238
* @throws BmcException
238239
* If an error was encountered while invoking the request.
239240
*/
240-
public Response patch(@NonNull Invocation.Builder ib, Object body, @NonNull Object request)
241+
public Response patch(
242+
@NonNull Invocation.Builder ib, @Nullable Object body, @NonNull Object request)
241243
throws BmcException {
242244
try {
243245
Entity<?> requestBody = this.entityFactory.forPatch(request, body);
@@ -270,7 +272,7 @@ public Response patch(@NonNull Invocation.Builder ib, Object body, @NonNull Obje
270272
*/
271273
public Future<Response> patch(
272274
@NonNull Invocation.Builder ib,
273-
Object body,
275+
@Nullable Object body,
274276
@NonNull Object request,
275277
@Nullable Consumer<Response> onSuccess,
276278
@Nullable Consumer<Throwable> onError) {
@@ -295,7 +297,8 @@ public Future<Response> patch(
295297
* @throws BmcException
296298
* If an error was encountered while invoking the request.
297299
*/
298-
public Response put(@NonNull Invocation.Builder ib, Object body, @NonNull Object request)
300+
public Response put(
301+
@NonNull Invocation.Builder ib, @Nullable Object body, @NonNull Object request)
299302
throws BmcException {
300303
try {
301304
Entity<?> requestBody = this.entityFactory.forPut(request, body);
@@ -328,7 +331,7 @@ public Response put(@NonNull Invocation.Builder ib, Object body, @NonNull Object
328331
*/
329332
public Future<Response> put(
330333
@NonNull Invocation.Builder ib,
331-
Object body,
334+
@Nullable Object body,
332335
@NonNull Object request,
333336
@Nullable Consumer<Response> onSuccess,
334337
@Nullable Consumer<Throwable> onError) {

bmc-common/src/main/java/com/oracle/bmc/http/signing/SigningStrategy.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public enum SigningStrategy {
3333
*/
3434
private final ImmutableMap<String, List<String>> headersToSign;
3535
/**
36-
* Flag to indicate whether a POST/PUT requests require content-* headers
36+
* Flag to indicate whether a PUT requests require content-* headers
3737
* to be signed.
3838
*/
39-
private final boolean skipContentHeadersForStreamingRequests;
39+
private final boolean skipContentHeadersForStreamingPutRequests;
4040
}

0 commit comments

Comments
 (0)