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

Fix 6 issues in table service layer #27

Merged
merged 18 commits into from
Apr 4, 2012
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Fix #221 and #231
jcookems committed Mar 8, 2012

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 3bf1d0940c3fce030a865edc3c99bdb5bb965a3f
Original file line number Diff line number Diff line change
@@ -282,6 +282,9 @@ public void setServiceProperties(ServiceProperties serviceProperties) throws Ser
@Override
public void setServiceProperties(ServiceProperties serviceProperties, TableServiceOptions options)
throws ServiceException {
if (serviceProperties == null)
throw new NullPointerException();

WebResource webResource = getResource(options).path("/").queryParam("resType", "service")
.queryParam("comp", "properties");

@@ -297,6 +300,9 @@ public GetTableResult getTable(String table) throws ServiceException {

@Override
public GetTableResult getTable(String table, TableServiceOptions options) throws ServiceException {
if (table == null)
throw new NullPointerException();

WebResource webResource = getResource(options).path("Tables" + "('" + table + "')");

WebResource.Builder builder = webResource.getRequestBuilder();
@@ -369,6 +375,9 @@ public void createTable(String table) throws ServiceException {

@Override
public void createTable(String table, TableServiceOptions options) throws ServiceException {
if (table == null)
throw new NullPointerException();

WebResource webResource = getResource(options).path("Tables");

WebResource.Builder builder = webResource.getRequestBuilder();
@@ -387,6 +396,9 @@ public void deleteTable(String table) throws ServiceException {

@Override
public void deleteTable(String table, TableServiceOptions options) throws ServiceException {
if (table == null)
throw new NullPointerException();

WebResource webResource = getResource(options).path("Tables" + "('" + table + "')");

WebResource.Builder builder = webResource.getRequestBuilder();
@@ -405,6 +417,9 @@ public InsertEntityResult insertEntity(String table, Entity entity) throws Servi
@Override
public InsertEntityResult insertEntity(String table, Entity entity, TableServiceOptions options)
throws ServiceException {
if (table == null)
throw new NullPointerException();

WebResource webResource = getResource(options).path(table);

WebResource.Builder builder = webResource.getRequestBuilder();
@@ -434,7 +449,7 @@ public UpdateEntityResult updateEntity(String table, Entity entity, TableService

@Override
public UpdateEntityResult mergeEntity(String table, Entity entity) throws ServiceException {
return updateEntity(table, entity, new TableServiceOptions());
return mergeEntity(table, entity, new TableServiceOptions());
}

@Override
@@ -456,7 +471,7 @@ public UpdateEntityResult insertOrReplaceEntity(String table, Entity entity, Tab

@Override
public UpdateEntityResult insertOrMergeEntity(String table, Entity entity) throws ServiceException {
return insertOrReplaceEntity(table, entity, new TableServiceOptions());
return insertOrMergeEntity(table, entity, new TableServiceOptions());
}

@Override
@@ -467,6 +482,9 @@ public UpdateEntityResult insertOrMergeEntity(String table, Entity entity, Table

private UpdateEntityResult putOrMergeEntityCore(String table, Entity entity, String verb, boolean includeEtag,
TableServiceOptions options) throws ServiceException {
if (table == null)
throw new NullPointerException();

WebResource webResource = getResource(options).path(
getEntityPath(table, entity.getPartitionKey(), entity.getRowKey()));

@@ -499,6 +517,9 @@ public void deleteEntity(String table, String partitionKey, String rowKey) throw
@Override
public void deleteEntity(String table, String partitionKey, String rowKey, DeleteEntityOptions options)
throws ServiceException {
if (table == null)
throw new NullPointerException();

WebResource webResource = getResource(options).path(getEntityPath(table, partitionKey, rowKey));

WebResource.Builder builder = webResource.getRequestBuilder();
@@ -517,6 +538,9 @@ public GetEntityResult getEntity(String table, String partitionKey, String rowKe
@Override
public GetEntityResult getEntity(String table, String partitionKey, String rowKey, TableServiceOptions options)
throws ServiceException {
if (table == null)
throw new NullPointerException();

WebResource webResource = getResource(options).path(getEntityPath(table, partitionKey, rowKey));

WebResource.Builder builder = webResource.getRequestBuilder();
@@ -538,6 +562,11 @@ public QueryEntitiesResult queryEntities(String table) throws ServiceException {

@Override
public QueryEntitiesResult queryEntities(String table, QueryEntitiesOptions options) throws ServiceException {
if (table == null)
throw new NullPointerException();
if (options == null)
options = new QueryEntitiesOptions();

WebResource webResource = getResource(options).path(table);
webResource = addOptionalQuery(webResource, options.getQuery());
webResource = addOptionalQueryParam(webResource, "NextPartitionKey",