GithubHelp home page GithubHelp logo

oracle / oci-java-sdk Goto Github PK

View Code? Open in Web Editor NEW
192.0 53.0 153.0 255.47 MB

Oracle Cloud Infrastructure SDK for Java

Home Page: https://cloud.oracle.com/cloud-infrastructure

License: Other

Java 100.00% HTML 0.01%
sdk oracle-cloud

oci-java-sdk's Introduction

Oracle Cloud Infrastructure SDK for Java

ReleasePublished

About

oci-java-sdk provides an SDK for Java that you can use to manage your Oracle Cloud Infrastructure resources.

The project is open source and maintained by Oracle Corp. The home page for the project is here.

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. Please refer README.md to learn more about these legacy versions.

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.

Documentation

Full documentation, including prerequisites, installation, supported JDK versions and configuration instructions, is available here.

API reference can be found here.

Installation

For basic set up, see Getting Started.

For details on compatibility, advanced configurations, and add-ons, see Configuration.

  • Circuit Breaker: By default, circuit breaker feature is enabled, if it is not expected, please explicitly set the environment variable:
export OCI_SDK_DEFAULT_CIRCUITBREAKER_ENABLED=FALSE

Changes Introduced In OCI Java SDK 3.x.y

For full details, look at the changelog for version 3.0.0-beta1.

HTTP client library is pluggable

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.

  • Jakarta EE 8/Jersey 2 - bmc-common-httpclient-jersey

  • Jakarta EE 9/Jersey 3 - bmc-common-httpclient-jersey3

  • 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

  • Example:

      <dependency>
        <!-- Since this is the "application" pom.xml, we do want to
             choose the httpclient to use. -->
        <groupId>com.oracle.oci.sdk</groupId>
        <artifactId>oci-java-sdk-common-httpclient-jersey</artifactId>
      </dependency>
    

Serializer/Deserializer is pluggable

  • The serializer is now pluggable and determined by the HttpProvider. For the Jersey 2 and Jersey 3 HTTP clients, Jackson continues to be used as the serializer
  • As part of the pluggable Serializer changes, when using the Jersey and Jersey 3 HTTP clients, the underlying Jackson ObjectMapper can now be obtained using com.oracle.bmc.serialization.jackson.JacksonSerializer.getDefaultObjectMapper(). The com.oracle.bmc.http.client.Serialization.getObjectMapper() method does not exist anymore.

GraalVM Native Image Build

OCI Java SDK Jersey HTTP client and Jersey 3 Http client are both ready for GraalVM Native Image. See bmc-examples/native-gradle-example and bmc-other-examples/native-maven-example for configuration details for building Native Image executables.

Invocation callbacks

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.

Client configuration has been simplified

com.oracle.bmc.http.ClientConfigurator has a single customizeClient(HttpClientBuilder builder) method, instead of customizeBuilder, customizeClient, and customizeRequest methods. Example:

    IdentityClient.builder()
                  .clientConfigurator(
                          builder -> {
                      builder.property(
                              StandardClientProperties.BUFFER_REQUEST, false);
                  })
                  // ...
                  .build(authenticationDetailsProvider);

Specific client configuration examples

Setting whether to buffer a request
        builder.property(
                StandardClientProperties.BUFFER_REQUEST, shouldBuffer);
Setting an Apache connection manager
        builder.property(
                ApacheClientProperties.CONNECTION_MANAGER,
                connectionManager);
Setting a trust store
        // Server CA goes into the trust store
        KeyStore trustStore =
                keystoreGenerator.createTrustStoreWithServerCa(tlsConfig.getCaBundle());
        builder.property(StandardClientProperties.TRUST_STORE, trustStore);
Setting a key store
        builder.property(
                StandardClientProperties.KEY_STORE,
                new KeyStoreWithPassword(keyStore, keystorePassword));
Setting the SSL context
        builder.property(
                StandardClientProperties.SSL_CONTEXT, sslContext);
Setting a proxy
        builder.property(
                StandardClientProperties.PROXY, proxyConfig);
Setting a hostname verifier
        builder.property(
                StandardClientProperties.HOSTNAME_VERIFIER,
                NoopHostnameVerifier.INSTANCE);

More client configuration examples

Apache Connector changes

There were numerous changes to decouple the implementation from the choice of the HTTP client.

  • 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).
    • For clients that should not buffer requests into memory:

      ObjectStorageClient nonBufferingObjectStorageClient = ObjectStorageClient
          .builder()
          .clientConfigurator(builder -> {
              builder.property(StandardClientProperties.BUFFER_REQUEST, false);
              builder.property(ApacheClientProperties.RETRY_HANDLER, null);
              builder.property(ApacheClientProperties.REUSE_STRATEGY, null);
          })
          .region(Region.US_PHOENIX_1)
          .build(provider);
      
    • For clients that should buffer requests into memory:

      IdentityClient bufferingIdentityClient = IdentityClient
          .builder()
          .clientConfigurator(builder -> {
              builder.property(StandardClientProperties.BUFFER_REQUEST, true);
              builder.property(ApacheClientProperties.RETRY_HANDLER, null);
              builder.property(ApacheClientProperties.REUSE_STRATEGY, null);
          })
          .region(Region.US_PHOENIX_1)
          .build(provider);
      

Circuit breaker changes

  • The circuit breaker interface has been renamed from com.oracle.bmc.circuitbreaker.JaxRsCircuitBreaker to com.oracle.bmc.circuitbreaker.OciCircuitBreaker
  • Instead of using the constructor of com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration, use the builder. The constructor is not public anymore.
  • 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.

Moved classes

  • Class com.oracle.bmc.Options was moved to com.oracle.bmc.http.client.Options
  • Class com.oracle.bmc.http.Serialization was moved to com.oracle.bmc.http.client.Serialization and is available from OCI Java SDK versions 3.0.0 to 3.13.1
  • Class com.oracle.bmc.io.DuplicatableInputStream was moved to com.oracle.bmc.http.client.io.DuplicatableInputStream

Long deprecated code was removed

  • 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.
  • 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.

Removed code

  • The setInstanceMetadataServiceClientConfig method in com.oracle.bmc.Region was removed; it never had any effect.
  • AbstractFederationClientAuthenticationDetailsProviderBuilder.simpleRetry method has been removed without replacement, since it is not needed in the OCI Java SDK 3.0.0 and higher.
  • You can copy and paste the previous implementation if you need it.
  • Starting OCI Java SDK version 3.14.0, class com.oracle.bmc.http.client.Serialization has been removed.

Removed dependencies on the following third-party libraries

  • Guava: Guava types have been replaced with JDK types:
    • com.google.common.base.Optional has been replaced with java.util.Optional
    • com.google.common.base.Function has been replaced with java.util.function.Function
    • com.google.common.base.Predicate has been replaced with java.util.function.Predicate
    • com.google.common.base.Supplier has been replaced with java.util.function.Supplier

