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

Merge release to mater #295

Merged
merged 153 commits into from
Mar 14, 2013
Merged
Changes from 5 commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
8a143d8
update the unit tests so that the job integration tests have the right
Jan 14, 2013
624cfa2
add TaskHistoricalEvent to the queue.
Jan 14, 2013
84c6bd5
partial checkin for task historical event
Jan 15, 2013
76d9ecc
initial check in to add task historical event type.
Jan 15, 2013
8e9fdcf
Merge pull request #101 from WindowsAzure/dev
Jan 15, 2013
7d5b4b6
second checkin to support task historical events.
Jan 16, 2013
2cebbbd
Merge pull request #99 from gcheng/bettertests
Jan 21, 2013
c3cfb9f
Merge pull request #626 from gcheng/dev
Jan 21, 2013
6760316
Merge pull request #104 from WindowsAzure/dev
Jan 22, 2013
b76886a
Merge pull request #105 from gcheng/dev
Jan 22, 2013
466c43b
add job integration test for taskhistorical event
Jan 23, 2013
84c47af
Fix JavaDoc build warnings
jcookems Jan 23, 2013
f4d3d60
Fixing checkstyle errors for Media Services, issue #204.
jcookems Jan 23, 2013
a1f7bc6
Merge pull request #4 from jcookems/fixDocWarnings
jcookems Jan 23, 2013
3a63e0e
Update `settingTimeoutPrefixedFromConfigWorks` to test state of the c…
jcookems Jan 23, 2013
baaf794
Removing code to pre-clean tables, because the table names are now un…
jcookems Jan 23, 2013
bd8d7c1
Merge pull request #5 from jcookems/fixCheckStyle
jcookems Jan 23, 2013
84dc395
Convert readField from recursive to iterative.
jcookems Jan 23, 2013
c3a60fb
Merge pull request #6 from jcookems/fix210
jcookems Jan 23, 2013
64b3938
Merge pull request #211 from jcookems/dev
jcookems Jan 23, 2013
cc327c0
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
jcookems Jan 24, 2013
455f906
Merge pull request #631 from jcookems/dev
jcookems Jan 24, 2013
f7dce4b
code review feedback.
Jan 25, 2013
0ef9985
Merge pull request #100 from gcheng/historicalevents
Jan 25, 2013
6db3cad
a missed unit test.
Jan 25, 2013
3531068
Merge pull request #106 from gcheng/historicalevents
Jan 25, 2013
04160b9
Merge pull request #632 from gcheng/dev
Jan 25, 2013
78067fc
Minor changes to address the compile-time warnings
jcookems Jan 28, 2013
7a8812e
Remove trivial TODO comments from tests
jcookems Jan 29, 2013
dda240d
Removing trivial TODO Auto-generated comments
jcookems Jan 29, 2013
40bd3e5
Replace trivial *if* statement with more useful Assert
jcookems Jan 29, 2013
269db3f
Remove "catch (InterruptedException e)" that could obscure unexpected…
jcookems Jan 29, 2013
da209fe
Merge pull request #32 from jcookems/fixWarnings
jcookems Jan 29, 2013
0413d38
Merge pull request #634 from jcookems/dev
jcookems Jan 29, 2013
4bf887e
Remove hard-coded Fiddler code in tests
jcookems Jan 29, 2013
277921f
Adding deltas to assertEquals for Date and Double, which are likely t…
jcookems Jan 29, 2013
4e7c7d4
Updated ignore
Jan 30, 2013
16cd488
Merge branch 'master' of https://github.com/WindowsAzure/azure-sdk-fo…
Jan 30, 2013
68a61bc
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Jan 30, 2013
5679d73
First cut at base class for connection string parsing.
Jan 31, 2013
88a1f7a
Updated based on code review, rewrite parser based on grammar from Jason
Feb 1, 2013
702c26a
Added back in test that was accidentally removed
Feb 1, 2013
886535a
Merge pull request #5 from christav/servicebus-connection-strings
Feb 1, 2013
13ef42a
Merge pull request #212 from christav/dev
Feb 1, 2013
a98c882
Working towards connection string support in service bus
Feb 1, 2013
50929a6
Connection settings class fully plumbed through config
Feb 1, 2013
d010841
Switched tests to running off connection string instead of individual…
Feb 1, 2013
e001391
Fixed up exception reporting, fixed so tests actually use connection …
Feb 2, 2013
87d5ba9
Adding testing for various configuration permutations.
Feb 4, 2013
959a3c9
Made connection settings package visible rather than public.
Feb 4, 2013
ba3e0f3
Only replace sb:// at start of connection string value
Feb 4, 2013
0f4a168
Merge pull request #6 from christav/servicebus-connection-strings
Feb 5, 2013
9d9e65c
Merge pull request #215 from christav/dev
Feb 5, 2013
fde1416
Adding javadocs for missing parameters
Feb 5, 2013
27be399
Merge pull request #7 from christav/servicebus-javadoc-update
Feb 5, 2013
e35b776
Merge pull request #216 from christav/dev
Feb 5, 2013
614e96e
Merge pull request #33 from jcookems/fix205
jcookems Feb 6, 2013
eaf464c
Merge pull request #639 from jcookems/dev
jcookems Feb 6, 2013
8bca4e7
Removed leaseId from function signature - it isn't used by the service.
Feb 6, 2013
df49d89
initial checkin for user agent filter.
Feb 6, 2013
6faeb7c
get user agent working with media service.
Feb 7, 2013
939e60c
Added return value for breakLease. Also fixed some warnings in the bl…
Feb 7, 2013
3e8b32b
Updated doc comments
Feb 7, 2013
a053200
enable UserAgent in Blob, ServiceBus, Queue and Table.
Feb 7, 2013
b8a9257
fix up of related classes.
Feb 7, 2013
11dc82d
Added back original overloads of breakLease to keep back compat, mark…
Feb 7, 2013
df8140d
Merge pull request #8 from christav/update-breaklease-signature-88
Feb 7, 2013
3fc489f
Merge pull request #228 from christav/dev
Feb 7, 2013
781a0f4
code review feedback.
Feb 8, 2013
8c7ffac
Merge pull request #14 from gcheng/useragent
Feb 8, 2013
fbec962
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Feb 8, 2013
9b8ab6d
Fixed test cross contamination - create new config, don't reuse curre…
Feb 8, 2013
9cc5440
Merge pull request #9 from christav/connectionstring-test-fixes-232
Feb 8, 2013
79f2e3e
Merge pull request #233 from christav/dev
Feb 8, 2013
55c81f8
resolve a merge conflict.
Feb 8, 2013
686f91c
Minor changes to address the compile-time warnings
jcookems Jan 28, 2013
9c2243a
Remove trivial TODO comments from tests
jcookems Jan 29, 2013
b375ecb
Removing trivial TODO Auto-generated comments
jcookems Jan 29, 2013
2d0299f
Replace trivial *if* statement with more useful Assert
jcookems Jan 29, 2013
5d6f96d
Remove "catch (InterruptedException e)" that could obscure unexpected…
jcookems Jan 29, 2013
5912b78
Remove hard-coded Fiddler code in tests
jcookems Jan 29, 2013
cac506d
Adding deltas to assertEquals for Date and Double, which are likely t…
jcookems Jan 29, 2013
9a44b2d
Merge pull request #240 from gcheng/dev
Feb 11, 2013
2134d76
Fixing new warnings
jcookems Feb 12, 2013
d321286
Merge pull request #7 from jcookems/cleanup1
jcookems Feb 12, 2013
e46ebae
Merge branch 'dev' of github.com:jcookems/azure-sdk-for-java into dev
jcookems Feb 12, 2013
f534e85
Merge pull request #241 from jcookems/dev
jcookems Feb 12, 2013
12e254d
fix an issue on Jason's machine.
Feb 13, 2013
73e1961
Merge pull request #16 from gcheng/useragentfilter
Feb 14, 2013
38ec313
Merge pull request #242 from gcheng/dev
Feb 14, 2013
315f243
Add java test cases for WA GB18030 Certification.
Feb 18, 2013
b208494
1. Fix Copyright info
Feb 19, 2013
03c4f3b
Removed extra print
Feb 19, 2013
c427848
Merge pull request #10 from christav/remove-console-output-244
Feb 19, 2013
ed834aa
Merge pull request #248 from christav/dev
Feb 19, 2013
c744072
fix path in readme file.
Feb 20, 2013
83228b7
Merge pull request #17 from gcheng/readme
Feb 20, 2013
abbbe10
Merge pull request #250 from gcheng/dev
Feb 20, 2013
38b3a52
[JXSCL] : Make OperationContext RequestResults thread safe,
Feb 20, 2013
2f347c3
Merge pull request #247 from LucieZhou/master
jcookems Feb 20, 2013
f5e7c15
CR Feedback - Update tasks to provide result affinity. Now the Reque…
Feb 21, 2013
118bac1
Make BlobOutputStream use latest instead of uncommitted.
Feb 21, 2013
5b39feb
Reduced characters that get encoded to just the illegal set
Feb 22, 2013
3f7bf11
Added surrogate pair character to test
Feb 22, 2013
836828d
Merge pull request #11 from christav/fix-encoding-111
Feb 22, 2013
c4268a5
Merge pull request #258 from christav/dev
Feb 22, 2013
08648cc
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Feb 22, 2013
36ebeb4
BlobInputStream MD5 verification fix and a couple more fixes
Feb 22, 2013
940a8b6
Pull from WindowsAzure/dev
Feb 22, 2013
11b1a31
CR feedback: Update tasks to provide result affinity
Feb 25, 2013
bed1f7d
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
guangyang Feb 25, 2013
83c5aa8
Fixed test for surrogate pair, removed encoding
Feb 26, 2013
dcc318c
Merge pull request #12 from christav/encoding-111
Feb 26, 2013
98e2a46
Merge pull request #260 from christav/dev
Feb 26, 2013
19ef20c
fix the broken unit test due to nimbus server upgrade.
Feb 26, 2013
4f692bb
fix another unit test due to nimbus server upgrade.
Feb 26, 2013
77c9477
Merge pull request #107 from gcheng/unittestclean
Feb 26, 2013
ce4a3bf
Merge pull request #644 from gcheng/dev
Feb 26, 2013
c99a721
Removed copyright year from javadoc header
Feb 27, 2013
e78d698
Merge pull request #13 from christav/remove-date-256
Feb 27, 2013
53350d6
Merge pull request #261 from christav/dev
Feb 27, 2013
a542d78
Merge pull request #18 from WindowsAzure/dev
Feb 27, 2013
742b0e2
Clean up service bus assets created as part of test at the end.
Feb 27, 2013
731245a
Merge pull request #14 from christav/sb-test-cleanup-118
Feb 27, 2013
dc4575c
Merge pull request #263 from christav/dev
Feb 27, 2013
ff3d149
fix the broken unit test due to nimbus server upgrade.
Feb 26, 2013
34d7de1
fix another unit test due to nimbus server upgrade.
Feb 26, 2013
782319d
CR feedback remove extra line
Feb 27, 2013
cba4c0d
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Feb 27, 2013
39a498f
fix a broken unit test
Feb 27, 2013
84403a6
Merge pull request #20 from gcheng/fixunittests
Feb 27, 2013
8e7fc15
Merge pull request #264 from gcheng/dev
Feb 27, 2013
c5345f2
Merge branch 'dev' of https://github.com/sozler/azure-sdk-for-java in…
Feb 28, 2013
57335fe
Update Changelog for latest fixes
Feb 28, 2013
b792da2
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Mar 1, 2013
927e31e
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
Mar 1, 2013
557804b
Merge branch 'dev' of https://github.com/sozler/azure-sdk-for-java in…
Mar 1, 2013
6575ffa
Merge pull request #282 from sozler/dev
Mar 6, 2013
22961d2
Merge branch 'release' of github.com:WindowsAzure/azure-sdk-for-java …
jcookems Mar 8, 2013
6ad950a
Merge branch 'release' of https://github.com/WindowsAzure/azure-sdk-f…
Mar 8, 2013
0145416
Merge pull request #34 from jcookems/int
jcookems Mar 8, 2013
7f614ec
Merge pull request #651 from jcookems/dev
jcookems Mar 8, 2013
48ca51e
Merge pull request #9 from jcookems/int
jcookems Mar 8, 2013
492299f
Merge pull request #290 from jcookems/release
jcookems Mar 8, 2013
398e721
Updating POM version
jcookems Mar 8, 2013
11ec4a9
Merge pull request #291 from jcookems/release
jcookems Mar 8, 2013
5fc77e0
Merge pull request #289 from joeg/devMerge
Mar 9, 2013
b6928e0
Merge branch 'release' of https://github.com/WindowsAzure/azure-sdk-f…
guangyang Mar 11, 2013
baff388
update changelog for 0.4.1
guangyang Mar 11, 2013
1944273
update change log and readme.md based on PR review feedback
guangyang Mar 11, 2013
dd74ec3
fixing policheck issues
guangyang Mar 11, 2013
f0d6ca3
fixing policheck issues
guangyang Mar 11, 2013
e92621b
Merge pull request #292 from guangyang/release
guangyang Mar 11, 2013
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
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@
import com.microsoft.windowsazure.services.blob.models.AcquireLeaseResult;
import com.microsoft.windowsazure.services.blob.models.BlobServiceOptions;
import com.microsoft.windowsazure.services.blob.models.BlockList;
import com.microsoft.windowsazure.services.blob.models.BreakLeaseResult;
import com.microsoft.windowsazure.services.blob.models.CommitBlobBlocksOptions;
import com.microsoft.windowsazure.services.blob.models.ContainerACL;
import com.microsoft.windowsazure.services.blob.models.CopyBlobOptions;
@@ -1440,16 +1441,23 @@ void releaseLease(String container, String blob, String leaseId, BlobServiceOpti
* <p>
* A lease that has been broken but has not yet expired can also be released, in which case another client may
* immediately acquire a new lease on the blob.
*
*
* @deprecated Server ignores the leaseId parameter, replaced by {@link #breakLease(String, String)} without
* the useless parameter.
*
* @param container
* A {@link String} containing the name of the blob's container.
* @param blob
* A {@link String} containing the name of the blob to break a lease on.
* @param leaseId
* A {@link String} containing an optional lease ID.
*
* @param leaseId lease id to break. Ignored.
*
* @throws ServiceException
* if an error occurs accessing the storage service.
*
* @return result containing time remaining before a new lease can be acquired
*/
@Deprecated()
void breakLease(String container, String blob, String leaseId) throws ServiceException;

/**
@@ -1465,17 +1473,78 @@ void releaseLease(String container, String blob, String leaseId, BlobServiceOpti
* <p>
* A lease that has been broken but has not yet expired can also be released, in which case another client may
* immediately acquire a new lease on the blob.
*
*
* @deprecated Server ignores the leaseId parameter, replaced by
* {@link #breakLease(String, String, com.microsoft.windowsazure.services.blob.models.BlobServiceOptions)}
* without the useless parameter.
*
*
* @param container
* A {@link String} containing the name of the blob's container.
* @param blob
* A {@link String} containing the name of the blob to break a lease on.
* @param leaseId
* A {@link String} containing an optional lease ID.
* @param options
* A {@link BlobServiceOptions} instance containing options for the request.
* A {@link com.microsoft.windowsazure.services.blob.models.BlobServiceOptions} instance containing options for the request.
* @param leaseId lease id to break. Ignored.
*
* @throws ServiceException
* if an error occurs accessing the storage service.
* @return result containing time remaining before a new lease can be acquired
*/
@Deprecated()
void breakLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException;

/**
* Breaks an active lease on a blob.
* <p>
* This method breaks the lease on the blob specified by the <em>blob</em> and <em>container</em> parameters. The
* <em>leaseId</em> parameter is not used by the server.
* <p>
* Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not
* required to specify a matching lease ID. When a lease is broken, the remaining time on the lease is allowed to
* elapse, during which time no lease operation may be performed on the blob.
* <p>
* A lease that has been broken but has not yet expired can also be released, in which case another client may
* immediately acquire a new lease on the blob.
*
*
*
* @param container
* A {@link String} containing the name of the blob's container.
* @param blob
* A {@link String} containing the name of the blob to break a lease on.
* @throws ServiceException
* if an error occurs accessing the storage service.
*
* @return result containing time remaining before a new lease can be acquired
*/
BreakLeaseResult breakLease(String container, String blob) throws ServiceException;

/**
* Breaks an active lease on a blob, using the specified options.
* <p>
* This method breaks the lease on the blob specified by the <em>blob</em> and <em>container</em> parameters. The
* <em>leaseId</em> parameter is not used by the server. Use the {@link BlobServiceOptions options} parameter to
* specify the server timeout for the operation.
* <p>
* Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not
* required to specify a matching lease ID. When a lease is broken, the remaining time on the lease is allowed to
* elapse, during which time no lease operation may be performed on the blob.
* <p>
* A lease that has been broken but has not yet expired can also be released, in which case another client may
* immediately acquire a new lease on the blob.
*
*
*
* @param container
* A {@link String} containing the name of the blob's container.
* @param blob
* A {@link String} containing the name of the blob to break a lease on.
* @param options
* A {@link com.microsoft.windowsazure.services.blob.models.BlobServiceOptions} instance containing options for the request.
* @throws ServiceException
* if an error occurs accessing the storage service.
* @return result containing time remaining before a new lease can be acquired
*/
BreakLeaseResult breakLease(String container, String blob, BlobServiceOptions options) throws ServiceException;
}
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
import com.microsoft.windowsazure.services.blob.models.AcquireLeaseResult;
import com.microsoft.windowsazure.services.blob.models.BlobServiceOptions;
import com.microsoft.windowsazure.services.blob.models.BlockList;
import com.microsoft.windowsazure.services.blob.models.BreakLeaseResult;
import com.microsoft.windowsazure.services.blob.models.CommitBlobBlocksOptions;
import com.microsoft.windowsazure.services.blob.models.ContainerACL;
import com.microsoft.windowsazure.services.blob.models.CopyBlobOptions;
@@ -888,9 +889,21 @@ public void releaseLease(String container, String blob, String leaseId, BlobServ
}

@Override
@Deprecated
public void breakLease(String container, String blob, String leaseId) throws ServiceException {
breakLease(container, blob);
}

@Override
@Deprecated
public void breakLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException {
breakLease(container, blob, options);
}

@Override
public BreakLeaseResult breakLease(String container, String blob) throws ServiceException {
try {
service.breakLease(container, blob, leaseId);
return service.breakLease(container, blob);
}
catch (UniformInterfaceException e) {
throw processCatch(new ServiceException(e));
@@ -901,10 +914,10 @@ public void breakLease(String container, String blob, String leaseId) throws Ser
}

@Override
public void breakLease(String container, String blob, String leaseId, BlobServiceOptions options)
public BreakLeaseResult breakLease(String container, String blob, BlobServiceOptions options)
throws ServiceException {
try {
service.breakLease(container, blob, leaseId, options);
return service.breakLease(container, blob, options);
}
catch (UniformInterfaceException e) {
throw processCatch(new ServiceException(e));
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
import com.microsoft.windowsazure.services.blob.models.BlobProperties;
import com.microsoft.windowsazure.services.blob.models.BlobServiceOptions;
import com.microsoft.windowsazure.services.blob.models.BlockList;
import com.microsoft.windowsazure.services.blob.models.BreakLeaseResult;
import com.microsoft.windowsazure.services.blob.models.CommitBlobBlocksOptions;
import com.microsoft.windowsazure.services.blob.models.ContainerACL;
import com.microsoft.windowsazure.services.blob.models.ContainerACL.PublicAccessType;
@@ -801,33 +802,56 @@ public void releaseLease(String container, String blob, String leaseId, BlobServ
}

@Override
@Deprecated
public void breakLease(String container, String blob, String leaseId) throws ServiceException {
breakLease(container, blob, leaseId, new BlobServiceOptions());
breakLease(container, blob);
}

@Override
public void breakLease(String container, String blob, String leaseId, BlobServiceOptions options)
throws ServiceException {
putLeaseImpl("break", container, blob, leaseId, options, null/* accessCondition */);
@Deprecated
public void breakLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException {
breakLease(container, blob, options);
}

@Override
public BreakLeaseResult breakLease(String container, String blob) throws ServiceException {
return breakLease(container, blob, new BlobServiceOptions());
}

@Override
public BreakLeaseResult breakLease(String container, String blob, BlobServiceOptions options)
throws ServiceException {
ClientResponse response = doLeaseOperation("break", container, blob, null, options, null);

BreakLeaseResult result = new BreakLeaseResult();
result.setRemainingLeaseTimeInSeconds(Integer.parseInt(response.getHeaders().getFirst("x-ms-lease-time")));
return result;
}

private AcquireLeaseResult putLeaseImpl(String leaseAction, String container, String blob, String leaseId,
BlobServiceOptions options, AccessCondition accessCondition) throws ServiceException {
ClientResponse response = doLeaseOperation(leaseAction, container, blob, leaseId, options, accessCondition);

AcquireLeaseResult result = new AcquireLeaseResult();
result.setLeaseId(response.getHeaders().getFirst("x-ms-lease-id"));
return result;
}

private ClientResponse doLeaseOperation(String leaseAction, String container, String blob, String leaseId, BlobServiceOptions options, AccessCondition accessCondition) {
String path = createPathFromContainer(container);
WebResource webResource = getResource(options).path(path).path(blob).queryParam("comp", "lease");

Builder builder = webResource.header("x-ms-version", API_VERSION);
builder = addOptionalHeader(builder, "x-ms-lease-id", leaseId);
if (leaseId != null) {
builder = addOptionalHeader(builder, "x-ms-lease-id", leaseId);
}
builder = addOptionalHeader(builder, "x-ms-lease-action", leaseAction);
builder = addOptionalAccessConditionHeader(builder, accessCondition);

// Note: Add content type here to enable proper HMAC signing
ClientResponse response = builder.put(ClientResponse.class, "");
ThrowIfError(response);

AcquireLeaseResult result = new AcquireLeaseResult();
result.setLeaseId(response.getHeaders().getFirst("x-ms-lease-id"));
return result;
return response;
}

@Override
Original file line number Diff line number Diff line change
@@ -18,9 +18,10 @@

/**
* A wrapper class for the response returned from a Blob Service REST API Lease Blob operation. This is returned by
* calls to implementations of {@link BlobContract#breakLease(String, String, String, BlobServiceOptions)},
* {@link BlobContract#releaseLease(String, String, String, BlobServiceOptions)} and
* {@link BlobContract#renewLease(String, String, String, BlobServiceOptions)}.
* calls to implementations of {@link BlobContract#acquireLease(String, String)},
* {@link BlobContract#acquireLease(String, String, AcquireLeaseOptions)},
* {@link BlobContract#renewLease(String, String, String, BlobServiceOptions)}, and
* {@link BlobContract#renewLease(String, String, String)}.
* <p>
* See the <a href="http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx">Lease Blob</a> documentation on
* MSDN for details of the underlying Blob Service REST API operation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.microsoft.windowsazure.services.blob.models;

/**
* A wrapper class for the response returned from a Blob Service REST API Break Lease Blob operation. This is returned by
* calls to implementations of {@link com.microsoft.windowsazure.services.blob.BlobContract#breakLease(String, String, BlobServiceOptions)},
* <p>
* See the <a href="http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx">Lease Blob</a> documentation on
* MSDN for details of the underlying Blob Service REST API operation.
*/
public class BreakLeaseResult {
private int remainingLeaseTimeInSeconds;

public int getRemainingLeaseTimeInSeconds() {
return remainingLeaseTimeInSeconds;
}

public void setRemainingLeaseTimeInSeconds(int remainingLeaseTimeInSeconds) {
this.remainingLeaseTimeInSeconds = remainingLeaseTimeInSeconds;
}
}
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@
import com.microsoft.windowsazure.services.blob.models.AccessCondition;
import com.microsoft.windowsazure.services.blob.models.BlobProperties;
import com.microsoft.windowsazure.services.blob.models.BlockList;
import com.microsoft.windowsazure.services.blob.models.BreakLeaseResult;
import com.microsoft.windowsazure.services.blob.models.ContainerACL;
import com.microsoft.windowsazure.services.blob.models.ContainerACL.PublicAccessType;
import com.microsoft.windowsazure.services.blob.models.CopyBlobResult;
@@ -325,7 +326,7 @@ public void deleteContainerWorks() throws Exception {

// Assert
for (Container container : listContainerResult.getContainers()) {
assertTrue(!container.getName().equals(container));
assertTrue(!container.getName().equals(containerName));
}
}

@@ -1263,7 +1264,7 @@ public void getBlobWithIfNotModifiedSinceAccessConditionWorks() throws Exception
Date lastModifiedBase = (Date) props.getProperties().getLastModified().clone();

// +1 second
Date lastModifiedNext = new Date(lastModifiedBase.getTime() + 1 * 1000);
Date lastModifiedNext = new Date(lastModifiedBase.getTime() + 1000);

while (true) {
HashMap<String, String> metadata = new HashMap<String, String>();
@@ -1492,7 +1493,7 @@ public void deleteBlobSnapshotSuccess() throws Exception {
ListBlobsResult listBlobsResult = service.listBlobs(TEST_CONTAINER_FOR_BLOBS);
List<BlobEntry> blobEntry = listBlobsResult.getBlobs();
for (BlobEntry blobEntryItem : blobEntry) {
assertTrue(blobEntryItem.getSnapshot() != snapshot);
assertTrue(blobEntryItem.getSnapshot() == null || !blobEntryItem.getSnapshot().equals(snapshot));
}
assertTrue(true);
}
@@ -1595,11 +1596,13 @@ public void breakLeaseWorks() throws Exception {
String content = "some content2";
service.createBlockBlob(TEST_CONTAINER_FOR_BLOBS, "test6", new ByteArrayInputStream(content.getBytes("UTF-8")));
String leaseId = service.acquireLease(TEST_CONTAINER_FOR_BLOBS, "test6").getLeaseId();
service.breakLease(TEST_CONTAINER_FOR_BLOBS, "test6", leaseId);
BreakLeaseResult breakResult = service.breakLease(TEST_CONTAINER_FOR_BLOBS, "test6");
service.releaseLease(TEST_CONTAINER_FOR_BLOBS, "test6", leaseId);

// Assert
assertNotNull(leaseId);
assertNotNull(breakResult);
assertTrue(breakResult.getRemainingLeaseTimeInSeconds() > 0);
}

class RetryPolicyObserver implements ServiceFilter {