Skip to content

Commit

Permalink
Merge pull request Azure#349 from rickle-msft/New-Storage-SDK-V10-Pre…
Browse files Browse the repository at this point in the history
…view-dev

New storage sdk v10 preview dev
  • Loading branch information
rickle-msft authored Aug 7, 2018
2 parents f79b87b + cd74c1f commit d4c4d99
Show file tree
Hide file tree
Showing 78 changed files with 1,384 additions and 147 deletions.
2 changes: 1 addition & 1 deletion BreakingChanges.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
XXXX.XX.XX Version XX.X.X-Preview
2018.08.07 Version 10.0.2-Preview
* Changed BlobListingDetails constructor to take a flag to include deleted blobs.
* Restructured the blob and container listing responses.
* BlockBlobURL.MAX_PUT_BLOCK_BYTES renamed to BlockBlobURL.MAX_STAGE_BLOCK_BYTES.
Expand Down
2 changes: 1 addition & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
XXXX.XX.XX Version XX.X.X-Preview
2018.08.07 Version 10.0.2-Preview
* Support for 2017-07-29 REST version. Please see our REST api documentation and blogs for information about the related added features.
* Support for setting a block blob's tier.
* Added support for soft delete feature. If a delete retention policy is enabled through the set service properties API, then blobs or snapshots can be deleted softly and retained for a specified number of days, before being permanently removed by garbage collection.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To get the binaries of this library as distributed by Microsoft, ready for use w
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>10.0.1-Preview</version>
<version>10.0.2-Preview</version>
</dependency>
```

Expand Down
30 changes: 28 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>10.0.1-Preview</version>
<version>10.0.2-Preview</version>

<name>Azure Storage Blob</name>
<description>The Azure Storage Java Blob library.</description>
Expand Down Expand Up @@ -65,7 +65,7 @@
<dependency>
<groupId>com.microsoft.rest.v2</groupId>
<artifactId>client-runtime</artifactId>
<version>2.0.0-beta3</version>
<version>2.0.0-beta4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -128,6 +128,32 @@
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<configuration>
<!-- force links to Java 8 documentation (should happen automatically
but doesn't) -->
<javaApiLinks>
<property>
<name>api_1.8</name>
<value>https://docs.oracle.com/javase/8/docs/api/</value>
</property>
</javaApiLinks>
<!-- add license notice -->
<bottom>
<![CDATA[This documentation was released into the public domain.]]>
</bottom>
<tags>
<tag>
<name>apiNote</name>
<placement>m</placement>
<head>API Note:</head>
</tag>
</tags>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down
76 changes: 63 additions & 13 deletions src/main/java/com/microsoft/azure/storage/GeneratedBlobs.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.microsoft.azure.storage.blob.models.BlobCreateSnapshotResponse;
import com.microsoft.azure.storage.blob.models.BlobDeleteResponse;
import com.microsoft.azure.storage.blob.models.BlobDownloadResponse;
import com.microsoft.azure.storage.blob.models.BlobGetAccountInfoResponse;
import com.microsoft.azure.storage.blob.models.BlobGetPropertiesResponse;
import com.microsoft.azure.storage.blob.models.BlobReleaseLeaseResponse;
import com.microsoft.azure.storage.blob.models.BlobRenewLeaseResponse;
Expand Down Expand Up @@ -149,7 +150,7 @@ private interface BlobsService {
@PUT("{containerName}/{blob}")
@ExpectedResponses({202})
@UnexpectedResponseExceptionType(StorageErrorException.class)
Single<BlobStartCopyFromURLResponse> startCopyFromURL(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map<String, String> metadata, @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 sourceIfMatches, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId);
Single<BlobStartCopyFromURLResponse> startCopyFromURL(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map<String, String> metadata, @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 sourceIfMatches, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatches, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId);

@PUT("{containerName}/{blob}")
@ExpectedResponses({204})
Expand All @@ -160,6 +161,11 @@ private interface BlobsService {
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(StorageErrorException.class)
Single<BlobSetTierResponse> setTier(@HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-access-tier") AccessTier tier, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp);

@GET("{containerName}/{blobName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(StorageErrorException.class)
Single<BlobGetAccountInfoResponse> getAccountInfo(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp);
}

/**
Expand Down Expand Up @@ -1263,14 +1269,13 @@ public Completable createSnapshotAsync(Integer timeout, Map<String, String> meta
* @param ifMatches Specify an ETag value to operate only on blobs with a matching value.
* @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
* @param leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID.
* @param sourceLeaseId Specify this header to perform the operation only if the lease ID given matches the active lease ID of the source blob.
* @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws StorageErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
public void startCopyFromURL(@NonNull URL copySource, Integer timeout, Map<String, String> metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String sourceLeaseId, String requestId) {
startCopyFromURLAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, sourceLeaseId, requestId).blockingAwait();
public void startCopyFromURL(@NonNull URL copySource, Integer timeout, Map<String, String> metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId) {
startCopyFromURLAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, requestId).blockingAwait();
}

/**
Expand All @@ -1288,14 +1293,13 @@ public void startCopyFromURL(@NonNull URL copySource, Integer timeout, Map<Strin
* @param ifMatches Specify an ETag value to operate only on blobs with a matching value.
* @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
* @param leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID.
* @param sourceLeaseId Specify this header to perform the operation only if the lease ID given matches the active lease ID of the source blob.
* @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a ServiceFuture which will be completed with the result of the network request.
*/
public ServiceFuture<Void> startCopyFromURLAsync(@NonNull URL copySource, Integer timeout, Map<String, String> metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String sourceLeaseId, String requestId, ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromBody(startCopyFromURLAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, sourceLeaseId, requestId), serviceCallback);
public ServiceFuture<Void> startCopyFromURLAsync(@NonNull URL copySource, Integer timeout, Map<String, String> metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId, ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromBody(startCopyFromURLAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, requestId), serviceCallback);
}

/**
Expand All @@ -1313,12 +1317,11 @@ public ServiceFuture<Void> startCopyFromURLAsync(@NonNull URL copySource, Intege
* @param ifMatches Specify an ETag value to operate only on blobs with a matching value.
* @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
* @param leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID.
* @param sourceLeaseId Specify this header to perform the operation only if the lease ID given matches the active lease ID of the source blob.
* @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Single which performs the network request upon subscription.
*/
public Single<BlobStartCopyFromURLResponse> startCopyFromURLWithRestResponseAsync(@NonNull URL copySource, Integer timeout, Map<String, String> metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String sourceLeaseId, String requestId) {
public Single<BlobStartCopyFromURLResponse> startCopyFromURLWithRestResponseAsync(@NonNull URL copySource, Integer timeout, Map<String, String> metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId) {
if (this.client.url() == null) {
throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null.");
}
Expand Down Expand Up @@ -1346,7 +1349,7 @@ public Single<BlobStartCopyFromURLResponse> startCopyFromURLWithRestResponseAsyn
if (ifUnmodifiedSince != null) {
ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince);
}
return service.startCopyFromURL(this.client.url(), timeout, metadata, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatches, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatches, ifNoneMatch, copySource, leaseId, sourceLeaseId, this.client.version(), requestId);
return service.startCopyFromURL(this.client.url(), timeout, metadata, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatches, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatches, ifNoneMatch, copySource, leaseId, this.client.version(), requestId);
}

/**
Expand All @@ -1364,13 +1367,12 @@ public Single<BlobStartCopyFromURLResponse> startCopyFromURLWithRestResponseAsyn
* @param ifMatches Specify an ETag value to operate only on blobs with a matching value.
* @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
* @param leaseId If specified, the operation only succeeds if the container's lease is active and matches this ID.
* @param sourceLeaseId Specify this header to perform the operation only if the lease ID given matches the active lease ID of the source blob.
* @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Single which performs the network request upon subscription.
*/
public Completable startCopyFromURLAsync(@NonNull URL copySource, Integer timeout, Map<String, String> metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String sourceLeaseId, String requestId) {
return startCopyFromURLWithRestResponseAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, sourceLeaseId, requestId)
public Completable startCopyFromURLAsync(@NonNull URL copySource, Integer timeout, Map<String, String> metadata, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatches, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatches, String ifNoneMatch, String leaseId, String requestId) {
return startCopyFromURLWithRestResponseAsync(copySource, timeout, metadata, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatches, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, leaseId, requestId)
.toCompletable();
}

Expand Down Expand Up @@ -1508,4 +1510,52 @@ public Completable setTierAsync(@NonNull AccessTier tier, Integer timeout, Strin
return setTierWithRestResponseAsync(tier, timeout, requestId)
.toCompletable();
}

/**
* Returns the sku name and account kind.
*
* @throws StorageErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
public void getAccountInfo() {
getAccountInfoAsync().blockingAwait();
}

/**
* Returns the sku name and account kind.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a ServiceFuture which will be completed with the result of the network request.
*/
public ServiceFuture<Void> getAccountInfoAsync(ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromBody(getAccountInfoAsync(), serviceCallback);
}

/**
* Returns the sku name and account kind.
*
* @return a Single which performs the network request upon subscription.
*/
public Single<BlobGetAccountInfoResponse> getAccountInfoWithRestResponseAsync() {
if (this.client.url() == null) {
throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null.");
}
if (this.client.version() == null) {
throw new IllegalArgumentException("Parameter this.client.version() is required and cannot be null.");
}
final String restype = "account";
final String comp = "properties";
return service.getAccountInfo(this.client.url(), this.client.version(), restype, comp);
}

/**
* Returns the sku name and account kind.
*
* @return a Single which performs the network request upon subscription.
*/
public Completable getAccountInfoAsync() {
return getAccountInfoWithRestResponseAsync()
.toCompletable();
}
}
Loading

0 comments on commit d4c4d99

Please sign in to comment.