Examples

Examples for OCI Java SDK 3.x.y can be found bmc-examples/src/main/java.

Example for Jersey 2 as HTTP client library (OCI Java SDK 3.x.y)

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

Examples for Jersey 2 as HTTP client library can be found in bmc-other-examples/bmc-jersey-examples

Example for Jersey 3 as HTTP client library (OCI Java SDK 3.x.y)

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

Examples for Jersey 3 as HTTP client library can be found in bmc-other-examples/bmc-jersey3-examples

Example for OCI Legacy Java SDK (OCI Java SDK 1.x.y and 2.x.y)

Examples for OCI Legacy Java SDK can be found here.

Help

For details on contributions, questions, or feedback, see Contact Us.

Changes

See CHANGELOG.

Contributing

oci-java-sdk is an open source project. See CONTRIBUTING for details.

Oracle gratefully acknowledges the contributions to oci-java-sdk that have been made by the community.

Known Issues

You can find information on any known issues with the SDK here and under the “Issues” tab of this GitHub repository.

To learn about known issues with OCI Legacy Java SDK, please refer Known Issues in OCI Legacy Java SDK

Potential data corruption issue with OCI Java SDK on binary data upload with RefreshableOnNotAuthenticatedProvider

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.

Workaround: Update the OCI Java SDK client to version 1.25.2 or later. For more information about this issue and workarounds, see Potential data corruption issue for OCI Java SDK on binary data upload with RefreshableOnNotAuthenticatedProvider.

Direct link to this issue: Potential data corruption issue with OCI Java SDK on binary data upload with RefreshableOnNotAuthenticatedProvider

Program hangs for an indefinite time

If the request to the server hangs for an indefinite time and the program gets stuck, it could be because the connection is not released from the Apache connection pool. If you're calling APIs that return a binary/stream response, please make sure to close all the streams returned from the response to release the connections from the connection pool in case of partial reads. 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 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. This can be avoided either by closing the streams or switching back to the Jersey default connector, i.e. HttpUrlConnector. You can find more information about the same in the OCI Java SDK Troubleshooting section.

Performance issues and switching between connection closing strategies with the Apache Connector

The Java SDK supports the Apache Connector as the default. The Apache Connector supports the use of two connection closing strategies - ApacheConnectionClosingStrategy.GracefulClosingStrategy and ApacheConnectionClosingStrategy.ImmediateClosingStrategy. When using ApacheConnectionClosingStrategy.GracefulClosingStrategy, streams returned from response are read till the end of the stream when closing the stream. This can introduce additional time when closing the stream with partial read, depending on how large the remaining stream is. Use ApacheConnectionClosingStrategy.ImmediateClosingStrategy for large files with partial reads instead for faster close. One of the disadvantages of using 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.

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. For more info on Apache Connector, please look into ApacheConnector-README.

Errors may suddenly appear after updating to any of these JDK versions: 8u381, 11.0.20, 17.0.8, and 21.0.0.

The following error message might be encountered:

java.lang.ClassNotFoundException: com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider

This issue is a result of the listed Java versions, which have a default maximum signature file size smaller than some Java SDK JARs.

To resolve this problem, you can run Maven with the following parameter: -Djdk.jar.maxSignatureFileSize=16000000

The low default value in Java will be addressed and resolved in upcoming minor Java version releases.

License

Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

See LICENSE for more details.

oci-java-sdk's People

Contributors

aalmiray avatar andy-miles avatar benthamc avatar brunoborges avatar dshelbyo avatar fzakaria avatar ginoaugustine avatar github-anurag avatar jodoglevy avatar joshunter avatar jotruon avatar juanalblue avatar khs28gu avatar mricken avatar mross22 avatar nathan-vu avatar oci-dex-release-bot avatar omkar07 avatar priteshkp avatar rkumarpa avatar sumitkdey avatar tech-idgraph avatar vidhibhansali avatar viralmodi avatar y-chandra avatar younesamin avatar ziyaoqiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oci-java-sdk's Issues

InstancePrincipalsAuthenticationDetailsProviderExample

I seem to be able to run the other examples fine, however this one throws the below error regarding a time out? If it was a firewall issue, it would seem that the other examples would time out, however they run fine. ie. GetInstancePublicIpExample works fine. Any thoughts would be appreciated
thanks

Exception in thread "main" javax.ws.rs.ProcessingException: java.net.ConnectException: Connection timed out: connect
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:287)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252)
at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:420)
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:316)
at com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider$InstancePrincipalsAuthenticationDetailsProviderBuilder.build(InstancePrincipalsAuthenticationDetailsProvider.java:114)
at InstancePrincipalsAuthenticationDetailsProviderExample.main(InstancePrincipalsAuthenticationDetailsProviderExample.java:22)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:399)
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285)
... 11 more

Include KMS key age/update time to calculate the kms key age

Currently to check the age of KMS key we have to do following things

  1. List vaults -> list keys ->list key version-> get the last rotated key keyversion and calculate the number of days since its rotated

it id overburden and it would be better if keyage or last rotated date is available wen we list the keys instead of listing keys version and finding it out.

Rename packages from bmc => oci

Packages and modules should be renamed from BMC to OCI. Also any documentation referencing BMC.

E.g.

import com.oracle.oci.core.requests.*;

Support for jboss/wildfly/resteasy

We were trying to run OCI SDK client from an app deployed to wildfly 10.1.0, but were having issues with a default client configuration. I suggest to create a specialized resteasy client configurator, similar to ApacheConfigurator. We had to resolve the following two issues:

  1. The request body is being passed as a java.lang.String object to a json provider. This results in the following error:
Caused by: javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request
	at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:287)
	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:436)
	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:195)
	at com.oracle.bmc.http.internal.ForwardingInvocationBuilder.post(ForwardingInvocationBuilder.java:154)
	at com.oracle.bmc.http.internal.RestClient.post(RestClient.java:144)
	... 9 more
Caused by: javax.ws.rs.ProcessingException: RESTEASY003215: could not find writer for content-type application/json type: java.lang.String
	at org.jboss.resteasy.core.interception.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40)
	at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:140)
	at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:119)
	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation.java:370)
	at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:558)
	at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:524)
	at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.loadHttpMethod(ApacheHttpClient4Engine.java:423)
	at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:281)
	... 13 more

the workaround would be to use the following custom provider:

@Provider
@Produces(MediaType.APPLICATION_JSON)
public class RawStringJsonProvider implements MessageBodyWriter<String> {
    @Override
    public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType){
        if (String.class.equals(type) && mediaType.equals(MediaType.APPLICATION_JSON_TYPE)) {
            return true;
        }

        return false;
    }

    @Override
    public long getSize(String s, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
        return 0;
    }

    @Override
    public void writeTo(String s, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
        Writer writer = new PrintWriter(entityStream);
        writer.write(s);
        writer.flush();
        writer.close();
    }
}
  1. A content-length header is being added by AuthnClientFilter, which results in:
