Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Storage to azure-core preview 3 #4489

Closed
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
10a85ad
Add storage swaggers
jianghaolu Jul 17, 2019
593ebf2
Update Storage to azure-core preview 3
jianghaolu Jul 19, 2019
b602214
Address code review feedback in AutoRest
jianghaolu Jul 24, 2019
9cbf411
Merge branch 'storage-post-review1-dev' of github.com:Azure/azure-sdk…
jianghaolu Jul 24, 2019
822b41d
Merge branch 'storage-post-review1-dev' of github.com:Azure/azure-sdk…
jianghaolu Jul 24, 2019
e19ea2b
Regenerate blob file queue after merge
jianghaolu Jul 24, 2019
7149824
Up azure core version for file & queue
jianghaolu Jul 24, 2019
efc335c
Apply all the manual fixes in swagger
jianghaolu Jul 24, 2019
87f3090
Change directoryName to directoryPath
jianghaolu Jul 24, 2019
5ce9473
Merge branch 'storage-post-review1-dev' of github.com:Azure/azure-sdk…
jianghaolu Jul 24, 2019
28beb79
Use non-fluent pattern for generated clients
jianghaolu Jul 24, 2019
570632c
Feature Work for Storage (#4584)
alzimmermsft Jul 25, 2019
ea2f43a
Removing the Jackson leak in HttpHeaders, instead registering a separ…
JonathanGiles Jul 26, 2019
9739dc6
Batch #2 - 11. No .builder() API: No classes should have a .builder()…
Jul 26, 2019
dd272bf
Add Tracing context in Key Vault keys package (#4500)
samvaity Jul 26, 2019
62c2dfc
Merge branch 'storage-post-review1-dev' of github.com:Azure/azure-sdk…
jianghaolu Jul 26, 2019
a5bc2dd
Merge branch 'master' of github.com:Azure/azure-sdk-for-java into sto…
jianghaolu Jul 26, 2019
a2b67ea
Fix build after merging with master
jianghaolu Jul 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions storage/client/blob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.0.0-preview.2</version>
<version>1.0.0-preview.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -69,7 +69,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-test</artifactId>
<version>1.0.0-preview.2</version>
<version>1.0.0-preview.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ private Flux<BlobItem> listBlobsHierarchyHelper(String delimiter, ListBlobsOptio
} else {
prefixes = Flux.empty();
}
Flux<BlobItem> result = blobs.concatWith(prefixes.map(prefix -> new BlobItem().name(prefix.name()).isPrefix(true)));
Flux<BlobItem> result = blobs.map(item -> item.isPrefix(false)).concatWith(prefixes.map(prefix -> new BlobItem().name(prefix.name()).isPrefix(true)));

if (response.value().nextMarker() != null) {
// Recursively add the continuation items to the observable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@

package com.azure.storage.blob.implementation;

import com.azure.core.annotations.BodyParam;
import com.azure.core.annotations.ExpectedResponses;
import com.azure.core.annotations.HeaderParam;
import com.azure.core.annotations.Host;
import com.azure.core.annotations.HostParam;
import com.azure.core.annotations.PUT;
import com.azure.core.annotations.PathParam;
import com.azure.core.annotations.QueryParam;
import com.azure.core.annotations.Service;
import com.azure.core.annotations.UnexpectedResponseExceptionType;
import com.azure.core.implementation.DateTimeRfc1123;
import com.azure.core.implementation.RestProxy;
import com.azure.core.implementation.annotation.BodyParam;
import com.azure.core.implementation.annotation.ExpectedResponses;
import com.azure.core.implementation.annotation.HeaderParam;
import com.azure.core.implementation.annotation.Host;
import com.azure.core.implementation.annotation.HostParam;
import com.azure.core.implementation.annotation.PathParam;
import com.azure.core.implementation.annotation.Put;
import com.azure.core.implementation.annotation.QueryParam;
import com.azure.core.implementation.annotation.ReturnType;
import com.azure.core.implementation.annotation.ServiceInterface;
import com.azure.core.implementation.annotation.ServiceMethod;
import com.azure.core.implementation.annotation.UnexpectedResponseExceptionType;
import com.azure.core.implementation.util.Base64Util;
import com.azure.core.util.Context;
import com.azure.storage.blob.models.AppendBlobsAppendBlockFromUrlResponse;
Expand Down Expand Up @@ -56,28 +58,28 @@ public final class AppendBlobsImpl {
* @param client the instance of the service client containing this operation class.
*/
public AppendBlobsImpl(AzureBlobStorageImpl client) {
this.service = RestProxy.create(AppendBlobsService.class, client);
this.service = RestProxy.create(AppendBlobsService.class, client.httpPipeline());
this.client = client;
}

/**
* The interface defining all the services for AppendBlobs to be used by
* the proxy service to perform REST calls.
* The interface defining all the services for AzureBlobStorageAppendBlobs
* to be used by the proxy service to perform REST calls.
*/
@Host("{url}")
@Service("Storage Blobs AppendBlob")
@ServiceInterface(name = "AzureBlobStorageAppendBlobs")
private interface AppendBlobsService {
@PUT("{containerName}/{blob}")
@Put("{containerName}/{blob}")
@ExpectedResponses({201})
@UnexpectedResponseExceptionType(StorageErrorException.class)
Mono<AppendBlobsCreateResponse> create(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map<String, String> metadata, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context);

@PUT("{containerName}/{blob}")
@Put("{containerName}/{blob}")
@ExpectedResponses({201})
@UnexpectedResponseExceptionType(StorageErrorException.class)
Mono<AppendBlobsAppendBlockResponse> appendBlock(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux<ByteBuf> body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String transactionalContentMD5, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context);

@PUT("{containerName}/{blob}")
@Put("{containerName}/{blob}")
@ExpectedResponses({201})
@UnexpectedResponseExceptionType(StorageErrorException.class)
Mono<AppendBlobsAppendBlockFromUrlResponse> appendBlockFromUrl(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-source-range") String sourceRange, @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, Context context);
Expand All @@ -93,6 +95,7 @@ private interface AppendBlobsService {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AppendBlobsCreateResponse> createWithRestResponseAsync(String containerName, String blob, long contentLength, Context context) {
final Integer timeout = null;
final Map<String, String> metadata = null;
Expand Down Expand Up @@ -134,6 +137,7 @@ public Mono<AppendBlobsCreateResponse> createWithRestResponseAsync(String contai
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AppendBlobsCreateResponse> createWithRestResponseAsync(String containerName, String blob, long contentLength, Integer timeout, Map<String, String> metadata, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, BlobHTTPHeaders blobHTTPHeaders, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) {
final String blobType = "AppendBlob";
String blobContentType = null;
Expand Down Expand Up @@ -197,6 +201,7 @@ public Mono<AppendBlobsCreateResponse> createWithRestResponseAsync(String contai
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AppendBlobsAppendBlockResponse> appendBlockWithRestResponseAsync(String containerName, String blob, Flux<ByteBuf> body, long contentLength, Context context) {
final Integer timeout = null;
final String encryptionKey = null;
Expand Down Expand Up @@ -235,6 +240,7 @@ public Mono<AppendBlobsAppendBlockResponse> appendBlockWithRestResponseAsync(Str
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AppendBlobsAppendBlockResponse> appendBlockWithRestResponseAsync(String containerName, String blob, Flux<ByteBuf> body, long contentLength, Integer timeout, byte[] transactionalContentMD5, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, AppendPositionAccessConditions appendPositionAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) {
final String comp = "appendblock";
String leaseId = null;
Expand Down Expand Up @@ -282,6 +288,7 @@ public Mono<AppendBlobsAppendBlockResponse> appendBlockWithRestResponseAsync(Str
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AppendBlobsAppendBlockFromUrlResponse> appendBlockFromUrlWithRestResponseAsync(String containerName, String blob, URL sourceUrl, long contentLength, Context context) {
final String sourceRange = null;
final Integer timeout = null;
Expand Down Expand Up @@ -321,6 +328,7 @@ public Mono<AppendBlobsAppendBlockFromUrlResponse> appendBlockFromUrlWithRestRes
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AppendBlobsAppendBlockFromUrlResponse> appendBlockFromUrlWithRestResponseAsync(String containerName, String blob, URL sourceUrl, long contentLength, String sourceRange, byte[] sourceContentMD5, Integer timeout, String requestId, LeaseAccessConditions leaseAccessConditions, AppendPositionAccessConditions appendPositionAccessConditions, ModifiedAccessConditions modifiedAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) {
final String comp = "appendblock";
String leaseId = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@

import com.azure.core.http.HttpPipeline;
import com.azure.core.implementation.RestProxy;
import com.azure.core.implementation.annotation.ServiceClientBuilder;

/**
* A builder for creating a new instance of the AzureBlobStorage type.
*/
@ServiceClientBuilder(serviceClients = AzureBlobStorageImpl.class)
public final class AzureBlobStorageBuilder {
/*
* The URL of the service account, container, or blob that is the targe of the desired operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

package com.azure.storage.blob.implementation;

import com.azure.core.ServiceClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.implementation.RestProxy;

/**
* Initializes a new instance of the AzureBlobStorage type.
*/
public final class AzureBlobStorageImpl extends ServiceClient {
public final class AzureBlobStorageImpl {
/**
* The URL of the service account, container, or blob that is the targe of the desired operation.
*/
Expand Down Expand Up @@ -62,6 +61,20 @@ AzureBlobStorageImpl version(String version) {
return this;
}

/**
* The HTTP pipeline to send requests through.
*/
private HttpPipeline httpPipeline;

/**
* Gets The HTTP pipeline to send requests through.
*
* @return the httpPipeline value.
*/
public HttpPipeline httpPipeline() {
return this.httpPipeline;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this is not public API I'll ask anyway: is this required to be exposed? I would suggest removing it until it is required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used at

this.service = RestProxy.create(AppendBlobsService.class, client.httpPipeline());


/**
* The ServicesImpl object to access its operations.
*/
Expand Down Expand Up @@ -159,7 +172,7 @@ public AzureBlobStorageImpl() {
* @param httpPipeline The HTTP pipeline to send requests through.
*/
public AzureBlobStorageImpl(HttpPipeline httpPipeline) {
super(httpPipeline);
this.httpPipeline = httpPipeline;
this.services = new ServicesImpl(this);
this.containers = new ContainersImpl(this);
this.blobs = new BlobsImpl(this);
Expand Down
Loading