Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
83e8d49
Added Options classes
gapra-msft Jul 1, 2020
fccea10
Prepped lease clients to add tags
gapra-msft Jul 2, 2020
5096e60
Merge branch 'master' into storage/tagConditions
gapra-msft Jul 8, 2020
31b46d2
Regenerated code for tags
gapra-msft Jul 8, 2020
16e511c
Added recordings for ifTags tests
gapra-msft Jul 8, 2020
3f424d2
Added tags to a bunch of APIs in BlobBase
gapra-msft Jul 9, 2020
7429428
Added tests for set tier tags
gapra-msft Jul 9, 2020
653f3c1
Added tags to rest of the APIs
gapra-msft Jul 10, 2020
bf5ed7c
Added snapshot tests
gapra-msft Jul 10, 2020
70999a7
Added get blob and get properties tests
gapra-msft Jul 10, 2020
890abdf
Added set metadata and properties tests
gapra-msft Jul 10, 2020
fbc8d93
Added delete test
gapra-msft Jul 10, 2020
24e9d87
Added copy tests
gapra-msft Jul 10, 2020
8fe1c61
Added block tests
gapra-msft Jul 13, 2020
c17742b
Added Append blob tests
gapra-msft Jul 13, 2020
1542b31
Added page blob tests
gapra-msft Jul 13, 2020
a8991ae
fixed recorded tests
gapra-msft Jul 13, 2020
f3304a0
Fixed change lease tests
gapra-msft Jul 13, 2020
59ec0f4
Fixed JAva doc snippets
gapra-msft Jul 13, 2020
baabf80
fixed checkstyle
gapra-msft Jul 13, 2020
c656c34
Last checkstype
gapra-msft Jul 13, 2020
ec8139d
Changed name of ifTags
gapra-msft Jul 13, 2020
5b61015
Merge branch 'master' into storage/tagConditions
gapra-msft Jul 16, 2020
7f11017
renamed tagcondition
gapra-msft Jul 16, 2020
f4b661e
plural
gapra-msft Jul 16, 2020
9a1cc77
line endings
gapra-msft Jul 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class BlobGetAccountInfoHeaders {

/*
* Identifies the account kind. Possible values include: 'Storage',
* 'BlobStorage', 'StorageV2'
* 'BlobStorage', 'StorageV2', 'FileStorage', 'BlockBlobStorage'
*/
@JsonProperty(value = "x-ms-account-kind")
private AccountKind accountKind;
Expand Down Expand Up @@ -193,7 +193,8 @@ public BlobGetAccountInfoHeaders setSkuName(SkuName skuName) {

/**
* Get the accountKind property: Identifies the account kind. Possible
* values include: 'Storage', 'BlobStorage', 'StorageV2'.
* values include: 'Storage', 'BlobStorage', 'StorageV2', 'FileStorage',
* 'BlockBlobStorage'.
*
* @return the accountKind value.
*/
Expand All @@ -203,7 +204,8 @@ public AccountKind getAccountKind() {

/**
* Set the accountKind property: Identifies the account kind. Possible
* values include: 'Storage', 'BlobStorage', 'StorageV2'.
* values include: 'Storage', 'BlobStorage', 'StorageV2', 'FileStorage',
* 'BlockBlobStorage'.
*
* @param accountKind the accountKind value to set.
* @return the BlobGetAccountInfoHeaders object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ public final class BlobGetPropertiesHeaders {
@JsonProperty(value = "x-ms-blob-sealed")
private Boolean isSealed;

/*
* If an object is in rehydrate pending state then this header is returned
* with priority of rehydrate. Valid values are High and Standard.
*/
@JsonProperty(value = "x-ms-rehydrate-priority")
private String rehydratePriority;

/*
* The errorCode property.
*/
Expand Down Expand Up @@ -1478,6 +1485,30 @@ public BlobGetPropertiesHeaders setIsSealed(Boolean isSealed) {
return this;
}

/**
* Get the rehydratePriority property: If an object is in rehydrate pending
* state then this header is returned with priority of rehydrate. Valid
* values are High and Standard.
*
* @return the rehydratePriority value.
*/
public String getRehydratePriority() {
return this.rehydratePriority;
}

/**
* Set the rehydratePriority property: If an object is in rehydrate pending
* state then this header is returned with priority of rehydrate. Valid
* values are High and Standard.
*
* @param rehydratePriority the rehydratePriority value to set.
* @return the BlobGetPropertiesHeaders object itself.
*/
public BlobGetPropertiesHeaders setRehydratePriority(String rehydratePriority) {
this.rehydratePriority = rehydratePriority;
return this;
}

/**
* Get the errorCode property: The errorCode property.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.azure.storage.blob.models.LeaseDurationType;
import com.azure.storage.blob.models.LeaseStateType;
import com.azure.storage.blob.models.LeaseStatusType;
import com.azure.storage.blob.models.RehydratePriority;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import java.time.OffsetDateTime;
Expand Down Expand Up @@ -237,6 +238,12 @@ public final class BlobItemPropertiesInternal {
@JsonProperty(value = "IsSealed")
private Boolean isSealed;

/*
* Possible values include: 'High', 'Standard'
*/
@JsonProperty(value = "RehydratePriority")
private RehydratePriority rehydratePriority;

/**
* Get the creationTime property: The creationTime property.
*
Expand Down Expand Up @@ -1005,4 +1012,26 @@ public BlobItemPropertiesInternal setIsSealed(Boolean isSealed) {
this.isSealed = isSealed;
return this;
}

/**
* Get the rehydratePriority property: Possible values include: 'High',
* 'Standard'.
*
* @return the rehydratePriority value.
*/
public RehydratePriority getRehydratePriority() {
return this.rehydratePriority;
}

/**
* Set the rehydratePriority property: Possible values include: 'High',
* 'Standard'.
*
* @param rehydratePriority the rehydratePriority value to set.
* @return the BlobItemPropertiesInternal object itself.
*/
public BlobItemPropertiesInternal setRehydratePriority(RehydratePriority rehydratePriority) {
this.rehydratePriority = rehydratePriority;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class ContainerGetAccountInfoHeaders {

/*
* Identifies the account kind. Possible values include: 'Storage',
* 'BlobStorage', 'StorageV2'
* 'BlobStorage', 'StorageV2', 'FileStorage', 'BlockBlobStorage'
*/
@JsonProperty(value = "x-ms-account-kind")
private AccountKind accountKind;
Expand Down Expand Up @@ -193,7 +193,8 @@ public ContainerGetAccountInfoHeaders setSkuName(SkuName skuName) {

/**
* Get the accountKind property: Identifies the account kind. Possible
* values include: 'Storage', 'BlobStorage', 'StorageV2'.
* values include: 'Storage', 'BlobStorage', 'StorageV2', 'FileStorage',
* 'BlockBlobStorage'.
*
* @return the accountKind value.
*/
Expand All @@ -203,7 +204,8 @@ public AccountKind getAccountKind() {

/**
* Set the accountKind property: Identifies the account kind. Possible
* values include: 'Storage', 'BlobStorage', 'StorageV2'.
* values include: 'Storage', 'BlobStorage', 'StorageV2', 'FileStorage',
* 'BlockBlobStorage'.
*
* @param accountKind the accountKind value to set.
* @return the ContainerGetAccountInfoHeaders object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class ServiceGetAccountInfoHeaders {

/*
* Identifies the account kind. Possible values include: 'Storage',
* 'BlobStorage', 'StorageV2'
* 'BlobStorage', 'StorageV2', 'FileStorage', 'BlockBlobStorage'
*/
@JsonProperty(value = "x-ms-account-kind")
private AccountKind accountKind;
Expand Down Expand Up @@ -193,7 +193,8 @@ public ServiceGetAccountInfoHeaders setSkuName(SkuName skuName) {

/**
* Get the accountKind property: Identifies the account kind. Possible
* values include: 'Storage', 'BlobStorage', 'StorageV2'.
* values include: 'Storage', 'BlobStorage', 'StorageV2', 'FileStorage',
* 'BlockBlobStorage'.
*
* @return the accountKind value.
*/
Expand All @@ -203,7 +204,8 @@ public AccountKind getAccountKind() {

/**
* Set the accountKind property: Identifies the account kind. Possible
* values include: 'Storage', 'BlobStorage', 'StorageV2'.
* values include: 'Storage', 'BlobStorage', 'StorageV2', 'FileStorage',
* 'BlockBlobStorage'.
*
* @param accountKind the accountKind value to set.
* @return the ServiceGetAccountInfoHeaders object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

package com.azure.storage.blob.implementation.util;

import com.azure.core.http.RequestConditions;
import com.azure.storage.blob.BlobAsyncClient;
import com.azure.storage.blob.implementation.models.BlobDownloadHeaders;
import com.azure.storage.blob.implementation.models.BlobItemInternal;
import com.azure.storage.blob.implementation.models.BlobItemPropertiesInternal;
import com.azure.storage.blob.implementation.models.BlobTag;
import com.azure.storage.blob.models.BlobItem;
import com.azure.storage.blob.models.BlobItemProperties;
import com.azure.storage.blob.models.BlobLeaseRequestConditions;
import com.azure.storage.blob.models.ObjectReplicationPolicy;
import com.azure.storage.blob.models.ObjectReplicationRule;
import com.azure.storage.blob.models.ObjectReplicationStatus;
Expand Down Expand Up @@ -282,4 +284,22 @@ private static List<ObjectReplicationPolicy> transformObjectReplicationMetadata(
return objectReplicationSourcePolicies;
}

/**
* Transforms {@link RequestConditions} into a public {@link BlobLeaseRequestConditions}.
*
* @param requestConditions {@link RequestConditions}
* @return {@link BlobLeaseRequestConditions}
*/
public static BlobLeaseRequestConditions populateBlobLeaseRequestConditions(RequestConditions requestConditions) {
if (requestConditions == null) {
return null;
}

return new BlobLeaseRequestConditions()
.setIfMatch(requestConditions.getIfMatch())
.setIfNoneMatch(requestConditions.getIfNoneMatch())
.setIfModifiedSince(requestConditions.getIfModifiedSince())
.setIfUnmodifiedSince(requestConditions.getIfUnmodifiedSince())
.setTagsConditions(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ public enum AccountKind {
/**
* Enum value StorageV2.
*/
STORAGE_V2("StorageV2");
STORAGE_V2("StorageV2"),

/**
* Enum value FileStorage.
*/
FILE_STORAGE("FileStorage"),

/**
* Enum value BlockBlobStorage.
*/
BLOCK_BLOB_STORAGE("BlockBlobStorage");

/**
* The actual serialized value for a AccountKind instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ public AppendBlobRequestConditions setLeaseId(String leaseId) {
return this;
}

/**
* Optionally applies the SQL statement to the tags of the blob.
*
* @param tagsConditions The SQL statement that apply to the tags of the blob.
* @return The updated BlobRequestConditions object.
*/
@Override
public AppendBlobRequestConditions setTagsConditions(String tagsConditions) {
super.setTagsConditions(tagsConditions);
return this;
}

/**
* Gets the max length in bytes allowed for the append blob.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.storage.blob.models;

import com.azure.core.http.RequestConditions;

import java.time.OffsetDateTime;

/**
* This class contains values which will restrict the successful operation of a variety of lease requests to the
* conditions present. These conditions are entirely optional. The entire object or any of its properties may be set to
* null when passed to a method to indicate that those conditions are not desired. Please refer to the type of each
* field for more information on those particular access conditions.
*/
public class BlobLeaseRequestConditions extends RequestConditions {
private String tagsConditions;

/**
* Optionally limit requests to resources that match the passed ETag.
*
* @param ifMatch ETag that resources must match.
* @return The updated BlobLeaseRequestConditions object.
*/
@Override
public BlobLeaseRequestConditions setIfMatch(String ifMatch) {
super.setIfMatch(ifMatch);
return this;
}

/**
* Optionally limit requests to resources that do not match the passed ETag.
*
* @param ifNoneMatch ETag that resources must not match.
* @return The updated BlobLeaseRequestConditions object.
*/
@Override
public BlobLeaseRequestConditions setIfNoneMatch(String ifNoneMatch) {
super.setIfNoneMatch(ifNoneMatch);
return this;
}

/**
* Optionally limit requests to resources that have only been modified since the passed
* {@link OffsetDateTime datetime}.
*
* @param ifModifiedSince The datetime that resources must have been modified since.
* @return The updated BlobLeaseRequestConditions object.
*/
@Override
public BlobLeaseRequestConditions setIfModifiedSince(OffsetDateTime ifModifiedSince) {
super.setIfModifiedSince(ifModifiedSince);
return this;
}

/**
* Optionally limit requests to resources that have remained unmodified since the passed
* {@link OffsetDateTime datetime}.
*
* @param ifUnmodifiedSince The datetime that resources must have remained unmodified since.
* @return The updated BlobLeaseRequestConditions object.
*/
@Override
public BlobLeaseRequestConditions setIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince) {
super.setIfUnmodifiedSince(ifUnmodifiedSince);
return this;
}

/**
* Gets the SQL statement that apply to the tags of the blob.
*
* @return The SQL statement that apply to the tags of the blob.
*/
public String getTagsConditions() {
return tagsConditions;
}

/**
* Optionally applies the SQL statement to the tags of the blob.
*
* @param tagsConditions The SQL statement that apply to the tags of the blob.
* @return The updated BlobLeaseRequestConditions object.
*/
public BlobLeaseRequestConditions setTagsConditions(String tagsConditions) {
this.tagsConditions = tagsConditions;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package com.azure.storage.blob.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.http.RequestConditions;

import java.time.OffsetDateTime;

Expand All @@ -15,7 +14,7 @@
* information on those particular access conditions.
*/
@Fluent
public class BlobRequestConditions extends RequestConditions {
public class BlobRequestConditions extends BlobLeaseRequestConditions {
private String leaseId;

/**
Expand Down Expand Up @@ -68,6 +67,18 @@ public BlobRequestConditions setIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSin
return this;
}

/**
* Optionally applies the SQL statement to the tags of the blob.
*
* @param tagsConditions The SQL statement that apply to the tags of the blob.
* @return The updated BlobRequestConditions object.
*/
@Override
public BlobRequestConditions setTagsConditions(String tagsConditions) {
super.setTagsConditions(tagsConditions);
return this;
}

/**
* Gets the lease ID that blobs and containers must match.
*
Expand Down
Loading