Caused by: javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request
	at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:287)
	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:436)
	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:195)
	at com.oracle.bmc.http.internal.ForwardingInvocationBuilder.post(ForwardingInvocationBuilder.java:154)
	at com.oracle.bmc.http.internal.RestClient.post(RestClient.java:144)
	... 75 more
Caused by: org.apache.http.client.ClientProtocolException
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:886)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
	at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:283)
	... 79 more
Caused by: org.apache.http.ProtocolException: Content-Length header already present
	at org.apache.http.protocol.RequestContent.process(RequestContent.java:96)
	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:132)
	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:166)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:485)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
	... 82 more

This can be fixed by either adding another filter which simply removes this header or using ApacheConfigurator like this:

VirtualNetworkClient vcnClient = VirtualNetworkClient.builder().clientConfigurator(new ApacheConfigurator()).build(provider);

invalid part (partNum/etag) combination for the upload

Hi,
I got below exception when I use multiple uploading. The file size is about 1G, and per part is 15M.
Do anyone know what error might cause this exception? Any clue is appreciated! Thanks for your help!

com.oracle.bmc.model.BmcException: (400, InvalidUploadPart, false) There were some invalid part (partNum/etag) combination for the upload UploadKey{objectKey=ObjectKey{bucket=BucketKey{namespace='intnosql', name='kvmtd-backups', api='Api{version='v2'}', bucketId='BucketId{id=HUgMO4SmQy/CzSqFKtHe63-intn-kvmt}'}, name='/andc/backups/DStore1/rg13/rn2/18122108/00004e15.jdb'}, uploadId='19fd43c7-ad01-0112-6771-3db929e83164'} (opc-request-id: 4ed0c768-c137-b3f3-be98-c2181e0afd56)
        at com.oracle.bmc.http.internal.ResponseHelper.throwIfNotSuccessful(ResponseHelper.java:92)
        at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:86)
        at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:82)
        at com.oracle.bmc.objectstorage.internal.http.CommitMultipartUploadConverter$1.apply(CommitMultipartUploadConverter.java:95)
        at com.oracle.bmc.objectstorage.internal.http.CommitMultipartUploadConverter$1.apply(CommitMultipartUploadConverter.java:83)
        at com.oracle.bmc.objectstorage.ObjectStorageClient.commitMultipartUpload(ObjectStorageClient.java:337)

Make IdentityClient APIs open to all region

we can get the list of subscribed region using listRegionSubscriptions in identityclient.
but if the home region is unknown and we set identityClient.setRegion(Region.US_PHOENIX_1) and the tenant is not subcribed to US_PHOENIX_1 region then we would get 401 error. If there is any better way to get the home region/any other way to query subscribed region/list compartments it would be more benificial

Can't specify hostname in CreateListenerDetails

Example in the help shows how to specify hostname for load balancer's listener. But this option is not available in SDK.

https://docs.us-phoenix-1.oraclecloud.com/api/#/en/loadbalancer/20170115/requests/CreateListenerDetails

Is the example misleading or is it missing in the SDK (1.2.28)?

{ "defaultBackendSetName": "example_backend_set", "port": 80, "protocol": "HTTP", "hostname": "app.example.com", "pathRouteSetName": "example_path_route_set", "sslConfiguration": { "certificateName": "example_certificate_bundle", "verifyPeerCertificate": true, "verifyDepth": 3 }, "connectionConfiguration": { "idleTimeout": 1200 }, "name": "example_listener" }

Thanks

Support for Jersey 2.27

Currently oci-java-sdk uses Jersey version 2.24.1 which doesn't work with classes compiled with target Java version 10. In this case Jersey should be upgraded to 2.27 (https://github.com/jersey/jersey/issues/3799).

Unfortunately in Jersey 2.26 they made incompatible changes so simply using new Jersey version with oci-java-sdk doesn't work well. The problem is that they "moved" JacksonJaxbJsonProvider class which breaks code in RestClientFactory:

private static final JacksonJsonProvider JACKSON_JSON_PROVIDER =
new JacksonJaxbJsonProvider(
DEFAULT_MAPPER, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);

Client client =
builder.build()
.register(JACKSON_JSON_PROVIDER)

I described this Jersey problem and solution on Stack Overflow.

Could you please make oci-java-sdk work with Jackson Jersey 2.27?

Exception in getNamespace api

Hi I am trying to use the getNamespace api and i am getting the error using it, Can you please look into this and guide if i am using the api in right way?

final String namespace =
objectStorageClient.getNamespace(GetNamespaceRequest.builder().build()).getValue();

Exception details:
javax.ws.rs.ProcessingException: RESTEASY003145: Unable to find a MessageBodyReader of content-type application/json and type class java.lang.String

SDK rejects responses that carry charset utf8 in content-type header

We've noticed this when hitting an api endpoint. We get exceptions wrapped in a Unexpected Content-Type message because a particular OCI api returns a content type of application/json;charset=utf-8.

We see in ResponseHelper#throwIfNotSuccessful that it does a simple equals call and doesn't anticipate charset being explicitly defined as utf-8 which is already the assumption.

I'd like to suggest that the media type be compared using the isCompatible() field and if the charset parameter is set, then it must be utf-8. This would keep the assumptions the same and allow the api responses to be correctly handled.

I can submit a PR for this.

Newly introduced region in OCI stipulates usage of newer version of oci-java-sdk client

There was recently added a new region "ca-toronto-1" in OCI.

Until now we used the OCI client version 1.2.49.
While the data class

