/** * Build the client. * @param authenticationDetailsProvider authentication details provider * @return the client */ public ObjectStorageAsyncClient build( @lombok.NonNull com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider) { return new ObjectStorageAsyncClient( authenticationDetailsProvider, configuration, clientConfigurator, requestSignerFactory, additionalClientConfigurators, endpoint); } }
@Override public void setRegion(String regionId) { regionId = regionId.toLowerCase(Locale.ENGLISH); try { com.oracle.bmc.Region region = com.oracle.bmc.Region.fromRegionId(regionId); setRegion(region); } catch (IllegalArgumentException e) { LOG.info("Unknown regionId '{}', falling back to default endpoint format", regionId); String endpoint = com.oracle.bmc.Region.formatDefaultRegionEndpoint(SERVICE, regionId); setEndpoint(endpoint); } }
ObjectStorageAsyncClient.builder() .additionalClientConfigurator(new ResteasyClientConfigurator()) .build(provider); objectStorageAsyncClient.setRegion(Region.US_PHOENIX_1); objectStorageAsyncClient.getNamespace( GetNamespaceRequest.builder().build(), null); namespace = getNamespaceResponseFuture.get().getValue(); objectStorageAsyncClient.createBucket(createBucketRequest, null); objectStorageAsyncClient.putObject(putObjectRequest, null); System.out.println( "New object md5: " + putObjectResponseFuture.get().getOpcContentMd5()); objectStorageAsyncClient.getObject(getObjectRequest, null); System.out.println("Object md5: " + getObjectResponseFuture.get().getContentMd5()); getObjectResponseFuture.get().getInputStream().close(); objectStorageAsyncClient.deleteObject(deleteObjectRequest, null); deleteObjectResponseFuture.get(); objectStorageAsyncClient.deleteBucket(deleteBucketRequest, null); deleteBucketResponseFuture.get(); objectStorageAsyncClient.getNamespace( GetNamespaceRequest.builder().build(), getNamespaceHandler); getNamespaceHandler.waitForCompletion();
this.setRegion(provider.getRegion()); if (endpoint != null) { LOG.info( setEndpoint(endpoint);
ObjectStorageAsync client = new ObjectStorageAsyncClient(provider); client.setRegion(Region.US_PHOENIX_1);