public class DocumentClient extends Object implements AutoCloseable, com.microsoft.azure.documentdb.internal.CollectionCacheInternal
The service client encapsulates the endpoint and credentials used to access the Azure Cosmos DB service.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
PartitionResolverErrorMessage
Deprecated.
|
| Constructor and Description |
|---|
DocumentClient(String serviceEndpoint,
List<Permission> permissionFeed,
ConnectionPolicy connectionPolicy,
ConsistencyLevel desiredConsistencyLevel)
Initializes a new instance of the Microsoft.Azure.Documents.Client.DocumentClient class using the specified
Azure Cosmos DB service endpoint and permissions.
|
DocumentClient(String serviceEndpoint,
List<Permission> permissionFeed,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
ConnectionPolicy connectionPolicy,
ConsistencyLevel desiredConsistencyLevel)
Initializes a new instance of the Microsoft.Azure.Documents.Client.DocumentClient class using the specified
Azure Cosmos DB service endpoint and permissions.
|
DocumentClient(String serviceEndpoint,
String masterKey,
ConnectionPolicy connectionPolicy,
ConsistencyLevel desiredConsistencyLevel)
Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint and keys.
|
DocumentClient(String serviceEndpoint,
String masterKey,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
ConnectionPolicy connectionPolicy,
ConsistencyLevel desiredConsistencyLevel)
Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint and keys.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this DocumentClient instance
|
ResourceResponse<Attachment> |
createAttachment(String documentLink,
Attachment attachment,
RequestOptions options)
Creates an attachment.
|
ResourceResponse<Attachment> |
createAttachment(String documentLink,
InputStream mediaStream,
MediaOptions options)
Creates an attachment.
|
ResourceResponse<DocumentCollection> |
createCollection(String databaseLink,
DocumentCollection collection,
RequestOptions options)
Creates a document collection.
|
ResourceResponse<Database> |
createDatabase(Database database,
RequestOptions options)
Creates a database.
|
ResourceResponse<Document> |
createDocument(String collectionLink,
Object document,
RequestOptions options,
boolean disableAutomaticIdGeneration)
Creates a document.
|
ResourceResponse<Permission> |
createPermission(String userLink,
Permission permission,
RequestOptions options)
Creates a permission.
|
ResourceResponse<StoredProcedure> |
createStoredProcedure(String collectionLink,
StoredProcedure storedProcedure,
RequestOptions options)
Creates a stored procedure.
|
ResourceResponse<Trigger> |
createTrigger(String collectionLink,
Trigger trigger,
RequestOptions options)
Creates a trigger.
|
ResourceResponse<User> |
createUser(String databaseLink,
User user,
RequestOptions options)
Creates a user.
|
ResourceResponse<UserDefinedFunction> |
createUserDefinedFunction(String collectionLink,
UserDefinedFunction udf,
RequestOptions options)
Creates a user defined function.
|
ResourceResponse<Attachment> |
deleteAttachment(String attachmentLink,
RequestOptions options)
Deletes an attachment.
|
ResourceResponse<DocumentCollection> |
deleteCollection(String collectionLink,
RequestOptions options)
Deletes a document collection by the collection link.
|
ResourceResponse<Conflict> |
deleteConflict(String conflictLink,
RequestOptions options)
Deletes a conflict.
|
ResourceResponse<Database> |
deleteDatabase(String databaseLink,
RequestOptions options)
Deletes a database.
|
ResourceResponse<Document> |
deleteDocument(String documentLink,
RequestOptions options)
Deletes a document by the document link.
|
ResourceResponse<Permission> |
deletePermission(String permissionLink,
RequestOptions options)
Deletes a permission.
|
ResourceResponse<StoredProcedure> |
deleteStoredProcedure(String storedProcedureLink,
RequestOptions options)
Deletes a stored procedure by the stored procedure link.
|
ResourceResponse<Trigger> |
deleteTrigger(String triggerLink,
RequestOptions options)
Deletes a trigger.
|
ResourceResponse<User> |
deleteUser(String userLink,
RequestOptions options)
Deletes a user.
|
ResourceResponse<UserDefinedFunction> |
deleteUserDefinedFunction(String udfLink,
RequestOptions options)
Deletes a user defined function.
|
StoredProcedureResponse |
executeStoredProcedure(String storedProcedureLink,
Object[] procedureParams)
Executes a stored procedure by the stored procedure link.
|
StoredProcedureResponse |
executeStoredProcedure(String storedProcedureLink,
RequestOptions options,
Object[] procedureParams)
Executes a stored procedure by the stored procedure link.
|
ConnectionPolicy |
getConnectionPolicy() |
DatabaseAccount |
getDatabaseAccount()
Gets database account information.
|
protected PartitionResolver |
getPartitionResolver(String databaseLink)
Deprecated.
|
URI |
getReadEndpoint()
Gets the current read endpoint chosen based on availability and preference.
|
URI |
getServiceEndpoint()
Gets the default service endpoint as passed in by the user during construction.
|
URI |
getWriteEndpoint()
Gets the current write endpoint chosen based on availability and preference.
|
List<Object> |
queryAggregateValues(String collectionLink,
SqlQuerySpec querySpec,
FeedOptions feedOptions)
Query for aggregation values in a document collection.
|
List<Object> |
queryAggregateValues(String collectionLink,
SqlQuerySpec querySpec,
FeedOptions feedOptions,
Object partitionKey)
Query for aggregation values in a document collection.
|
List<Object> |
queryAggregateValues(String collectionLink,
String query,
FeedOptions feedOptions)
Query for aggregation values in a document collection.
|
List<Object> |
queryAggregateValues(String collectionLink,
String query,
FeedOptions feedOptions,
String partitionKey)
Query for aggregation values in a document collection.
|
FeedResponse<Attachment> |
queryAttachments(String documentLink,
SqlQuerySpec querySpec,
FeedOptions options)
Query for attachments.
|
FeedResponse<Attachment> |
queryAttachments(String documentLink,
String query,
FeedOptions options)
Query for attachments.
|
FeedResponse<DocumentCollection> |
queryCollections(String databaseLink,
SqlQuerySpec querySpec,
FeedOptions options)
Query for document collections in a database.
|
FeedResponse<DocumentCollection> |
queryCollections(String databaseLink,
String query,
FeedOptions options)
Query for document collections in a database.
|
FeedResponse<Conflict> |
queryConflicts(String collectionLink,
SqlQuerySpec querySpec,
FeedOptions options)
Query for conflicts.
|
FeedResponse<Conflict> |
queryConflicts(String collectionLink,
String query,
FeedOptions options)
Query for conflicts.
|
FeedResponse<Database> |
queryDatabases(SqlQuerySpec querySpec,
FeedOptions options)
Query for databases.
|
FeedResponse<Database> |
queryDatabases(String query,
FeedOptions options)
Query for databases.
|
FeedResponse<Document> |
queryDocumentChangeFeed(String collectionLink,
ChangeFeedOptions changeFeedOptions)
Query for documents change feed in a document collection.
|
FeedResponse<Document> |
queryDocuments(String collectionLink,
SqlQuerySpec querySpec,
FeedOptions options)
Query for documents in a document collection.
|
FeedResponse<Document> |
queryDocuments(String collectionLink,
SqlQuerySpec querySpec,
FeedOptions options,
Object partitionKey)
Query for documents in a document collection.
|
FeedResponse<Document> |
queryDocuments(String collectionLink,
String query,
FeedOptions options)
Query for documents in a document collection.
|
FeedResponse<Document> |
queryDocuments(String collectionLink,
String query,
FeedOptions options,
Object partitionKey)
Query for documents in a document collection with a partitionKey
|
FeedResponse<Offer> |
queryOffers(SqlQuerySpec querySpec,
FeedOptions options)
Query for offers in a database.
|
FeedResponse<Offer> |
queryOffers(String query,
FeedOptions options)
Query for offers in a database.
|
FeedResponse<Permission> |
queryPermissions(String permissionLink,
SqlQuerySpec querySpec,
FeedOptions options)
Query for permissions.
|
FeedResponse<Permission> |
queryPermissions(String userLink,
String query,
FeedOptions options)
Query for permissions.
|
FeedResponse<StoredProcedure> |
queryStoredProcedures(String collectionLink,
SqlQuerySpec querySpec,
FeedOptions options)
Query for stored procedures in a document collection.
|
FeedResponse<StoredProcedure> |
queryStoredProcedures(String collectionLink,
String query,
FeedOptions options)
Query for stored procedures in a document collection.
|
FeedResponse<Trigger> |
queryTriggers(String collectionLink,
SqlQuerySpec querySpec,
FeedOptions options)
Query for triggers.
|
FeedResponse<Trigger> |
queryTriggers(String collectionLink,
String query,
FeedOptions options)
Query for triggers.
|
FeedResponse<UserDefinedFunction> |
queryUserDefinedFunctions(String collectionLink,
SqlQuerySpec querySpec,
FeedOptions options)
Query for user defined functions.
|
FeedResponse<UserDefinedFunction> |
queryUserDefinedFunctions(String collectionLink,
String query,
FeedOptions options)
Query for user defined functions.
|
FeedResponse<User> |
queryUsers(String databaseLink,
SqlQuerySpec querySpec,
FeedOptions options)
Query for users.
|
FeedResponse<User> |
queryUsers(String databaseLink,
String query,
FeedOptions options)
Query for users.
|
ResourceResponse<Attachment> |
readAttachment(String attachmentLink,
RequestOptions options)
Reads an attachment.
|
FeedResponse<Attachment> |
readAttachments(String documentLink,
FeedOptions options)
Reads all attachments in a document.
|
ResourceResponse<DocumentCollection> |
readCollection(String collectionLink,
RequestOptions options)
Reads a document collection by the collection link.
|
FeedResponse<DocumentCollection> |
readCollections(String databaseLink,
FeedOptions options)
Reads all document collections in a database.
|
ResourceResponse<Conflict> |
readConflict(String conflictLink,
RequestOptions options)
Reads a conflict.
|
FeedResponse<Conflict> |
readConflicts(String collectionLink,
FeedOptions options)
Reads all conflicts in a document collection.
|
ResourceResponse<Database> |
readDatabase(String databaseLink,
RequestOptions options)
Reads a database.
|
FeedResponse<Database> |
readDatabases(FeedOptions options)
Reads all databases.
|
ResourceResponse<Document> |
readDocument(String documentLink,
RequestOptions options)
Reads a document by the document link.
|
FeedResponse<Document> |
readDocuments(String collectionLink,
FeedOptions options)
Reads all documents in a document collection.
|
MediaResponse |
readMedia(String mediaLink)
Reads a media by the media link.
|
ResourceResponse<Offer> |
readOffer(String offerLink)
Reads an offer.
|
FeedResponse<Offer> |
readOffers(FeedOptions options)
Reads offers.
|
FeedResponse<PartitionKeyRange> |
readPartitionKeyRanges(DocumentCollection documentCollection,
FeedOptions options)
Reads all partition key ranges in a document collection.
|
FeedResponse<PartitionKeyRange> |
readPartitionKeyRanges(String collectionLink,
FeedOptions options)
Reads all partition key ranges in a document collection.
|
Collection<PartitionKeyRange> |
readPartitionKeyRanges(String collectionLink,
String query)
Reads all partition key ranges in a document collection for a provided query.
|
ResourceResponse<Permission> |
readPermission(String permissionLink,
RequestOptions options)
Reads a permission.
|
FeedResponse<Permission> |
readPermissions(String userLink,
FeedOptions options)
Reads all permissions.
|
ResourceResponse<StoredProcedure> |
readStoredProcedure(String storedProcedureLink,
RequestOptions options)
Read a stored procedure by the stored procedure link.
|
FeedResponse<StoredProcedure> |
readStoredProcedures(String collectionLink,
FeedOptions options)
Reads all stored procedures in a document collection link.
|
ResourceResponse<Trigger> |
readTrigger(String triggerLink,
RequestOptions options)
Reads a trigger by the trigger link.
|
FeedResponse<Trigger> |
readTriggers(String collectionLink,
FeedOptions options)
Reads all triggers in a document collection.
|
ResourceResponse<User> |
readUser(String userLink,
RequestOptions options)
Reads a user.
|
ResourceResponse<UserDefinedFunction> |
readUserDefinedFunction(String udfLink,
RequestOptions options)
Read a user defined function.
|
FeedResponse<UserDefinedFunction> |
readUserDefinedFunctions(String collectionLink,
FeedOptions options)
Reads all user defined functions in a document collection.
|
FeedResponse<User> |
readUsers(String databaseLink,
FeedOptions options)
Reads all users in a database.
|
void |
registerPartitionResolver(String databaseLink,
PartitionResolver partitionResolver)
Deprecated.
|
ResourceResponse<Attachment> |
replaceAttachment(Attachment attachment,
RequestOptions options)
Replaces an attachment.
|
ResourceResponse<DocumentCollection> |
replaceCollection(DocumentCollection collection,
RequestOptions options)
Replaces a document collection.
|
ResourceResponse<Document> |
replaceDocument(Document document,
RequestOptions options)
Replaces a document with the passed in document.
|
ResourceResponse<Document> |
replaceDocument(String documentLink,
Object document,
RequestOptions options)
Replaces a document using a POJO object.
|
ResourceResponse<Offer> |
replaceOffer(Offer offer)
Replaces an offer.
|
ResourceResponse<Permission> |
replacePermission(Permission permission,
RequestOptions options)
Replaces a permission.
|
ResourceResponse<StoredProcedure> |
replaceStoredProcedure(StoredProcedure storedProcedure,
RequestOptions options)
Replaces a stored procedure.
|
ResourceResponse<Trigger> |
replaceTrigger(Trigger trigger,
RequestOptions options)
Replaces a trigger.
|
ResourceResponse<User> |
replaceUser(User user,
RequestOptions options)
Replaces a user.
|
ResourceResponse<UserDefinedFunction> |
replaceUserDefinedFunction(UserDefinedFunction udf,
RequestOptions options)
Replaces a user defined function.
|
MediaResponse |
updateMedia(String mediaLink,
InputStream mediaStream,
MediaOptions options)
Updates a media by the media link.
|
ResourceResponse<Attachment> |
upsertAttachment(String documentLink,
Attachment attachment,
RequestOptions options)
Upserts an attachment.
|
ResourceResponse<Attachment> |
upsertAttachment(String documentLink,
InputStream mediaStream,
MediaOptions options)
Upserts an attachment to the media stream
|
ResourceResponse<Document> |
upsertDocument(String collectionLink,
Object document,
RequestOptions options,
boolean disableAutomaticIdGeneration)
Upserts a document.
|
ResourceResponse<Permission> |
upsertPermission(String userLink,
Permission permission,
RequestOptions options)
Upserts a permission.
|
ResourceResponse<StoredProcedure> |
upsertStoredProcedure(String collectionLink,
StoredProcedure storedProcedure,
RequestOptions options)
Upserts a stored procedure.
|
ResourceResponse<Trigger> |
upsertTrigger(String collectionLink,
Trigger trigger,
RequestOptions options)
Upserts a trigger.
|
ResourceResponse<User> |
upsertUser(String databaseLink,
User user,
RequestOptions options)
Upserts a user.
|
ResourceResponse<UserDefinedFunction> |
upsertUserDefinedFunction(String collectionLink,
UserDefinedFunction udf,
RequestOptions options)
Upserts a user defined function.
|
@Deprecated protected static final String PartitionResolverErrorMessage
public DocumentClient(String serviceEndpoint, String masterKey, ConnectionPolicy connectionPolicy, ConsistencyLevel desiredConsistencyLevel)
serviceEndpoint - the URI of the service end point.masterKey - the master key.connectionPolicy - the connection policy.desiredConsistencyLevel - the desired consistency level.public DocumentClient(String serviceEndpoint, String masterKey, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ConnectionPolicy connectionPolicy, ConsistencyLevel desiredConsistencyLevel)
serviceEndpoint - the URI of the service end point.masterKey - the master key.objectMapper - the custom objectMapperconnectionPolicy - the connection policy.desiredConsistencyLevel - the desired consistency level.public DocumentClient(String serviceEndpoint, List<Permission> permissionFeed, ConnectionPolicy connectionPolicy, ConsistencyLevel desiredConsistencyLevel)
serviceEndpoint - the URI of the service end point.permissionFeed - the permission feed.connectionPolicy - the connection policy.desiredConsistencyLevel - the desired consistency level.public DocumentClient(String serviceEndpoint, List<Permission> permissionFeed, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ConnectionPolicy connectionPolicy, ConsistencyLevel desiredConsistencyLevel)
serviceEndpoint - the URI of the service end point.permissionFeed - the permission feed.objectMapper - the custom objectMapperconnectionPolicy - the connection policy.desiredConsistencyLevel - the desired consistency level.@Deprecated public void registerPartitionResolver(String databaseLink, PartitionResolver partitionResolver) throws DocumentClientException
DocumentClientException@Deprecated protected PartitionResolver getPartitionResolver(String databaseLink)
public URI getServiceEndpoint()
public URI getWriteEndpoint()
public URI getReadEndpoint()
public ConnectionPolicy getConnectionPolicy()
public ResourceResponse<Database> createDatabase(Database database, RequestOptions options) throws DocumentClientException
database - the database.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Database> deleteDatabase(String databaseLink, RequestOptions options) throws DocumentClientException
databaseLink - the database link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Database> readDatabase(String databaseLink, RequestOptions options) throws DocumentClientException
databaseLink - the database link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<Database> readDatabases(FeedOptions options)
options - the feed options.public FeedResponse<Database> queryDatabases(String query, FeedOptions options)
query - the query.options - the feed options.public FeedResponse<Database> queryDatabases(SqlQuerySpec querySpec, FeedOptions options)
querySpec - the SQL query specification.options - the feed options.public ResourceResponse<DocumentCollection> createCollection(String databaseLink, DocumentCollection collection, RequestOptions options) throws DocumentClientException
databaseLink - the database link.collection - the collection.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<DocumentCollection> replaceCollection(DocumentCollection collection, RequestOptions options) throws DocumentClientException
collection - the document collection to use.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<DocumentCollection> deleteCollection(String collectionLink, RequestOptions options) throws DocumentClientException
collectionLink - the collection link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<DocumentCollection> readCollection(String collectionLink, RequestOptions options) throws DocumentClientException
readCollection in interface com.microsoft.azure.documentdb.internal.CollectionCacheInternalcollectionLink - the collection link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<DocumentCollection> readCollections(String databaseLink, FeedOptions options)
databaseLink - the database link.options - the fee options.public FeedResponse<DocumentCollection> queryCollections(String databaseLink, String query, FeedOptions options)
databaseLink - the database link.query - the query.options - the feed options.public FeedResponse<DocumentCollection> queryCollections(String databaseLink, SqlQuerySpec querySpec, FeedOptions options)
databaseLink - the database link.querySpec - the SQL query specification.options - the feed options.public ResourceResponse<Document> createDocument(String collectionLink, Object document, RequestOptions options, boolean disableAutomaticIdGeneration) throws DocumentClientException
collectionLink - the link to the parent document collection.document - the document represented as a POJO or Document object.options - the request options.disableAutomaticIdGeneration - the flag for disabling automatic id generation.DocumentClientException - the document client exception.public ResourceResponse<Document> upsertDocument(String collectionLink, Object document, RequestOptions options, boolean disableAutomaticIdGeneration) throws DocumentClientException
collectionLink - the link to the parent document collection.document - the document represented as a POJO or Document object to upsert.options - the request options.disableAutomaticIdGeneration - the flag for disabling automatic id generation.DocumentClientException - the document client exception.public ResourceResponse<Document> replaceDocument(String documentLink, Object document, RequestOptions options) throws DocumentClientException
documentLink - the document link.document - the document represented as a POJO or Document object.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Document> replaceDocument(Document document, RequestOptions options) throws DocumentClientException
document - the document to replace (containing the document id).options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Document> deleteDocument(String documentLink, RequestOptions options) throws DocumentClientException
documentLink - the document link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Document> readDocument(String documentLink, RequestOptions options) throws DocumentClientException
documentLink - the document link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<Document> readDocuments(String collectionLink, FeedOptions options)
collectionLink - the collection link.options - the feed options.public FeedResponse<Document> queryDocuments(String collectionLink, String query, FeedOptions options)
collectionLink - the link to the parent document collection.query - the query.options - the feed options.public FeedResponse<Document> queryDocuments(String collectionLink, String query, FeedOptions options, Object partitionKey)
collectionLink - the link to the parent document collection.query - the query.options - the feed options.partitionKey - the partitionKey.public FeedResponse<Document> queryDocuments(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
collectionLink - the link to the parent document collection.querySpec - the SQL query specification.options - the feed options.public FeedResponse<Document> queryDocuments(String collectionLink, SqlQuerySpec querySpec, FeedOptions options, Object partitionKey)
collectionLink - the link to the parent document collection.querySpec - the SQL query specification.options - the feed options.partitionKey - the partitionKey.public List<Object> queryAggregateValues(String collectionLink, String query, FeedOptions feedOptions)
collectionLink - the link to the parent document collection.query - the query string.feedOptions - the feed options.public List<Object> queryAggregateValues(String collectionLink, String query, FeedOptions feedOptions, String partitionKey)
collectionLink - the link to the parent document collection.query - the query string.feedOptions - the feed options.partitionKey - the partitionKey.public List<Object> queryAggregateValues(String collectionLink, SqlQuerySpec querySpec, FeedOptions feedOptions)
collectionLink - the link to the parent document collection.querySpec - the SQL query specification.feedOptions - the feed options.public List<Object> queryAggregateValues(String collectionLink, SqlQuerySpec querySpec, FeedOptions feedOptions, Object partitionKey)
collectionLink - the link to the parent document collection.querySpec - the SQL query specification.feedOptions - the feed options.partitionKey - the partitionKey.public FeedResponse<Document> queryDocumentChangeFeed(String collectionLink, ChangeFeedOptions changeFeedOptions)
Example:
String partitionKeyRangeId = "0"; // Use client.readPartitionKeyRanges() to obtain the ranges.
String checkpointContinuation = null;
ChangeFeedOptions options = new ChangeFeedOptions();
options.setPartitionKeyRangeId(partitionKeyRangeId);
options.setRequestContinuation(checkpointContinuation);
options.setStartFromBeginning(true);
FeedResponse<Document> query = client.queryDocumentChangeFeed(coll.getSelfLink(), options);
do {
List<Document> docs = query.getQueryIterable().fetchNextBlock();
// Process the documents
// Checkpoint query.getResponseContinuation()
} while (query.getQueryIterator().hasNext());
collectionLink - the link to the parent document collectionchangeFeedOptions - the options for processing the query results feedChangeFeedOptions,
PartitionKeyRangepublic ResourceResponse<StoredProcedure> createStoredProcedure(String collectionLink, StoredProcedure storedProcedure, RequestOptions options) throws DocumentClientException
collectionLink - the collection link.storedProcedure - the stored procedure to create.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<StoredProcedure> upsertStoredProcedure(String collectionLink, StoredProcedure storedProcedure, RequestOptions options) throws DocumentClientException
collectionLink - the collection link.storedProcedure - the stored procedure to upsert.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<StoredProcedure> replaceStoredProcedure(StoredProcedure storedProcedure, RequestOptions options) throws DocumentClientException
storedProcedure - the stored procedure to use.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<StoredProcedure> deleteStoredProcedure(String storedProcedureLink, RequestOptions options) throws DocumentClientException
storedProcedureLink - the stored procedure link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<StoredProcedure> readStoredProcedure(String storedProcedureLink, RequestOptions options) throws DocumentClientException
storedProcedureLink - the stored procedure link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<StoredProcedure> readStoredProcedures(String collectionLink, FeedOptions options)
collectionLink - the collection link.options - the feed options.public FeedResponse<StoredProcedure> queryStoredProcedures(String collectionLink, String query, FeedOptions options)
collectionLink - the collection link.query - the query.options - the feed options.public FeedResponse<StoredProcedure> queryStoredProcedures(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
collectionLink - the collection link.querySpec - the SQL query specification.options - the feed options.public StoredProcedureResponse executeStoredProcedure(String storedProcedureLink, Object[] procedureParams) throws DocumentClientException
storedProcedureLink - the stored procedure link.procedureParams - the array of procedure parameter values.DocumentClientException - the document client exception.public StoredProcedureResponse executeStoredProcedure(String storedProcedureLink, RequestOptions options, Object[] procedureParams) throws DocumentClientException
storedProcedureLink - the stored procedure link.options - the request options.procedureParams - the array of procedure parameter values.DocumentClientException - the document client exception.public ResourceResponse<Trigger> createTrigger(String collectionLink, Trigger trigger, RequestOptions options) throws DocumentClientException
collectionLink - the collection link.trigger - the trigger.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Trigger> upsertTrigger(String collectionLink, Trigger trigger, RequestOptions options) throws DocumentClientException
collectionLink - the collection link.trigger - the trigger to upsert.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Trigger> replaceTrigger(Trigger trigger, RequestOptions options) throws DocumentClientException
trigger - the trigger to use.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Trigger> deleteTrigger(String triggerLink, RequestOptions options) throws DocumentClientException
triggerLink - the trigger link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Trigger> readTrigger(String triggerLink, RequestOptions options) throws DocumentClientException
triggerLink - the trigger link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<Trigger> readTriggers(String collectionLink, FeedOptions options)
collectionLink - the collection link.options - the feed options.public FeedResponse<Trigger> queryTriggers(String collectionLink, String query, FeedOptions options)
collectionLink - the collection link.query - the query.options - the feed options.public FeedResponse<Trigger> queryTriggers(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
collectionLink - the collection link.querySpec - the SQL query specification.options - the feed options.public FeedResponse<PartitionKeyRange> readPartitionKeyRanges(String collectionLink, FeedOptions options)
Example:
FeedResponse<PartitionKeyRange> partitionKeyRanges = this.client.readPartitionKeyRanges(coll, null);
List<String> ids = new ArrayList<String>();
for (PartitionKeyRange range : partitionKeyRanges.getQueryIterable()) {
ids.add(range.getId());
}
collectionLink - the collection link.options - the feed options.PartitionKeyRangepublic FeedResponse<PartitionKeyRange> readPartitionKeyRanges(DocumentCollection documentCollection, FeedOptions options)
Example:
FeedResponse<PartitionKeyRange> partitionKeyRanges = this.client.readPartitionKeyRanges(coll, null);
List<String> ids = new ArrayList<String>();
for (PartitionKeyRange range : partitionKeyRanges.getQueryIterable()) {
ids.add(range.getId());
}
documentCollection - the document collection.options - the feed options.PartitionKeyRangepublic Collection<PartitionKeyRange> readPartitionKeyRanges(String collectionLink, String query) throws DocumentClientException
collectionLink - the document collection linkquery - the query stringDocumentClientException - from partition key ranges querypublic ResourceResponse<UserDefinedFunction> createUserDefinedFunction(String collectionLink, UserDefinedFunction udf, RequestOptions options) throws DocumentClientException
collectionLink - the collection link.udf - the user defined function.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<UserDefinedFunction> upsertUserDefinedFunction(String collectionLink, UserDefinedFunction udf, RequestOptions options) throws DocumentClientException
collectionLink - the collection link.udf - the user defined function to upsert.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<UserDefinedFunction> replaceUserDefinedFunction(UserDefinedFunction udf, RequestOptions options) throws DocumentClientException
udf - the user defined function.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<UserDefinedFunction> deleteUserDefinedFunction(String udfLink, RequestOptions options) throws DocumentClientException
udfLink - the user defined function link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<UserDefinedFunction> readUserDefinedFunction(String udfLink, RequestOptions options) throws DocumentClientException
udfLink - the user defined function link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<UserDefinedFunction> readUserDefinedFunctions(String collectionLink, FeedOptions options)
collectionLink - the collection link.options - the feed options.public FeedResponse<UserDefinedFunction> queryUserDefinedFunctions(String collectionLink, String query, FeedOptions options)
collectionLink - the collection link.query - the query.options - the feed options.public FeedResponse<UserDefinedFunction> queryUserDefinedFunctions(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
collectionLink - the collection link.querySpec - the SQL query specification.options - the feed options.public ResourceResponse<Attachment> createAttachment(String documentLink, Attachment attachment, RequestOptions options) throws DocumentClientException
documentLink - the document link.attachment - the attachment to create.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Attachment> upsertAttachment(String documentLink, Attachment attachment, RequestOptions options) throws DocumentClientException
documentLink - the document link.attachment - the attachment to upsert.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Attachment> replaceAttachment(Attachment attachment, RequestOptions options) throws DocumentClientException
attachment - the attachment to use.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Attachment> deleteAttachment(String attachmentLink, RequestOptions options) throws DocumentClientException
attachmentLink - the attachment link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Attachment> readAttachment(String attachmentLink, RequestOptions options) throws DocumentClientException
attachmentLink - the attachment link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<Attachment> readAttachments(String documentLink, FeedOptions options)
documentLink - the document link.options - the feed options.public FeedResponse<Attachment> queryAttachments(String documentLink, String query, FeedOptions options)
documentLink - the document link.query - the query.options - the feed options.public FeedResponse<Attachment> queryAttachments(String documentLink, SqlQuerySpec querySpec, FeedOptions options)
documentLink - the document link.querySpec - the SQL query specification.options - the feed options.public ResourceResponse<Attachment> createAttachment(String documentLink, InputStream mediaStream, MediaOptions options) throws DocumentClientException
documentLink - the document link.mediaStream - the media stream for creating the attachment.options - the media options.DocumentClientException - the document client exception.public ResourceResponse<Attachment> upsertAttachment(String documentLink, InputStream mediaStream, MediaOptions options) throws DocumentClientException
documentLink - the document link.mediaStream - the media stream for upserting the attachment.options - the media options.DocumentClientException - the document client exception.public MediaResponse readMedia(String mediaLink) throws DocumentClientException
mediaLink - the media link.DocumentClientException - the document client exception.public MediaResponse updateMedia(String mediaLink, InputStream mediaStream, MediaOptions options) throws DocumentClientException
mediaLink - the media link.mediaStream - the media stream to upload.options - the media options.DocumentClientException - the document client exception.public ResourceResponse<Conflict> readConflict(String conflictLink, RequestOptions options) throws DocumentClientException
conflictLink - the conflict link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<Conflict> readConflicts(String collectionLink, FeedOptions options)
collectionLink - the collection link.options - the feed options.public FeedResponse<Conflict> queryConflicts(String collectionLink, String query, FeedOptions options)
collectionLink - the collection link.query - the query.options - the feed options.public FeedResponse<Conflict> queryConflicts(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
collectionLink - the collection link.querySpec - the SQL query specification.options - the feed options.public ResourceResponse<Conflict> deleteConflict(String conflictLink, RequestOptions options) throws DocumentClientException
conflictLink - the conflict link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<User> createUser(String databaseLink, User user, RequestOptions options) throws DocumentClientException
databaseLink - the database link.user - the user to create.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<User> upsertUser(String databaseLink, User user, RequestOptions options) throws DocumentClientException
databaseLink - the database link.user - the user to upsert.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<User> replaceUser(User user, RequestOptions options) throws DocumentClientException
user - the user to use.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<User> deleteUser(String userLink, RequestOptions options) throws DocumentClientException
userLink - the user link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<User> readUser(String userLink, RequestOptions options) throws DocumentClientException
userLink - the user link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<User> readUsers(String databaseLink, FeedOptions options)
databaseLink - the database link.options - the feed options.public FeedResponse<User> queryUsers(String databaseLink, String query, FeedOptions options)
databaseLink - the database link.query - the query.options - the feed options.public FeedResponse<User> queryUsers(String databaseLink, SqlQuerySpec querySpec, FeedOptions options)
databaseLink - the database link.querySpec - the SQL query specification.options - the feed options.public ResourceResponse<Permission> createPermission(String userLink, Permission permission, RequestOptions options) throws DocumentClientException
userLink - the user link.permission - the permission to create.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Permission> upsertPermission(String userLink, Permission permission, RequestOptions options) throws DocumentClientException
userLink - the user link.permission - the permission to upsert.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Permission> replacePermission(Permission permission, RequestOptions options) throws DocumentClientException
permission - the permission to use.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Permission> deletePermission(String permissionLink, RequestOptions options) throws DocumentClientException
permissionLink - the permission link.options - the request options.DocumentClientException - the document client exception.public ResourceResponse<Permission> readPermission(String permissionLink, RequestOptions options) throws DocumentClientException
permissionLink - the permission link.options - the request options.DocumentClientException - the document client exception.public FeedResponse<Permission> readPermissions(String userLink, FeedOptions options)
userLink - the user link.options - the feed options.public FeedResponse<Permission> queryPermissions(String userLink, String query, FeedOptions options)
userLink - the user link.query - the query.options - the feed options.public FeedResponse<Permission> queryPermissions(String permissionLink, SqlQuerySpec querySpec, FeedOptions options)
permissionLink - the permission link.querySpec - the SQL query specification.options - the feed options.public ResourceResponse<Offer> replaceOffer(Offer offer) throws DocumentClientException
offer - the offer to use.DocumentClientException - the document client exception.public ResourceResponse<Offer> readOffer(String offerLink) throws DocumentClientException
offerLink - the offer link.DocumentClientException - the document client exception.public FeedResponse<Offer> readOffers(FeedOptions options)
options - the feed options.public FeedResponse<Offer> queryOffers(String query, FeedOptions options)
query - the query.options - the feed options.public FeedResponse<Offer> queryOffers(SqlQuerySpec querySpec, FeedOptions options)
querySpec - the query specification.options - the feed options.public DatabaseAccount getDatabaseAccount() throws DocumentClientException
DocumentClientException - the document client exception.public void close()
close in interface AutoCloseableCopyright © 2018. All rights reserved.