Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
### Added
- N/A

## 1.2.22 - 2018-01-25

### Added
- Support for VNC console connections in Compute Service
- Support for using the `ObjectReadWithoutList` public access type when creating and updating buckets
- Support for dynamic groups in Identity Service
- Support for instance principals authentication when calling OCI services, an example can be found on [GitHub](https://github.com/oracle/oci-java-sdk/blob/master/bmc-examples/src/main/java/InstancePrincipalsAuthenticationDetailsProviderExample.java)
- Support for configuring idle timeout for listeners in Load Balancer Service
- Better documentation on every model class on how the change in version [1.2.16 - 2017-10-12](#1216---2017-10-12) to only serialize and transmit fields that were explicitly set to null affects the `equals(Object)` and `hashCode()` methods

## 1.2.21 - 2018-01-11

### Added
Expand Down
3,459 changes: 178 additions & 3,281 deletions Thirdpartyreadme.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bmc-audit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -18,7 +18,7 @@
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
</dependency>
</dependencies>

Expand Down
248 changes: 210 additions & 38 deletions bmc-audit/src/main/java/com/oracle/bmc/audit/AuditAsyncClient.java

Large diffs are not rendered by default.

86 changes: 78 additions & 8 deletions bmc-audit/src/main/java/com/oracle/bmc/audit/AuditClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class AuditClient implements Audit {
@lombok.Getter(value = lombok.AccessLevel.PACKAGE)
private final com.oracle.bmc.http.internal.RestClient client;

private final com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider
authenticationDetailsProvider;

/**
* Creates a new service instance using the given authentication provider.
* @param authenticationDetailsProvider The authentication details provider, required.
Expand Down Expand Up @@ -74,13 +77,24 @@ public AuditClient(
com.oracle.bmc.ClientConfiguration configuration,
com.oracle.bmc.http.ClientConfigurator clientConfigurator,
com.oracle.bmc.http.signing.RequestSignerFactory requestSignerFactory) {
this.authenticationDetailsProvider = authenticationDetailsProvider;
com.oracle.bmc.http.internal.RestClientFactory restClientFactory =
com.oracle.bmc.http.internal.RestClientFactoryBuilder.builder()
.clientConfigurator(clientConfigurator)
.build();
com.oracle.bmc.http.signing.RequestSigner requestSigner =
requestSignerFactory.createRequestSigner(SERVICE, authenticationDetailsProvider);
requestSignerFactory.createRequestSigner(
SERVICE, this.authenticationDetailsProvider);
this.client = restClientFactory.create(requestSigner, configuration);

if (this.authenticationDetailsProvider instanceof com.oracle.bmc.auth.RegionProvider) {
com.oracle.bmc.auth.RegionProvider provider =
(com.oracle.bmc.auth.RegionProvider) this.authenticationDetailsProvider;

if (provider.getRegion() != null) {
this.setRegion(provider.getRegion());
}
}
}

@Override
Expand Down Expand Up @@ -127,8 +141,26 @@ public GetConfigurationResponse getConfiguration(GetConfigurationRequest request
com.google.common.base.Function<javax.ws.rs.core.Response, GetConfigurationResponse>
transformer = GetConfigurationConverter.fromResponse();

javax.ws.rs.core.Response response = client.get(ib, request);
return transformer.apply(response);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) {
try {
javax.ws.rs.core.Response response = client.get(ib, request);
return transformer.apply(response);
} catch (com.oracle.bmc.model.BmcException e) {
if (e.getStatusCode() == 401) {
((com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider)
this.authenticationDetailsProvider)
.refreshSecurityToken();
javax.ws.rs.core.Response response = client.get(ib, request);
return transformer.apply(response);
} else {
throw e;
}
}
} else {
javax.ws.rs.core.Response response = client.get(ib, request);
return transformer.apply(response);
}
}

@Override
Expand All @@ -140,8 +172,26 @@ public ListEventsResponse listEvents(ListEventsRequest request) {
com.google.common.base.Function<javax.ws.rs.core.Response, ListEventsResponse> transformer =
ListEventsConverter.fromResponse();

javax.ws.rs.core.Response response = client.get(ib, request);
return transformer.apply(response);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) {
try {
javax.ws.rs.core.Response response = client.get(ib, request);
return transformer.apply(response);
} catch (com.oracle.bmc.model.BmcException e) {
if (e.getStatusCode() == 401) {
((com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider)
this.authenticationDetailsProvider)
.refreshSecurityToken();
javax.ws.rs.core.Response response = client.get(ib, request);
return transformer.apply(response);
} else {
throw e;
}
}
} else {
javax.ws.rs.core.Response response = client.get(ib, request);
return transformer.apply(response);
}
}

@Override
Expand All @@ -153,8 +203,28 @@ public UpdateConfigurationResponse updateConfiguration(UpdateConfigurationReques
com.google.common.base.Function<javax.ws.rs.core.Response, UpdateConfigurationResponse>
transformer = UpdateConfigurationConverter.fromResponse();

javax.ws.rs.core.Response response =
client.put(ib, request.getUpdateConfigurationDetails(), request);
return transformer.apply(response);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) {
try {
javax.ws.rs.core.Response response =
client.put(ib, request.getUpdateConfigurationDetails(), request);
return transformer.apply(response);
} catch (com.oracle.bmc.model.BmcException e) {
if (e.getStatusCode() == 401) {
((com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider)
this.authenticationDetailsProvider)
.refreshSecurityToken();
javax.ws.rs.core.Response response =
client.put(ib, request.getUpdateConfigurationDetails(), request);
return transformer.apply(response);
} else {
throw e;
}
}
} else {
javax.ws.rs.core.Response response =
client.put(ib, request.getUpdateConfigurationDetails(), request);
return transformer.apply(response);
}
}
}
10 changes: 10 additions & 0 deletions bmc-audit/src/main/java/com/oracle/bmc/audit/model/AuditEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
*/
package com.oracle.bmc.audit.model;

/**
*
* <br/>
* Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly
* set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all
* explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods
* are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not
* set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset
* {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}.
**/
@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918")
@lombok.Value
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = AuditEvent.Builder.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
*/
package com.oracle.bmc.audit.model;

/**
*
* <br/>
* Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly
* set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all
* explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods
* are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not
* set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset
* {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}.
**/
@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918")
@lombok.Value
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = Configuration.Builder.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
*/
package com.oracle.bmc.audit.model;

/**
*
* <br/>
* Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly
* set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all
* explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods
* are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not
* set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset
* {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}.
**/
@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918")
@lombok.Value
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(
Expand Down
16 changes: 8 additions & 8 deletions bmc-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -24,7 +24,7 @@
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<optional>false</optional>
</dependency>

Expand All @@ -33,37 +33,37 @@
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-audit</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-core</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-database</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-identity</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-loadbalancer</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-objectstorage</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<optional>false</optional>
</dependency>
</dependencies>
Expand Down
7 changes: 6 additions & 1 deletion bmc-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk</artifactId>
<version>1.2.21</version>
<version>1.2.22</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -84,6 +84,11 @@
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.9</version>
</dependency>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.9</version>
</dependency>
</dependencies>

</project>
28 changes: 25 additions & 3 deletions bmc-common/src/main/java/com/oracle/bmc/Region.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
@Slf4j
@RequiredArgsConstructor
public enum Region {
US_PHOENIX_1("us-phoenix-1"),
US_ASHBURN_1("us-ashburn-1"),
EU_FRANKFURT_1("eu-frankfurt-1");
US_PHOENIX_1("us-phoenix-1", "phx"),
US_ASHBURN_1("us-ashburn-1", "iad"),
EU_FRANKFURT_1("eu-frankfurt-1", "fra");

private static final Map<String, Map<Region, String>> SERVICE_TO_REGION_ENDPOINTS =
new HashMap<>();
Expand Down Expand Up @@ -55,6 +55,11 @@ public enum Region {
*/
@Getter private final String regionId;

/**
* Get the region code.
*/
@Getter private final String regionCode;

/**
* Resolves a service name to its endpoint in the region, if available.
*
Expand Down Expand Up @@ -111,4 +116,21 @@ public static Region fromRegionId(String regionId) {
}
throw new IllegalArgumentException("Unknown regionId: " + regionId);
}

/**
* Returns the region enum from the public region code. Throws
* IllegalArgumentException if the region code is not known.
*
* @param regionCode
* The region code.
* @return The enum value.
*/
public static Region fromRegionCode(String regionCode) {
for (Region region : Region.values()) {
if (region.regionCode.compareToIgnoreCase(regionCode) == 0) {
return region;
}
}
throw new IllegalArgumentException("Unknown regionId: " + regionCode);
}
}
Loading