/** * Returns the canonical name for shared access. * * @return A <code>String</code> containing the canonical name for shared access. */ private String getSharedAccessCanonicalName() { String accountName = this.getServiceClient().getCredentials().getAccountName(); String tableNameLowerCase = this.getName().toLowerCase(Locale.ENGLISH); return String.format("/%s/%s/%s", SR.TABLE, accountName, tableNameLowerCase); }
/** * Returns the canonical name for shared access. * * @return A <code>String</code> containing the canonical name for shared access. */ private String getSharedAccessCanonicalName() { String accountName = this.getServiceClient().getCredentials().getAccountName(); String tableNameLowerCase = this.getName().toLowerCase(Locale.ENGLISH); return String.format("/%s/%s/%s", SR.TABLE, accountName, tableNameLowerCase); }
options = TableRequestOptions.populateAndApplyDefaults(options, this.getServiceClient()); return batch.execute(this.getServiceClient(), this.getName(), options, opContext);
Utility.assertNotNull("query", query); Utility.assertNotNull(SR.QUERY_REQUIRES_VALID_CLASSTYPE_OR_RESOLVER, resolver); TableRequestOptions modifiedOptions = TableRequestOptions.populateAndApplyDefaults(options, this.getServiceClient()); query.setSourceTableName(this.getName()); return (Iterable<R>) this.getServiceClient().generateIteratorForQuery(query, resolver, modifiedOptions, opContext);
options = TableRequestOptions.populateAndApplyDefaults(options, this.getServiceClient()); return batch.execute(this.getServiceClient(), this.getName(), options, opContext);
final OperationContext opContext) throws StorageException { Utility.assertNotNull("operation", operation); return operation.execute(this.getServiceClient(), this.getName(), options, opContext);
final OperationContext opContext) throws StorageException { Utility.assertNotNull("operation", operation); return operation.execute(this.getServiceClient(), this.getName(), options, opContext);
Utility.assertNotNull("query", query); Utility.assertNotNull(SR.QUERY_REQUIRES_VALID_CLASSTYPE_OR_RESOLVER, query.getClazzType()); TableRequestOptions modifiedOptions = TableRequestOptions.populateAndApplyDefaults(options, this.getServiceClient()); query.setSourceTableName(this.getName()); return (Iterable<T>) this.getServiceClient().generateIteratorForQuery(query, null, modifiedOptions, opContext);
Utility.assertNotNull("query", query); query.setSourceTableName(this.getName()); return (ResultSegment<T>) this.getServiceClient().executeQuerySegmentedImpl(query, null, continuationToken, options, opContext);
Utility.assertNotNull(SR.QUERY_REQUIRES_VALID_CLASSTYPE_OR_RESOLVER, resolver); query.setSourceTableName(this.getName()); return (ResultSegment<R>) this.getServiceClient().executeQuerySegmentedImpl(query, resolver, continuationToken, options, opContext);
Utility.assertNotNull("query", query); query.setSourceTableName(this.getName()); return (ResultSegment<T>) this.getServiceClient().executeQuerySegmentedImpl(query, null, continuationToken, options, opContext);
Utility.assertNotNull(SR.QUERY_REQUIRES_VALID_CLASSTYPE_OR_RESOLVER, resolver); query.setSourceTableName(this.getName()); return (ResultSegment<R>) this.getServiceClient().executeQuerySegmentedImpl(query, resolver, continuationToken, options, opContext);
Utility.assertNotNull(SR.QUERY_REQUIRES_VALID_CLASSTYPE_OR_RESOLVER, resolver); query.setSourceTableName(this.getName()); return (Iterable<R>) this.getServiceClient().generateIteratorForQuery(query, resolver, options, opContext);
Utility.assertNotNull(SR.QUERY_REQUIRES_VALID_CLASSTYPE_OR_RESOLVER, query.getClazzType()); query.setSourceTableName(this.getName()); return (Iterable<T>) this.getServiceClient().generateIteratorForQuery(query, null, options, opContext);
@Test public void testTableTypesWithStorageUri() throws URISyntaxException, StorageException { CloudTableClient tableClient = TestHelper.createCloudTableClient(); StorageUri endpoint = new StorageUri(new URI("http://" + ACCOUNT_NAME + TABLE_SERVICE + ENDPOINT_SUFFIX), new URI("http://" + ACCOUNT_NAME + SECONDARY_SUFFIX + TABLE_SERVICE + ENDPOINT_SUFFIX)); CloudTableClient client = new CloudTableClient(endpoint, tableClient.getCredentials()); assertEquals(endpoint, client.getStorageUri()); assertEquals(endpoint.getPrimaryUri(), client.getEndpoint()); StorageUri tableUri = new StorageUri(new URI(endpoint.getPrimaryUri() + "/table"), new URI( endpoint.getSecondaryUri() + "/table")); CloudTable table = client.getTableReference("table"); assertEquals(tableUri, table.getStorageUri()); assertEquals(tableUri.getPrimaryUri(), table.getUri()); assertEquals(endpoint, table.getServiceClient().getStorageUri()); table = new CloudTable(tableUri, client.getCredentials()); assertEquals(tableUri, table.getStorageUri()); assertEquals(tableUri.getPrimaryUri(), table.getUri()); assertEquals(endpoint, table.getServiceClient().getStorageUri()); } }
.generateSharedAccessSignature((SharedAccessTablePolicy) null, identifier, "javatables_batch_0", "0", "javatables_batch_9", "9"))); assertEquals(StorageCredentialsSharedAccessSignature.class.toString(), tableFromUri.getServiceClient() .getCredentials().getClass().toString()); table.generateSharedAccessSignature((SharedAccessTablePolicy) null, identifier, "javatables_batch_0", "0", "javatables_batch_9", "9")); CloudTableClient tableClient = new CloudTableClient(policySasTable.getServiceClient().getStorageUri(), creds); assertEquals(StorageCredentialsSharedAccessSignature.class.toString(), tableFromUri.getServiceClient() .getCredentials().getClass().toString()); assertEquals(tableClient.getDefaultRequestOptions().getLocationMode(), tableFromUri.getServiceClient() .getDefaultRequestOptions().getLocationMode()); assertEquals(tableClient.getDefaultRequestOptions().getTimeoutIntervalInMs(), tableFromUri.getServiceClient() .getDefaultRequestOptions().getTimeoutIntervalInMs()); assertEquals(tableClient.getDefaultRequestOptions().getTablePayloadFormat(), tableFromUri.getServiceClient() .getDefaultRequestOptions().getTablePayloadFormat()); assertEquals(tableClient.getDefaultRequestOptions().getRetryPolicyFactory().getClass(), tableFromUri .getServiceClient().getDefaultRequestOptions().getRetryPolicyFactory().getClass());
private static void testTableDownloadPermissions(LocationMode optionsLocationMode, LocationMode clientLocationMode, StorageLocation initialLocation, List<RetryContext> retryContextList, List<RetryInfo> retryInfoList) throws URISyntaxException, StorageException { CloudTableClient client = TestHelper.createCloudTableClient(); CloudTable table = client.getTableReference(TableTestHelper.generateRandomTableName()); MultiLocationTestHelper helper = new MultiLocationTestHelper(table.getServiceClient().getStorageUri(), initialLocation, retryContextList, retryInfoList); table.getServiceClient().getDefaultRequestOptions().setLocationMode(clientLocationMode); TableRequestOptions options = new TableRequestOptions(); options.setLocationMode(optionsLocationMode); options.setRetryPolicyFactory(helper.retryPolicy); try { table.downloadPermissions(options, helper.operationContext); } catch (StorageException ex) { assertEquals(HttpURLConnection.HTTP_NOT_FOUND, ex.getHttpStatusCode()); } finally { helper.close(); } } }