was able to accommodate the new region "ca-toronto-1" (as it is a simple wrapper for returned JSON) the API that requires the region to be specified as a parameter, e. g.:
public void setRegion(com.oracle.bmc.Region region) {


depends on existence of the enum value
CA_TORONTO_1("ca-toronto-1", Realm.OC1),
. But this enum value was not available for 1.2.49.

It is really weird that introduction of a new region in OCI requires an update of an OCI client to newer version.

You can probably imagine that in a corporate environments it is not a simple task to update the used library version. It may go through a legal approval process and can really take quite long time (or it can be even impossible to upgrade the OCI client). But anyway customers want to use the resources in newly introduced region.

Would it be possible that you introduce also an API that would not be dependent on Region enum, but rather only on String?

Thank you,
Jachym

Using a non-default profile results in "java.lang.IllegalStateException: No DEFAULT profile was specified in the configuration"

I am trying to use a custom profile in the config file e.g.

[my-profile]
user=foo
fingerprint=bar
key_file=oci_api_key.pem
tenancy=foor
region=us-phoenix-1
pass_phrase=bar

Trying to parse it using

ConfigFileReader.parse(in, "my-profile"); //in is an InputStream

But I end up getting java.lang.IllegalStateException: No DEFAULT profile was specified in the configuration

Is it not possible to use a non-default profile as the ONLY profile in the config ?

Error while using shaded artifact in release 1.3.7

I followed the steps documented here - https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/javasdkexamples.htm for using shaded jar.
Regular jar works fine as described, but I am having problems with shaded version.

This is exact command
java -cp examples:shaded/lib/oci-java-sdk-full-shaded-1.3.7.jar:shaded/third-party/lib/* ObjectStorageSyncExample

Output -

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.NoClassDefFoundError: shaded/com/oracle/oci/javasdk/org/glassfish/jersey/client/spi/ConnectorProvider
	at com.oracle.bmc.http.internal.RestClientFactoryBuilder.<clinit>(RestClientFactoryBuilder.java:24)
	at com.oracle.bmc.objectstorage.ObjectStorageClient.<init>(ObjectStorageClient.java:178)
	at com.oracle.bmc.objectstorage.ObjectStorageClient.<init>(ObjectStorageClient.java:141)
	at com.oracle.bmc.objectstorage.ObjectStorageClient.<init>(ObjectStorageClient.java:113)
	at com.oracle.bmc.objectstorage.ObjectStorageClient.<init>(ObjectStorageClient.java:88)
	at com.oracle.bmc.objectstorage.ObjectStorageClient.<init>(ObjectStorageClient.java:65)
	at com.oracle.bmc.objectstorage.ObjectStorageClient.<init>(ObjectStorageClient.java:51)
	at com.oracle.bmc.objectstorage.ObjectStorageClient.<init>(ObjectStorageClient.java:40)
	at ObjectStorageSyncExample.main(ObjectStorageSyncExample.java:26)
Caused by: java.lang.ClassNotFoundException: shaded.com.oracle.oci.javasdk.org.glassfish.jersey.client.spi.ConnectorProvider
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 9 more```

Check if Wercker works for CI/CD

Hi all,

While we have Travis working for this project, can someone investigate if Wercker can be used as well? And if yes, then we move forward to switch?

CreateInstanceExample fails with BmcException

Attempting to run the CreateInstanceExample.java example with version 1.5.2 results in

Caused by: com.oracle.bmc.model.BmcException: (400, InvalidParameter, false) routeRules[0].networkEntityId may not be null (opc-request-id: 25744B636...)
        at com.oracle.bmc.http.internal.ResponseHelper.throwIfNotSuccessful(ResponseHelper.java:120)
        at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:86)
        at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:82)
        at com.oracle.bmc.core.internal.http.UpdateRouteTableConverter$1.apply(UpdateRouteTableConverter.java:70)
        at com.oracle.bmc.core.internal.http.UpdateRouteTableConverter$1.apply(UpdateRouteTableConverter.java:55)
        at com.oracle.bmc.core.VirtualNetworkClient.updateRouteTable(VirtualNetworkClient.java:3325)

bmc-objectstorage: Is there a way to upload large file, when inputstream doesn't support read in parallel.

Just want to know the reason behind the code:
In StreamChunkCreator.java, canDuplicate is set to true only when uploadmanager sets isAllowParallelUploads to true.
If canDuplicate is set to false, then DuplicatedSubRangeInputStream is not created in StreamChunkCreator->next function.
This creates a headache for me to upload a large file, my inputstream doesn't support read in parallel, thus I can't set allowparalleluploads in uploadmanager.
then likely, I'll get Out-of-memory exception during the upload process.

Database Example

Are there any examples of creating a database instance using the java api? I see a compute node, but not database

Error message from Java SDK is misleading

Tag map accepts <String, Object>:

com.oracle.bmc.core.model.LaunchInstanceDetails.Builder#definedTags(
                java.util.Map<String, java.util.Map<String, Object>> definedTags)

I passed 1 tag value as an integer and got:
com.oracle.bmc.model.BmcException: (404, NotAuthorizedOrNotFound, false) Authorization failed or requested resource not found.
Changed value to String - works fine...

Issue: the message is completely misleading, it took a time to find what was the reason for the issue.

P.S.: "NotAuthorizedOrNotFound" is not good as well - better to have them separate: "NotAuthorized" and "NotFound".

More details about exception:

com.oracle.bmc.model.BmcException: (404, NotAuthorizedOrNotFound, false) Authorization failed or requested resource not found. (opc-request-id: 5913A750FC354B8FB23E19B0CE5C0B1C/2096C162CA9B27B6846C72E16289F895/DFB7CCCE5538D47AADC5A07D3A8CCBAA)
	at com.oracle.bmc.http.internal.ResponseHelper.throwIfNotSuccessful(ResponseHelper.java:92)
	at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:86)
	at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:82)
	at com.oracle.bmc.core.internal.http.LaunchInstanceConverter$1.apply(LaunchInstanceConverter.java:59)
	at com.oracle.bmc.core.internal.http.LaunchInstanceConverter$1.apply(LaunchInstanceConverter.java:47)
	at com.oracle.bmc.core.ComputeClient.launchInstance(ComputeClient.java:916)

Used version: oci-java-sdk-full-1.2.35.jar

Detach Volume (Block Volume) has no way to specify Compartment Id

DetachVolumeRequest made to ComputeClient returns 404 resource not found because there is no way to specify the Compartment Id.
DetachVolumeRequest detachRequest = DetachVolumeRequest.builder().volumeAttachmentId(volumeId).build();
DetachVolumeResponse detachResponse = computeClient.detachVolume(detachRequest);

There is no DetachVolumeDetails in the API Docs
https://docs.cloud.oracle.com/iaas/tools/java/latest/index.html?com/oracle/bmc/core/responses/DetachVolumeResponse.html

UploadManager.upload throw java.io.IOException: too many bytes written

Hi,
I use UploadManager to upload file to objectstorage. The to be uploaded file may be appended more content meanwhile. I get below exception sometimes. I'm using OCI 1.2.41 JAVA SDK. Thanks for your help!

StackTrace:
com.oracle.bmc.model.BmcException: (-1, null, false) Processing exception while communicating to: https://objectstorage.us-ashburn-1.oraclecloud.com (outbound opc-request-id: B25D26E08AF64A49806539373307FDE0)
at com.oracle.bmc.http.internal.RestClient.convertToBmcException(RestClient.java:537)
at com.oracle.bmc.http.internal.RestClient.put(RestClient.java:354)
at com.oracle.bmc.objectstorage.ObjectStorageClient.putObject(ObjectStorageClient.java:829)
at com.oracle.bmc.objectstorage.transfer.internal.SimpleRetry$1.apply(SimpleRetry.java:34)
at com.oracle.bmc.objectstorage.transfer.internal.SimpleRetry$1.apply(SimpleRetry.java:26)
at com.oracle.bmc.objectstorage.transfer.UploadManager.singleUpload(UploadManager.java:96)
at com.oracle.bmc.objectstorage.transfer.UploadManager.upload(UploadManager.java:73)
....
Caused by: javax.ws.rs.ProcessingException: java.io.IOException: too many bytes written
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:287)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437)
at org.glassfish.jersey.client.JerseyInvocation$Builder.put(JerseyInvocation.java:326)
at com.oracle.bmc.http.internal.ForwardingInvocationBuilder.put(ForwardingInvocationBuilder.java:134)
at com.oracle.bmc.http.internal.RestClient.put(RestClient.java:351)
... 20 more
Caused by: java.io.IOException: too many bytes written
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3523)
at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:229)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:299)
at org.glassfish.jersey.message.internal.ReaderWriter.writeTo(ReaderWriter.java:116)
at org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider.writeTo(AbstractMessageReaderWriterProvider.java:79)
at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:105)
at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:60)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
at org.glassfish.jersey.client.ClientRequest.doWriteEntity(ClientRequest.java:517)
at org.glassfish.jersey.client.ClientRequest.writeEntity(ClientRequest.java:499)
at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:393)
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285)
... 32 more

Cannot overwrite files with PutObjectRequest

When pushing the same filename putObjectRequestFails on error (which seems wrong anyway):
com.oracle.bmc.model.BmcException: (404, BucketNotFound, false) Either the bucket named 'MY_FILE_NAME' does not exist in the namespace 'MY_NAME_SPACE' or you are not authorized to access it (opc-request-id: XYZ)

It does not allow to overwrite files in cloud:

PutObjectRequest request =
				PutObjectRequest.builder()
								.bucketName(bucketSetName)
								.namespaceName(namespaceName)
								.objectName(objectName)
								.contentType(contentType)
								.contentLength(file.length())
								.contentLanguage(contentLanguage)
								.contentEncoding(contentEncoding)
								.opcMeta(metadata)
								.build();

UploadManager.UploadRequest uploadDetails =
				UploadManager.UploadRequest.builder(file).allowOverwrite(true).build(request);
UploadManager.UploadResponse response = manager.upload(uploadDetails);

Incorrect/unclear Error Message

If passing an empty userID string to -

GetUserResponse user = identityService.getUser(GetUserRequest.builder().userId(event.getPrincipalId()).build());

The error message is

Exception in thread "main" com.oracle.bmc.model.BmcException: (400, InvalidParameter, false) Invalid parameter 'compartmentId' (opc-request-id: AC33DA26DDE6430ABC88BBF04DE73E3B/37632E5CB5C4465EA6C33DE3512F033A/6532C2AE95E44D74B7DD08166D755E0A)
at com.oracle.bmc.http.internal.ResponseHelper.throwIfNotSuccessful(ResponseHelper.java:91)
at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:87)
at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:83)
at com.oracle.bmc.identity.internal.http.GetUserConverter$1.apply(GetUserConverter.java:64)
at com.oracle.bmc.identity.internal.http.GetUserConverter$1.apply(GetUserConverter.java:57)
at com.oracle.bmc.identity.IdentityClient.getUser(IdentityClient.java:293)
at ListAuditEventsSinceDate.main(ListAuditEventsSinceDate.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

Creating Policy immediately after compartment creation fails unexpectedly

Using OCI Java SDK, it looks like there is a race condition that causes policy creation to fail if run immediately after compartment creation.

Context: We are creating an automated provisioning scenario that creates a compartment, groups, and policies.

A simple repro can be done by creating any policy via CreatePolicyRequest that references a compartment that has been created just before.

Adding as short as a 5s delay will allow subsequent CreatePolicyRequest to run successfully. However we have no way to programatically get feedback on the accessibility of the compartment. All we have is lifecycleState (which always shows as "Active") and a constantly null "is-accessible".

Solution would be to either expose compartment availability via the CreateCompartmentResponse or do not return the CreateCompartmentResponse until the compartment has fully been provisioned and can be used without issue.

Need List subscribed compartment API

Hi ,
we have different compartments available in the OCI, and if we want to list events we have to set the compartmentID. listCompartments will list out all the compartments and if some compartment has policy restriction we get 404 error. So can we have and api to list the compartments for which user has access just like list subscribed region?

Timeouts while connecting to Object Storage

I am getting timeouts when I try to use the ObjectStorageClient and ObjectStorageAsyncClient clients. I do not see timeouts for the other services - only ObjectStorage. I see this problem is my code and in the examples ObjectStorageGetBucketExample and ObjectStorageAsyncExample.

To be clear i have no problem using IdentityAsyncClient ComputeAsyncClient VirtualNetworkAsyncClient or DatabaseAsyncClient. I can work with them with no issues so I do not think it is a network / proxy issue.

The (partial) dump from ObjectStorageGetBucketExample

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Getting the namespace. Exception in thread "main" com.oracle.bmc.model.BmcException: (-1, null, true) Timed out while communicating to: https://objectstorage.us-phoenix-1.oraclecloud.com (outbound opc-request-id: 4894BB1B5DB14613BD10C8AF25088AF3) at com.oracle.bmc.http.internal.RestClient.convertToBmcException(RestClient.java:539) at com.oracle.bmc.http.internal.RestClient.get(RestClient.java:101)

Unrecognized field "id" (AvailabilityDomain) with oci-java-sdk-full-shaded-1.2.44.jar

I accidentally replace oci-java-sdk-full-1.2.44.jar to the shadded jar oci-java-sdk-full-shaded-1.2.44.jar in the classpath and got the following exception. The call on IdentityClient.listAvailabilityDomains is from Spinnaker/clouddriver-oracle.

javax.ws.rs.ProcessingException: Error reading entity from input stream.
at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:889) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:834) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:368) ~[jersey-client-2.25.1.jar:na]
at org.glassfish.jersey.client.InboundJaxrsResponse$2.call(InboundJaxrsResponse.java:126) ~[jersey-client-2.25.1.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:228) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:419) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:267) ~[jersey-client-2.25.1.jar:na]
at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:123) ~[jersey-client-2.25.1.jar:na]
at com.oracle.bmc.http.internal.ResponseHelper.readEntity(ResponseHelper.java:128) ~[oci-java-sdk-full-shaded-1.2.44.jar:na]
at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ParseGenericResponseWithHeadersFunction.doApply(ResponseConversionFunctionFactory.java:69) ~[oci-java-sdk-full-shaded-1.2.44.jar:na]
at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ParseGenericResponseWithHeadersFunction.doApply(ResponseConversionFunctionFactory.java:62) ~[oci-java-sdk-full-shaded-1.2.44.jar:na]
at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:87) ~[oci-java-sdk-full-shaded-1.2.44.jar:na]
at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:82) ~[oci-java-sdk-full-shaded-1.2.44.jar:na]
at com.oracle.bmc.identity.internal.http.ListAvailabilityDomainsConverter$1.apply(ListAvailabilityDomainsConverter.java:71) ~[oci-java-sdk-full-shaded-1.2.44.jar:na]
at com.oracle.bmc.identity.internal.http.ListAvailabilityDomainsConverter$1.apply(ListAvailabilityDomainsConverter.java:53) ~[oci-java-sdk-full-shaded-1.2.44.jar:na]
at com.oracle.bmc.identity.IdentityClient.listAvailabilityDomains(IdentityClient.java:1349) ~[oci-java-sdk-full-shaded-1.2.44.jar:na]
...
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "id" (class com.oracle.bmc.identity.model.AvailabilityDomain), not marked as ignorable (3 known properties: "explicitlySet", "name", "compartmentId"])
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 5, column: 2] (through reference chain: java.util.ArrayList[0]->com.oracle.bmc.identity.model.AvailabilityDomain["id"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:60) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:822) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1152) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1567) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperties(BeanDeserializerBase.java:1521) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:437) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1265) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:325) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:285) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1571) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:965) ~[jackson-databind-2.9.2.jar:2.9.2]
at com.fasterxml.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:815) ~[jackson-jaxrs-base-2.9.2.jar:2.9.2]
at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.invokeReadFrom(ReaderInterceptorExecutor.java:256) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:235) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1085) ~[jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:874) ~[jersey-common-2.25.1.jar:na]
... 174 common frames omitted

AuditClient events size

Is possible to know the events size that will be returned per page via AuditClient service without actually consuming the events ?

PAR generating error

The timeExpire parameter in ObjectStorageClient.createPreauthenticatedRequest is Date type, it's pretty safe. When it comes to JSON handling it should NOT have number or string error, but it has. Something went wrong?


Caused by: com.oracle.bmc.model.BmcException: (400, InvalidJSON, false) PAR expiration in request body JSON must be of type number, but is STRING (opc-request-id: 2d2962fa-be55-07cd-889d-4ad131c1dab8)
at com.oracle.bmc.http.internal.ResponseHelper.throwIfNotSuccessful(ResponseHelper.java:91)
at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:87)
at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:83)
at com.oracle.bmc.objectstorage.internal.http.CreatePreauthenticatedRequestConverter$1.apply(CreatePreauthenticatedRequestConverter.java:88)
at com.oracle.bmc.objectstorage.internal.http.CreatePreauthenticatedRequestConverter$1.apply(CreatePreauthenticatedRequestConverter.java:79)
at com.oracle.bmc.objectstorage.ObjectStorageClient.createPreauthenticatedRequest(ObjectStorageClient.java:197)

Shaded artifact POM and Jersey Client

Hi,

do you plan to publish pom.xml of shaded artifact? We'd like to include Jersey-Client into shaded JAR because of possible conflict with Weblogic's internal Jersey-Client 1.x.

Thanks.

Empty compartment id in audit events

Hi, we are getting null or no entry in some of the create events from Audit event's service.
can you please explain why?
Plus, What is the event source = CorePublicServiceAPI ? We are getting it in create VCN event log.

Getting error The Content-Length header is required while uploading few files to Object Store

I am using oci-sdk version 1.3.2 to upload a few files to Object Store.
After uploading 2 files successfully the third upload fails with below error

com.oracle.bmc.model.BmcException: (411, ContentLengthRequired, false) The Content-Length header is required (opc-request-id:

I have tried setting contentLength but it still results in same error.

Here is the code I am using:

    UploadConfiguration uploadConfiguration = UploadConfiguration.builder()
                    .allowMultipartUploads(true)
                    .allowParallelUploads(true)
                    .build();

    UploadManager uploadManager = new UploadManager(client, uploadConfiguration);

    PutObjectRequest request =
            PutObjectRequest.builder()
                    .namespaceName(namespaceName)
                    .bucketName(bucketName)
                    .objectName(objectName)
                    .contentType(null)
                    .contentLanguage(null)
                    .contentEncoding(null)
                    .opcMeta(null)
                    .build();

    UploadManager.UploadRequest uploadDetails =
            UploadManager.UploadRequest.builder(file).allowOverwrite(true).build(request);

    UploadManager.UploadResponse response = uploadManager.upload(uploadDetails);

Maven release

As a user of the oci-java-sdk, I need the SDK to be available via Maven. This issue is to track the release of the SDK to Maven.

Releases does not include pom.xml file

Hey,

I'm trying to publish the Github release into my internal maven repository. The client's dependencies does not resolve since the Jar does not contain pom.xml. As a workaround I'm using the shaded version.

Can you please include pom.xml in your next release?

Thanks :)

Looking for all the IPs within a VCN

I see where if you have an instanceId within a compartment, that it is easy to obtain the IP address, there is an example of GetInstancePublicIpExample. However, what if you want to interrogate the entire VCN and pull back all the compute nodes without an instanceId, i have not found within the API where this is possible?

Unable to fetch the Event Location via Audit Event

Hi,
I have been using AuditEvent to fetch the IP of the event to locate from where the event was generated, I have been using getRequestOrigin() to get the IP. but i am getting the private IP instead of real IP. so i am unable to locate the event location.
Can you please suggest the way how can i get the real IP for monitoring the event location.

Sample Audit Event Log below.

{"log":"AuditEvent(tenantId=ocid1.tenancy.oc1..aaaaaaaaepmjkbko4fybhvt6wrakf7gw6ssjflkdkxnsxohysd3ymlzxdzoq, compartmentId=ocid1.tenancy.oc1..aaaaaaaaepmjkbko4fybhvt6wrakf7gw6ssjflkdkxnsxohysd3ymlzxdzoq, eventId=bc41c9fe-eb6d-4494-ad54-975c703d23bf, eventSource=IdentityProvisioning, eventType=ServiceApi, eventTime=Tue Mar 27 15:33:35 IST 2018, principalId=ocid1.user.oc1..aaaaaaaag5fwyrkaazc2ktjmqe7xkmgjxy2wnw2hdytweyym7fzo73m47q3a, credentialId=ST$eyJraWQiOiJhc3ciLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJvY2lkMS51c2VyLm9jMS4uYWFhYWFhYWFnNWZ3eXJrYWF6YzJrdGptcWU3eGttZ2p4eTJ3bncyaGR5dHdleXltN2Z6bzczbTQ3cTNhIiwiYXVkIjoib2NpIiwicHN0eXBlIjoibmF0diIsInR0eXBlIjoibG9naW4iLCJpc3MiOiJhdXRoU2VydmljZS5vcmFjbGUuY29tIiwicHR5cGUiOiJ1c2VyIiwic2Vzc19leHAiOiJXZWQsIDI4IE1hciAyMDE4IDA5OjUwOjQ2IFVUQyIsImV4cCI6MTUyMjE0Nzg0NiwiaWF0IjoxNTIyMTQ0MjQ2LCJqdGkiOiI4OGU4NmQ4MC05MjJjLTQ4MjQtYTk1Yi05NjUwZGYxMmQ2OWQiLCJ0ZW5hbnQiOiJvY2lkMS50ZW5hbmN5Lm9jMS4uYWFhYWFhYWFlcG1qa2JrbzRmeWJodnQ2d3Jha2Y3Z3c2c3NqZmxrZGt4bnN4b2h5c2QzeW1senhkem9xIiwiandrIjoie1wiYWxnXCI6XCJSUzI1NlwiLFwiZVwiOlwiQVFBQlwiLFwiZXh0XCI6dHJ1ZSxcImtleV9vcHNcIjpbXCJ2ZXJpZnlcIl0sXCJrdHlcIjpcIlJTQVwiLFwiblwiOlwidk1PRVNYNlVDY0RtVkJVV2xEQncwMWxnY25yaXpDWDdXT0VTNFBVM0ktX29uZDBPcDBGYk9UZlF5Y1FzdFFubDhNS25idGVRWGhuazAxWFFiZFcwa3pCaVhWNk9hMjI1WFUtZ0tuSjZncGg4UGZCWWxnN2RjVm1TaWQ1Z3h4VTFRSWpXN3lJeHNWa1BMUmhFaWdsSnlEVXNLSGVCRGhOWWdSbGVGalFIWjBkQXJVSmNuTC04cW1fYXdFQ2N3VWxtWnloaDF1R0dCSUJvWjRQNXhtUDJsdnFBaWJKU003ZTNfdzhSMHFDNTgxN2NIZjNNX0dHWUVGMGZXeG5tMV9HdzlUbjZUSFlYZERLb042b2pBb3MyWVVYYUxaeU5PREZpeE5UUUNSczc5cmlkTk9uRk5HbzRHZl9EWmlFTF81Y1NHUWNqMVdQX3psRFJQdUZVeHNvNDdRXCIsXCJraWRcIjpcInB1YmtleS1kNzA1OTcyMi02NmE4LTQzNTEtOGJkZi0zNTllZGExMTA2NDZcIn0ifQ.gLKoL_GTpJAh5JUAIX4lRny2kTQrDbWlETfZCPfPd76EUJsBFm_cBJ-LSD1oEHzBjzbDOB03Ur2nawjKZ72H1uqVPlksA3G3zixbAAZKYsdc6nqqJczQGZJSWWPipmuwrCL1JkZexjmlezzl-HnOoohOK2uYjmuHQpb3Oc5_b-AIJqQsECmuJj8lMO4cLD9hRSYw_NQql7b2kgXiD_BvGESSeAbPiyJpklADvAk12ABTg1YNdYbz_BB17GW4I5zfYTq9Goi4dlHdwkg1HrapgJbdgtxR1s9aSL8fYqYkN94jJxGx6ZQATc5txqSaoRZdKWHpfjDHi8VBmkLonPIAoA, requestAction=POST, requestId=0f4a8fdf-e959-4c05-825b-2016113c/3DE1CC59F187BBC76AF2EF804EFC4E3A/5046B7C959C3A745C9ADCDC12B2CCBCC, requestAgent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36, requestHeaders={Origin=[https://console.us-phoenix-1.oraclecloud.com], X-Content-Sha256=[+6zogZfaGXzopwA5oK09aB0hklN/7dUNn1Jeb9hfdAA=], Accept=[/], X-Date=[Tue, 27 Mar 2018 10:03:35 GMT], X-Forwarded-Proto=[https], X-Forwarded-Host=[identity.us-phoenix-1.oraclecloud.com:443], User-Agent=[Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36], Referer=[https://console.us-phoenix-1.oraclecloud.com/a/identity/users], Accept-Encoding=[gzip, deflate, br], X-Forwarded-Port=[443], Authorization=[Signature keyId="ST$eyJraWQiOiJhc3ciLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJvY2lkMS51c2VyLm9jMS4uYWFhYWFhYWFnNWZ3eXJrYWF6YzJrdGptcWU3eGttZ2p4eTJ3bncyaGR5dHdleXltN2Z6bzczbTQ3cTNhIiwiYXVkIjoib2NpIiwicHN0eXBlIjoibmF0diIsInR0eXBlIjoibG9naW4iLCJpc3MiOiJhdXRoU2VydmljZS5vcmFjbGUuY29tIiwicHR5cGUiOiJ1c2VyIiwic2Vzc19leHAiOiJXZWQsIDI4IE1hciAyMDE4IDA5OjUwOjQ2IFVUQyIsImV4cCI6MTUyMjE0Nzg0NiwiaWF0IjoxNTIyMTQ0MjQ2LCJqdGkiOiI4OGU4NmQ4MC05MjJjLTQ4MjQtYTk1Yi05NjUwZGYxMmQ2OWQiLCJ0ZW5hbnQiOiJvY2lkMS50ZW5hbmN5Lm9jMS4uYWFhYWFhYWFlcG1qa2JrbzRmeWJodnQ2d3Jha2Y3Z3c2c3NqZmxrZGt4bnN4b2h5c2QzeW1senhkem9xIiwiandrIjoie1wiYWxnXCI6XCJSUzI1NlwiLFwiZVwiOlwiQVFBQlwiLFwiZXh0XCI6dHJ1ZSxcImtleV9vcHNcIjpbXCJ2ZXJpZnlcIl0sXCJrdHlcIjpcIlJTQVwiLFwiblwiOlwidk1PRVNYNlVDY0RtVkJVV2xEQncwMWxnY25yaXpDWDdXT0VTNFBVM0ktX29uZDBPcDBGYk9UZlF5Y1FzdFFubDhNS25idGVRWGhuazAxWFFiZFcwa3pCaVhWNk9hMjI1WFUtZ0tuSjZncGg4UGZCWWxnN2RjVm1TaWQ1Z3h4VTFRSWpXN3lJeHNWa1BMUmhFaWdsSnlEVXNLSGVCRGhOWWdSbGVGalFIWjBkQXJVSmNuTC04cW1fYXdFQ2N3VWxtWnloaDF1R0dCSUJvWjRQNXhtUDJsdnFBaWJKU003ZTNfdzhSMHFDNTgxN2NIZjNNX0dHWUVGMGZXeG5tMV9HdzlUbjZUSFlYZERLb042b2pBb3MyWVVYYUxaeU5PREZpeE5UUUNSczc5cmlkTk9uRk5HbzRHZl9EWmlFTF81Y1NHUWNqMVdQX3psRFJQdUZVeHNvNDdRXCIsXCJraWRcIjpcInB1YmtleS1kNzA1OTcyMi02NmE4LTQzNTEtOGJkZi0zNTllZGExMTA2NDZcIn0ifQ.gLKoL_GTpJAh5JUAIX4lRny2kTQrDbWlETfZCPfPd76EUJsBFm_cBJ-LSD1oEHzBjzbDOB03Ur2nawjKZ72H1uqVPlksA3G3zixbAAZKYsdc6nqqJczQGZJSWWPipmuwrCL1JkZexjmlezzl-HnOoohOK2uYjmuHQpb3Oc5_b-AIJqQsECmuJj8lMO4cLD9hRSYw_NQql7b2kgXiD_BvGESSeAbPiyJpklADvAk12ABTg1YNdYbz_BB17GW4I5zfYTq9Goi4dlHdwkg1HrapgJbdgtxR1s9aSL8fYqYkN94jJxGx6ZQATc5txqSaoRZdKWHpfjDHi8VBmkLonPIAoA",version="1",algorithm="rsa-sha256",headers="(request-target) host content-length opc-client-info x-date opc-request-id content-type x-content-sha256",signature="*****"], Opc-Request-Id=[0f4a8fdf-e959-4c05-825b-2016113c9e30], X-Forwarded-For=[160.34.126.47], Opc-Client-Info=[Oracle-HgConsole/0.0.1], Accept-Language=[en-GB,en-US;q=0.9,en;q=0.8], Content-Length=[203], X-Real-IP=[160.34.126.47], Content-Type=[application/json]}, requestOrigin=172.24.112.149, requestParameters={}, requestResource=/20160918/users/, responseHeaders={Access-Control-Expose-Headers=[opc-previous-page,opc-next-page,opc-client-info,ETag,opc-request-id,Location], Access-Control-Allow-Origin=[https://console.us-phoenix-1.oraclecloud.com], ETag=[eb7bc6f3628daef80172fd5d65a3583467b25db6], Access-Control-Allow-Credentials=[true], Content-Length=[397], opc-request-id=[0f4a8fdf-e959-4c05-825b-2016113c/3DE1CC59F187BBC76AF2EF804EFC4E3A/5046B7C959C3A745C9ADCDC12B2CCBCC], Date=[Tue, 27 Mar 2018 10:03:35 GMT], Location=[http://identity.us-phoenix-1.oraclecloud.com/20160918/users/ocid1.user.oc1..aaaaaaaag32nkv2wqpp25hzpkbpaylvcds52jztuy5c2ck6q7gbum6ooj6jq], Content-Type=[application/json]}, responseStatus=200, responseTime=Tue Mar 27 15:33:35 IST 2018, responsePayload={id=ocid1.user.oc1..aaaaaaaag32nkv2wqpp25hzpkbpaylvcds52jztuy5c2ck6q7gbum6ooj6jq}, explicitlySet=[requestResource, eventId, requestAction, requestOrigin, responseTime, responsePayload, eventSource, requestParameters, principalId, eventType, responseStatus, compartmentId, requestHeaders, responseHeaders, requestId, requestAgent, tenantId, eventTime, credentialId])"}

Rest API to Authentication and Request other service

Hi,
We are trying to build some generic tool around all providers including Oracle. For this, We need some common methodology and implementation. We are looking for something like OAuth, via which we can login to oracle bmc. And can get authorization header for next request.

https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apiref.htm
https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdks.htm
I was looking for REST API doc. But I did not find sample data for authorization. What I can see only SDK implementation. Please let me know in case of any reference to APIs.

UploadRequest does not callback invocationCallback object when multipart upload is being used

This issue is very similar to #58.

	File uploadFile = new File("testfile");
	PutObjectRequest putRequest = PutObjectRequest.builder().namespaceName("testnamespace").bucketName("testbucket")
    		.objectName(uploadFile.getName())
    		.invocationCallback(new DateHeaderConsumer()) 
    		.build();
    
	UploadConfiguration uploadConfiguration = UploadConfiguration
			.builder().allowMultipartUploads(true)
			.minimumLengthForMultipartUpload(2)
			.allowParallelUploads(true).build();
	UploadManager uploadManager = new UploadManager(osclient, uploadConfiguration);
	UploadRequest uploadRequest = UploadRequest.builder(uploadFile)
			.allowOverwrite(true).build(putRequest);
	uploadManager.upload(uploadRequest);

Here, the minimum length for multipart upload is set to 2MB. DateHeaderConsumer gets the callback fine when the uploadFile is less than 2MB, but it does not get the callback if the uploadFile is more than 2MB. We use sdk version 1.2.35, but this issue reproduces with latest 1.4.3 as well.

computeClient.listShapes() has duplicates

ListShapesResponse response =
                computeClient.listShapes(
                        ListShapesRequest.builder()
                                .compartmentId(compartmentId)
                                .build());

System.out.println(response.getItems());

The output is the following:

[Shape(shape=BM.Standard1.36), Shape(shape=BM.HighIO1.36), Shape(shape=BM.DenseIO1.36), Shape(shape=VM.Standard1.1), Shape(shape=VM.Standard1.2), Shap
e(shape=VM.Standard1.4), Shape(shape=VM.Standard1.8), Shape(shape=VM.Standard1.16), Shape(shape=VM.DenseIO1.4), Shape(shape=VM.DenseIO1.8), Shape(shap
e=VM.DenseIO1.16), Shape(shape=BM.Standard1.36), Shape(shape=BM.HighIO1.36), Shape(shape=BM.DenseIO1.36), Shape(shape=VM.Standard1.1), Shape(shape=VM.
Standard1.2), Shape(shape=VM.Standard1.4), Shape(shape=VM.Standard1.8), Shape(shape=VM.Standard1.16), Shape(shape=VM.DenseIO1.4), Shape(shape=VM.Dense
IO1.8), Shape(shape=VM.DenseIO1.16), Shape(shape=BM.Standard1.36), Shape(shape=BM.HighIO1.36), Shape(shape=BM.DenseIO1.36), Shape(shape=VM.Standard1.1
), Shape(shape=VM.Standard1.2), Shape(shape=VM.Standard1.4), Shape(shape=VM.Standard1.8), Shape(shape=VM.Standard1.16), Shape(shape=VM.DenseIO1.4), Sh
ape(shape=VM.DenseIO1.8), Shape(shape=VM.DenseIO1.16)]

Is this an expected behaviour?

PutObjectRequest does not callback invocationCallback object

    PutObjectRequest headRequest = PutObjectRequest.builder().namespaceName("testnamespace").bucketName("testbucket")
    		.objectName("file_object")
    		.putObjectBody(new FileInputStream("testfile"))
    		.invocationCallback(new DateHeaderConsumer()) 
    		.build();
    osclient.putObject(headRequest);

The DateHeaderConsumer.accept is never called. GetObjectRequest, HeadObjectRequest, etc does callback as expected, only the PutObjectRequest does not callback. This looks like a bug to me.
ObjectMetadataInterceptor.intercept(PutRequestObject) creates a new PutRequestObject without the invocation callback. The preprocess method doesn't find any invocationCallback object in case of PutRequestObject.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.