AsyncDocumentClient Interface
public interface AsyncDocumentClient
Provides a client-side logical representation of the Azure Cosmos DB database service. This async client is used to configure and execute requests against the service.
AsyncDocumentClient async APIs return rxJava'sObservable
</code> , and so you can use rxJava <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Observable"></xref> functionality. <b>The async <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Observable"></xref> based APIs perform the requested operation only after subscription.</b></p>
The service client encapsulates the endpoint and credentials used to access the Cosmos DB service.
To instantiate you can use the AsyncDocumentClient.Builder
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.setConnectionMode(ConnectionMode.Direct);
AsyncDocumentClient client = new AsyncDocumentClient.Builder()
.withServiceEndpoint(serviceEndpoint)
.withMasterKeyOrResourceToken(masterKey)
.withConnectionPolicy(connectionPolicy)
.withConsistencyLevel(ConsistencyLevel.Session)
.build();
</code></pre></p>
Method Summary
Modifier and Type
Method and Description
void
close()
Close this AsyncDocumentClient instance and cleans up the resources.
Observable<ResourceResponse <Attachment>>
createAttachment(String documentLink, Attachment attachment, RequestOptions options)
Creates an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created attachment. In case of failure the Observable will error.
Observable<ResourceResponse <Attachment>>
createAttachment(String documentLink, InputStream mediaStream, MediaOptions options, RequestOptions requestOptions)
Creates an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created attachment. In case of failure the Observable will error.
Observable<ResourceResponse <DocumentCollection >>
createCollection(String databaseLink, DocumentCollection collection, RequestOptions options)
Creates a document collection.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created collection. In case of failure the Observable will error.
Observable<ResourceResponse <Database>>
createDatabase(Database database, RequestOptions options)
Creates a database.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created database. In case of failure the Observable will error.
Observable<ResourceResponse <Document>>
createDocument(String collectionLink, Object document, RequestOptions options, boolean disableAutomaticIdGeneration)
Creates a document.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created document. In case of failure the Observable will error.
Observable<ResourceResponse <Permission>>
createPermission(String userLink, Permission permission, RequestOptions options)
Creates a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created permission. In case of failure the Observable will error.
Observable<ResourceResponse <StoredProcedure >>
createStoredProcedure(String collectionLink, StoredProcedure storedProcedure, RequestOptions options)
Creates a stored procedure.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created stored procedure. In case of failure the Observable will error.
Observable<ResourceResponse <Trigger>>
createTrigger(String collectionLink, Trigger trigger, RequestOptions options)
Creates a trigger.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created trigger. In case of failure the Observable will error.
Observable<ResourceResponse <User>>
createUser(String databaseLink, User user, RequestOptions options)
Creates a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created user. In case of failure the Observable will error.
Observable<ResourceResponse <UserDefinedFunction >>
createUserDefinedFunction(String collectionLink, UserDefinedFunction udf, RequestOptions options)
Creates a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created user defined function. In case of failure the Observable will error.
Observable<ResourceResponse <Attachment>>
deleteAttachment(String attachmentLink, RequestOptions options)
Deletes an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted attachment. In case of failure the Observable will error.
Observable<ResourceResponse <DocumentCollection >>
deleteCollection(String collectionLink, RequestOptions options)
Deletes a document collection by the collection link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted database. In case of failure the Observable will error.
Observable<ResourceResponse <Conflict>>
deleteConflict(String conflictLink, RequestOptions options)
Deletes a conflict.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted conflict. In case of failure the Observable will error.
Observable<ResourceResponse <Database>>
deleteDatabase(String databaseLink, RequestOptions options)
Deletes a database.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the deleted database. In case of failure the Observable will error.
Observable<ResourceResponse <Document>>
deleteDocument(String documentLink, RequestOptions options)
Deletes a document by the document link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted document. In case of failure the Observable will error.
Observable<ResourceResponse <Permission>>
deletePermission(String permissionLink, RequestOptions options)
Deletes a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted permission. In case of failure the Observable will error.
Observable<ResourceResponse <StoredProcedure >>
deleteStoredProcedure(String storedProcedureLink, RequestOptions options)
Deletes a stored procedure by the stored procedure link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted stored procedure. In case of failure the Observable will error.
Observable<ResourceResponse <Trigger>>
deleteTrigger(String triggerLink, RequestOptions options)
Deletes a trigger.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted trigger. In case of failure the Observable will error.
Observable<ResourceResponse <User>>
deleteUser(String userLink, RequestOptions options)
Deletes a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted user. In case of failure the Observable will error.
Observable<ResourceResponse <UserDefinedFunction >>
deleteUserDefinedFunction(String udfLink, RequestOptions options)
Deletes a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted user defined function. In case of failure the Observable will error.
Observable<StoredProcedureResponse >
executeStoredProcedure(String storedProcedureLink, Object[] procedureParams)
Executes a stored procedure by the stored procedure link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the stored procedure response. In case of failure the Observable will error.
Observable<StoredProcedureResponse >
executeStoredProcedure(String storedProcedureLink, RequestOptions options, Object[] procedureParams)
Executes a stored procedure by the stored procedure link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the stored procedure response. In case of failure the Observable will error.
ConnectionPolicy
getConnectionPolicy()
Gets the connection policy
Observable<DatabaseAccount >
getDatabaseAccount()
Gets database account information.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the database account. In case of failure the Observable will error.
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.
void
monitor(MeterRegistry registry)
Adds a meter registry for reporting Direct TCP metrics
Observable<FeedResponse <Attachment>>
queryAttachments(String documentLink, SqlQuerySpec querySpec, FeedOptions options)
Query for attachments.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained attachments. In case of failure the Observable will error.
Observable<FeedResponse <Attachment>>
queryAttachments(String documentLink, String query, FeedOptions options)
Query for attachments.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained attachments. In case of failure the Observable will error.
Observable<FeedResponse <DocumentCollection >>
queryCollections(String databaseLink, SqlQuerySpec querySpec, FeedOptions options)
Query for document collections in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained collections. In case of failure the Observable will error.
Observable<FeedResponse <DocumentCollection >>
queryCollections(String databaseLink, String query, FeedOptions options)
Query for document collections in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained collections. In case of failure the Observable will error.
Observable<FeedResponse <Conflict>>
queryConflicts(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for conflicts.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained conflicts. In case of failure the Observable will error.
Observable<FeedResponse <Conflict>>
queryConflicts(String collectionLink, String query, FeedOptions options)
Query for conflicts.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained conflicts. In case of failure the Observable will error.
Observable<FeedResponse <Database>>
queryDatabases(SqlQuerySpec querySpec, FeedOptions options)
Query for databases.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained databases. In case of failure the Observable will error.
Observable<FeedResponse <Database>>
queryDatabases(String query, FeedOptions options)
Query for databases.
After subscription the operation will be performed. The Observable will contain one or several feed response of the read databases. In case of failure the Observable will error.
Observable<FeedResponse <Document>>
queryDocumentChangeFeed(String collectionLink, ChangeFeedOptions changeFeedOptions)
Query for documents change feed in a document collection. After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained documents. In case of failure the Observable will error.
Observable<FeedResponse <Document>>
queryDocuments(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for documents in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained documents. In case of failure the Observable will error.
Observable<FeedResponse <Document>>
queryDocuments(String collectionLink, String query, FeedOptions options)
Query for documents in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained documents. In case of failure the Observable will error.
Observable<FeedResponse <Offer>>
queryOffers(SqlQuerySpec querySpec, FeedOptions options)
Query for offers in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of obtained obtained offers. In case of failure the Observable will error.
Observable<FeedResponse <Offer>>
queryOffers(String query, FeedOptions options)
Query for offers in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of obtained obtained offers. In case of failure the Observable will error.
Observable<FeedResponse <Permission>>
queryPermissions(String permissionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for permissions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained permissions. In case of failure the Observable will error.
Observable<FeedResponse <Permission>>
queryPermissions(String permissionLink, String query, FeedOptions options)
Query for permissions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained permissions. In case of failure the Observable will error.
Observable<FeedResponse <StoredProcedure >>
queryStoredProcedures(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for stored procedures in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained stored procedures. In case of failure the Observable will error.
Observable<FeedResponse <StoredProcedure >>
queryStoredProcedures(String collectionLink, String query, FeedOptions options)
Query for stored procedures in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained stored procedures. In case of failure the Observable will error.
Observable<FeedResponse <Trigger>>
queryTriggers(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for triggers.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained triggers. In case of failure the Observable will error.
Observable<FeedResponse <Trigger>>
queryTriggers(String collectionLink, String query, FeedOptions options)
Query for triggers.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained triggers. In case of failure the Observable will error.
Observable<FeedResponse <UserDefinedFunction >>
queryUserDefinedFunctions(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for user defined functions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained user defined functions. In case of failure the Observable will error.
Observable<FeedResponse <UserDefinedFunction >>
queryUserDefinedFunctions(String collectionLink, String query, FeedOptions options)
Query for user defined functions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained user defined functions. In case of failure the Observable will error.
Observable<FeedResponse <User>>
queryUsers(String databaseLink, SqlQuerySpec querySpec, FeedOptions options)
Query for users.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained users. In case of failure the Observable will error.
Observable<FeedResponse <User>>
queryUsers(String databaseLink, String query, FeedOptions options)
Query for users.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained users. In case of failure the Observable will error.
Observable<ResourceResponse <Attachment>>
readAttachment(String attachmentLink, RequestOptions options)
Reads an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read attachment. In case of failure the Observable will error.
Observable<FeedResponse <Attachment>>
readAttachments(String documentLink, FeedOptions options)
Reads all attachments in a document.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read attachments. In case of failure the Observable will error.
Observable<ResourceResponse <DocumentCollection >>
readCollection(String collectionLink, RequestOptions options)
Reads a document collection by the collection link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read collection. In case of failure the Observable will error.
Observable<FeedResponse <DocumentCollection >>
readCollections(String databaseLink, FeedOptions options)
Reads all document collections in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response of the read collections. In case of failure the Observable will error.
Observable<ResourceResponse <Conflict>>
readConflict(String conflictLink, RequestOptions options)
Reads a conflict.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read conflict. In case of failure the Observable will error.
Observable<FeedResponse <Conflict>>
readConflicts(String collectionLink, FeedOptions options)
Reads all conflicts in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read conflicts. In case of failure the Observable will error.
Observable<ResourceResponse <Database>>
readDatabase(String databaseLink, RequestOptions options)
Reads a database.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read database. In case of failure the Observable will error.
Observable<FeedResponse <Database>>
readDatabases(FeedOptions options)
Reads all databases.
After subscription the operation will be performed. The Observable will contain one or several feed response of the read databases. In case of failure the Observable will error.
Observable<ResourceResponse <Document>>
readDocument(String documentLink, RequestOptions options)
Reads a document by the document link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read document. In case of failure the Observable will error.
Observable<FeedResponse <Document>>
readDocuments(String collectionLink, FeedOptions options)
Reads all documents in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response of the read documents. In case of failure the Observable will error.
Observable<MediaResponse >
readMedia(String mediaLink)
Reads a media by the media link.
Observable<ResourceResponse <Offer>>
readOffer(String offerLink)
Reads an offer.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read offer. In case of failure the Observable will error.
Observable<FeedResponse <Offer>>
readOffers(FeedOptions options)
Reads offers.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read offers. In case of failure the Observable will error.
Observable<FeedResponse <PartitionKeyRange >>
readPartitionKeyRanges(String collectionLink, FeedOptions options)
Reads all partition key ranges in a document collection. After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained partition key ranges. In case of failure the Observable will error.
Observable<ResourceResponse <Permission>>
readPermission(String permissionLink, RequestOptions options)
Reads a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read permission. In case of failure the Observable will error.
Observable<FeedResponse <Permission>>
readPermissions(String permissionLink, FeedOptions options)
Reads all permissions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read permissions. In case of failure the Observable will error.
Observable<ResourceResponse <StoredProcedure >>
readStoredProcedure(String storedProcedureLink, RequestOptions options)
Read a stored procedure by the stored procedure link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read stored procedure. In case of failure the Observable will error.
Observable<FeedResponse <StoredProcedure >>
readStoredProcedures(String collectionLink, FeedOptions options)
Reads all stored procedures in a document collection link.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read stored procedures. In case of failure the Observable will error.
Observable<ResourceResponse <Trigger>>
readTrigger(String triggerLink, RequestOptions options)
Reads a trigger by the trigger link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the read trigger. In case of failure the Observable will error.
Observable<FeedResponse <Trigger>>
readTriggers(String collectionLink, FeedOptions options)
Reads all triggers in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read triggers. In case of failure the Observable will error.
Observable<ResourceResponse <User>>
readUser(String userLink, RequestOptions options)
Reads a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read user. In case of failure the Observable will error.
Observable<ResourceResponse <UserDefinedFunction >>
readUserDefinedFunction(String udfLink, RequestOptions options)
Read a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the read user defined function. In case of failure the Observable will error.
Observable<FeedResponse <UserDefinedFunction >>
readUserDefinedFunctions(String collectionLink, FeedOptions options)
Reads all user defined functions in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read user defined functions. In case of failure the Observable will error.
Observable<FeedResponse <User>>
readUsers(String databaseLink, FeedOptions options)
Reads all users in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read users. In case of failure the Observable will error.
Observable<ResourceResponse <Attachment>>
replaceAttachment(Attachment attachment, RequestOptions options)
Replaces an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced attachment. In case of failure the Observable will error.
Observable<ResourceResponse <DocumentCollection >>
replaceCollection(DocumentCollection collection, RequestOptions options)
Replaces a document collection.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced document collection. In case of failure the Observable will error.
Observable<ResourceResponse <Document>>
replaceDocument(Document document, RequestOptions options)
Replaces a document with the passed in document.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced document. In case of failure the Observable will error.
Observable<ResourceResponse <Document>>
replaceDocument(String documentLink, Object document, RequestOptions options)
Replaces a document using a POJO object.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced document. In case of failure the Observable will error.
Observable<ResourceResponse <Offer>>
replaceOffer(Offer offer)
Replaces an offer.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced offer. In case of failure the Observable will error.
Observable<ResourceResponse <Permission>>
replacePermission(Permission permission, RequestOptions options)
Replaces a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced permission. In case of failure the Observable will error.
Observable<ResourceResponse <StoredProcedure >>
replaceStoredProcedure(StoredProcedure storedProcedure, RequestOptions options)
Replaces a stored procedure.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced stored procedure. In case of failure the Observable will error.
Observable<ResourceResponse <Trigger>>
replaceTrigger(Trigger trigger, RequestOptions options)
Replaces a trigger.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced trigger. In case of failure the Observable will error.
Observable<ResourceResponse <User>>
replaceUser(User user, RequestOptions options)
Replaces a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced user. In case of failure the Observable will error.
Observable<ResourceResponse <UserDefinedFunction >>
replaceUserDefinedFunction(UserDefinedFunction udf, RequestOptions options)
Replaces a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced user defined function. In case of failure the Observable will error.
Observable<MediaResponse >
updateMedia(String mediaLink, InputStream mediaStream, MediaOptions options)
Updates a media by the media link.
Observable<ResourceResponse <Attachment>>
upsertAttachment(String documentLink, Attachment attachment, RequestOptions options)
Upserts an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted attachment. In case of failure the Observable will error.
Observable<ResourceResponse <Attachment>>
upsertAttachment(String documentLink, InputStream mediaStream, MediaOptions options, RequestOptions requestOptions)
Upserts an attachment to the media stream
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted attachment. In case of failure the Observable will error.
Observable<ResourceResponse <Document>>
upsertDocument(String collectionLink, Object document, RequestOptions options, boolean disableAutomaticIdGeneration)
Upserts a document.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted document. In case of failure the Observable will error.
Observable<ResourceResponse <Permission>>
upsertPermission(String userLink, Permission permission, RequestOptions options)
Upserts a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted permission. In case of failure the Observable will error.
Observable<ResourceResponse <StoredProcedure >>
upsertStoredProcedure(String collectionLink, StoredProcedure storedProcedure, RequestOptions options)
Upserts a stored procedure.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted stored procedure. In case of failure the Observable will error.
Observable<ResourceResponse <Trigger>>
upsertTrigger(String collectionLink, Trigger trigger, RequestOptions options)
Upserts a trigger.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted trigger. In case of failure the Observable will error.
Observable<ResourceResponse <User>>
upsertUser(String databaseLink, User user, RequestOptions options)
Upserts a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted user. In case of failure the Observable will error.
Observable<ResourceResponse <UserDefinedFunction >>
upsertUserDefinedFunction(String collectionLink, UserDefinedFunction udf, RequestOptions options)
Upserts a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted user defined function. In case of failure the Observable will error.
Method Details
close
public void close()
Close this AsyncDocumentClient instance and cleans up the resources.
createAttachment
public Observable> createAttachment(String documentLink, Attachment attachment, RequestOptions options)
Creates an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created attachment. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
attachment
- the attachment to create.
options
- the request options.
Returns:
an Observable containing the single resource response with the created attachment or an error.
createAttachment
public Observable> createAttachment(String documentLink, InputStream mediaStream, MediaOptions options, RequestOptions requestOptions)
Creates an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created attachment. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
mediaStream
- the media stream for creating the attachment.
options
- the media options.
requestOptions
- the request options
Returns:
an Observable containing the single resource response with the created attachment or an error.
createCollection
public Observable> createCollection(String databaseLink, DocumentCollection collection, RequestOptions options)
Creates a document collection.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created collection. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
collection
- the collection.
options
- the request options.
Returns:
an Observable containing the single resource response with the created collection or an error.
createDatabase
public Observable> createDatabase(Database database, RequestOptions options)
Creates a database.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created database. In case of failure the Observable will error.
Parameters:
database
- the database.
options
- the request options.
Returns:
an Observable containing the single resource response with the created database or an error.
createDocument
public Observable> createDocument(String collectionLink, Object document, RequestOptions options, boolean disableAutomaticIdGeneration)
Creates a document.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created document. In case of failure the Observable will error.
Parameters:
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.
Returns:
an Observable containing the single resource response with the created document or an error.
createPermission
public Observable> createPermission(String userLink, Permission permission, RequestOptions options)
Creates a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created permission. In case of failure the Observable will error.
Parameters:
userLink
- the user link.
permission
- the permission to create.
options
- the request options.
Returns:
an Observable containing the single resource response with the created permission or an error.
createStoredProcedure
public Observable> createStoredProcedure(String collectionLink, StoredProcedure storedProcedure, RequestOptions options)
Creates a stored procedure.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created stored procedure. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
storedProcedure
- the stored procedure to create.
options
- the request options.
Returns:
an Observable containing the single resource response with the created stored procedure or an error.
createTrigger
public Observable> createTrigger(String collectionLink, Trigger trigger, RequestOptions options)
Creates a trigger.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created trigger. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
trigger
- the trigger.
options
- the request options.
Returns:
an Observable containing the single resource response with the created trigger or an error.
createUser
public Observable> createUser(String databaseLink, User user, RequestOptions options)
Creates a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created user. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
user
- the user to create.
options
- the request options.
Returns:
an Observable containing the single resource response with the created user or an error.
createUserDefinedFunction
public Observable> createUserDefinedFunction(String collectionLink, UserDefinedFunction udf, RequestOptions options)
Creates a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the created user defined function. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
udf
- the user defined function.
options
- the request options.
Returns:
an Observable containing the single resource response with the created user defined function or an error.
deleteAttachment
public Observable> deleteAttachment(String attachmentLink, RequestOptions options)
Deletes an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted attachment. In case of failure the Observable will error.
Parameters:
attachmentLink
- the attachment link.
options
- the request options.
Returns:
an Observable containing the single resource response for the deleted attachment or an error.
deleteCollection
public Observable> deleteCollection(String collectionLink, RequestOptions options)
Deletes a document collection by the collection link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted database. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
options
- the request options.
Returns:
an Observable containing the single resource response for the deleted database or an error.
deleteConflict
public Observable> deleteConflict(String conflictLink, RequestOptions options)
Deletes a conflict.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted conflict. In case of failure the Observable will error.
Parameters:
conflictLink
- the conflict link.
options
- the request options.
Returns:
an Observable containing the single resource response for the deleted conflict or an error.
deleteDatabase
public Observable> deleteDatabase(String databaseLink, RequestOptions options)
Deletes a database.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the deleted database. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
options
- the request options.
Returns:
an Observable containing the single resource response with the deleted database or an error.
deleteDocument
public Observable> deleteDocument(String documentLink, RequestOptions options)
Deletes a document by the document link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted document. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
options
- the request options.
Returns:
an Observable containing the single resource response for the deleted document or an error.
deletePermission
public Observable> deletePermission(String permissionLink, RequestOptions options)
Deletes a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted permission. In case of failure the Observable will error.
Parameters:
permissionLink
- the permission link.
options
- the request options.
Returns:
an Observable containing the single resource response for the deleted permission or an error.
deleteStoredProcedure
public Observable> deleteStoredProcedure(String storedProcedureLink, RequestOptions options)
Deletes a stored procedure by the stored procedure link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted stored procedure. In case of failure the Observable will error.
Parameters:
storedProcedureLink
- the stored procedure link.
options
- the request options.
Returns:
an Observable containing the single resource response for the deleted stored procedure or an error.
deleteTrigger
public Observable> deleteTrigger(String triggerLink, RequestOptions options)
Deletes a trigger.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted trigger. In case of failure the Observable will error.
Parameters:
triggerLink
- the trigger link.
options
- the request options.
Returns:
an Observable containing the single resource response for the deleted trigger or an error.
deleteUser
public Observable> deleteUser(String userLink, RequestOptions options)
Deletes a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted user. In case of failure the Observable will error.
Parameters:
userLink
- the user link.
options
- the request options.
Returns:
an Observable containing the single resource response for the deleted user or an error.
deleteUserDefinedFunction
public Observable> deleteUserDefinedFunction(String udfLink, RequestOptions options)
Deletes a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the deleted user defined function. In case of failure the Observable will error.
Parameters:
udfLink
- the user defined function link.
options
- the request options.
Returns:
an Observable containing the single resource response for the deleted user defined function or an error.
executeStoredProcedure
public Observable executeStoredProcedure(String storedProcedureLink, Object[] procedureParams)
Executes a stored procedure by the stored procedure link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the stored procedure response. In case of failure the Observable will error.
Parameters:
storedProcedureLink
- the stored procedure link.
procedureParams
- the array of procedure parameter values.
Returns:
an Observable containing the single resource response with the stored procedure response or an error.
executeStoredProcedure
public Observable executeStoredProcedure(String storedProcedureLink, RequestOptions options, Object[] procedureParams)
Executes a stored procedure by the stored procedure link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the stored procedure response. In case of failure the Observable will error.
Parameters:
storedProcedureLink
- the stored procedure link.
options
- the request options.
procedureParams
- the array of procedure parameter values.
Returns:
an Observable containing the single resource response with the stored procedure response or an error.
getConnectionPolicy
public ConnectionPolicy getConnectionPolicy()
Gets the connection policy
Returns:
the connection policy
getDatabaseAccount
public Observable getDatabaseAccount()
Gets database account information.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the database account. In case of failure the Observable will error.
Returns:
an Observable containing the single resource response with the database account or an error.
getReadEndpoint
public URI getReadEndpoint()
Gets the current read endpoint chosen based on availability and preference.
Returns:
the read endpoint URI
getServiceEndpoint
public URI getServiceEndpoint()
Gets the default service endpoint as passed in by the user during construction.
Returns:
the service endpoint URI
getWriteEndpoint
public URI getWriteEndpoint()
Gets the current write endpoint chosen based on availability and preference.
Returns:
the write endpoint URI
monitor
public static void monitor(MeterRegistry registry)
Adds a meter registry for reporting Direct TCP metrics
Parameters:
registry
- a meter registry to use for reporting Direct TCP metrics
queryAttachments
public Observable> queryAttachments(String documentLink, SqlQuerySpec querySpec, FeedOptions options)
Query for attachments.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained attachments. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained attachments or an error.
queryAttachments
public Observable> queryAttachments(String documentLink, String query, FeedOptions options)
Query for attachments.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained attachments. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained attachments or an error.
queryCollections
public Observable> queryCollections(String databaseLink, SqlQuerySpec querySpec, FeedOptions options)
Query for document collections in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained collections. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained collections or an error.
queryCollections
public Observable> queryCollections(String databaseLink, String query, FeedOptions options)
Query for document collections in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained collections. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained collections or an error.
queryConflicts
public Observable> queryConflicts(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for conflicts.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained conflicts. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained conflicts or an error.
queryConflicts
public Observable> queryConflicts(String collectionLink, String query, FeedOptions options)
Query for conflicts.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained conflicts. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained conflicts or an error.
queryDatabases
public Observable> queryDatabases(SqlQuerySpec querySpec, FeedOptions options)
Query for databases.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained databases. In case of failure the Observable will error.
Parameters:
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained databases or an error.
queryDatabases
public Observable> queryDatabases(String query, FeedOptions options)
Query for databases.
After subscription the operation will be performed. The Observable will contain one or several feed response of the read databases. In case of failure the Observable will error.
Parameters:
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of read databases or an error.
queryDocumentChangeFeed
public Observable> queryDocumentChangeFeed(String collectionLink, ChangeFeedOptions changeFeedOptions)
Query for documents change feed in a document collection. After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained documents. In case of failure the Observable will error.
Parameters:
collectionLink
- the link to the parent document collection.
changeFeedOptions
- the change feed options.
Returns:
an Observable containing one or several feed response pages of the obtained documents or an error.
queryDocuments
public Observable> queryDocuments(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for documents in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained documents. In case of failure the Observable will error.
Parameters:
collectionLink
- the link to the parent document collection.
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained documents or an error.
queryDocuments
public Observable> queryDocuments(String collectionLink, String query, FeedOptions options)
Query for documents in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response of the obtained documents. In case of failure the Observable will error.
Parameters:
collectionLink
- the link to the parent document collection.
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained document or an error.
queryOffers
public Observable> queryOffers(SqlQuerySpec querySpec, FeedOptions options)
Query for offers in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of obtained obtained offers. In case of failure the Observable will error.
Parameters:
querySpec
- the query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained offers or an error.
queryOffers
public Observable> queryOffers(String query, FeedOptions options)
Query for offers in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of obtained obtained offers. In case of failure the Observable will error.
Parameters:
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained offers or an error.
queryPermissions
public Observable> queryPermissions(String permissionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for permissions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained permissions. In case of failure the Observable will error.
Parameters:
permissionLink
- the permission link.
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained permissions or an error.
queryPermissions
public Observable> queryPermissions(String permissionLink, String query, FeedOptions options)
Query for permissions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained permissions. In case of failure the Observable will error.
Parameters:
permissionLink
- the permission link.
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained permissions or an error.
queryStoredProcedures
public Observable> queryStoredProcedures(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for stored procedures in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained stored procedures. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained stored procedures or an error.
queryStoredProcedures
public Observable> queryStoredProcedures(String collectionLink, String query, FeedOptions options)
Query for stored procedures in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained stored procedures. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained stored procedures or an error.
queryTriggers
public Observable> queryTriggers(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for triggers.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained triggers. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained triggers or an error.
queryTriggers
public Observable> queryTriggers(String collectionLink, String query, FeedOptions options)
Query for triggers.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained triggers. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained triggers or an error.
queryUserDefinedFunctions
public Observable> queryUserDefinedFunctions(String collectionLink, SqlQuerySpec querySpec, FeedOptions options)
Query for user defined functions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained user defined functions. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained user defined functions or an error.
queryUserDefinedFunctions
public Observable> queryUserDefinedFunctions(String collectionLink, String query, FeedOptions options)
Query for user defined functions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained user defined functions. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained user defined functions or an error.
queryUsers
public Observable> queryUsers(String databaseLink, SqlQuerySpec querySpec, FeedOptions options)
Query for users.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained users. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
querySpec
- the SQL query specification.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained users or an error.
queryUsers
public Observable> queryUsers(String databaseLink, String query, FeedOptions options)
Query for users.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained users. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
query
- the query.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained users or an error.
readAttachment
public Observable> readAttachment(String attachmentLink, RequestOptions options)
Reads an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read attachment. In case of failure the Observable will error.
Parameters:
attachmentLink
- the attachment link.
options
- the request options.
Returns:
an Observable containing the single resource response with the read attachment or an error.
readAttachments
public Observable> readAttachments(String documentLink, FeedOptions options)
Reads all attachments in a document.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read attachments. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the read attachments or an error.
readCollection
public Observable> readCollection(String collectionLink, RequestOptions options)
Reads a document collection by the collection link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read collection. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
options
- the request options.
Returns:
an Observable containing the single resource response with the read collection or an error.
readCollections
public Observable> readCollections(String databaseLink, FeedOptions options)
Reads all document collections in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response of the read collections. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
options
- the fee options.
Returns:
an Observable containing one or several feed response pages of the read collections or an error.
readConflict
public Observable> readConflict(String conflictLink, RequestOptions options)
Reads a conflict.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read conflict. In case of failure the Observable will error.
Parameters:
conflictLink
- the conflict link.
options
- the request options.
Returns:
an Observable containing the single resource response with the read conflict or an error.
readConflicts
public Observable> readConflicts(String collectionLink, FeedOptions options)
Reads all conflicts in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read conflicts. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the read conflicts or an error.
readDatabase
public Observable> readDatabase(String databaseLink, RequestOptions options)
Reads a database.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read database. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
options
- the request options.
Returns:
an Observable containing the single resource response with the read database or an error.
readDatabases
public Observable> readDatabases(FeedOptions options)
Reads all databases.
After subscription the operation will be performed. The Observable will contain one or several feed response of the read databases. In case of failure the Observable will error.
Parameters:
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of read databases or an error.
readDocument
public Observable> readDocument(String documentLink, RequestOptions options)
Reads a document by the document link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read document. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
options
- the request options.
Returns:
an Observable containing the single resource response with the read document or an error.
readDocuments
public Observable> readDocuments(String collectionLink, FeedOptions options)
Reads all documents in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response of the read documents. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the read documents or an error.
readMedia
public Observable readMedia(String mediaLink)
Reads a media by the media link.
Parameters:
mediaLink
- the media link.
Returns:
the media response.
readOffer
public Observable> readOffer(String offerLink)
Reads an offer.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read offer. In case of failure the Observable will error.
Parameters:
offerLink
- the offer link.
Returns:
an Observable containing the single resource response with the read offer or an error.
readOffers
public Observable> readOffers(FeedOptions options)
Reads offers.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read offers. In case of failure the Observable will error.
Parameters:
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the read offers or an error.
readPartitionKeyRanges
public Observable> readPartitionKeyRanges(String collectionLink, FeedOptions options)
Reads all partition key ranges in a document collection. After subscription the operation will be performed. The Observable will contain one or several feed response pages of the obtained partition key ranges. In case of failure the Observable will error.
Parameters:
collectionLink
- the link to the parent document collection.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the obtained partition key ranges or an error.
readPermission
public Observable> readPermission(String permissionLink, RequestOptions options)
Reads a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read permission. In case of failure the Observable will error.
Parameters:
permissionLink
- the permission link.
options
- the request options.
Returns:
an Observable containing the single resource response with the read permission or an error.
readPermissions
public Observable> readPermissions(String permissionLink, FeedOptions options)
Reads all permissions.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read permissions. In case of failure the Observable will error.
Parameters:
permissionLink
- the permission link.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the read permissions or an error.
readStoredProcedure
public Observable> readStoredProcedure(String storedProcedureLink, RequestOptions options)
Read a stored procedure by the stored procedure link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read stored procedure. In case of failure the Observable will error.
Parameters:
storedProcedureLink
- the stored procedure link.
options
- the request options.
Returns:
an Observable containing the single resource response with the read stored procedure or an error.
readStoredProcedures
public Observable> readStoredProcedures(String collectionLink, FeedOptions options)
Reads all stored procedures in a document collection link.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read stored procedures. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the read stored procedures or an error.
readTrigger
public Observable> readTrigger(String triggerLink, RequestOptions options)
Reads a trigger by the trigger link.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the read trigger. In case of failure the Observable will error.
Parameters:
triggerLink
- the trigger link.
options
- the request options.
Returns:
an Observable containing the single resource response for the read trigger or an error.
readTriggers
public Observable> readTriggers(String collectionLink, FeedOptions options)
Reads all triggers in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read triggers. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the read triggers or an error.
readUser
public Observable> readUser(String userLink, RequestOptions options)
Reads a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the read user. In case of failure the Observable will error.
Parameters:
userLink
- the user link.
options
- the request options.
Returns:
an Observable containing the single resource response with the read user or an error.
readUserDefinedFunction
public Observable> readUserDefinedFunction(String udfLink, RequestOptions options)
Read a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response for the read user defined function. In case of failure the Observable will error.
Parameters:
udfLink
- the user defined function link.
options
- the request options.
Returns:
an Observable containing the single resource response for the read user defined function or an error.
readUserDefinedFunctions
public Observable> readUserDefinedFunctions(String collectionLink, FeedOptions options)
Reads all user defined functions in a document collection.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read user defined functions. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the read user defined functions or an error.
readUsers
public Observable> readUsers(String databaseLink, FeedOptions options)
Reads all users in a database.
After subscription the operation will be performed. The Observable will contain one or several feed response pages of the read users. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
options
- the feed options.
Returns:
an Observable containing one or several feed response pages of the read users or an error.
replaceAttachment
public Observable> replaceAttachment(Attachment attachment, RequestOptions options)
Replaces an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced attachment. In case of failure the Observable will error.
Parameters:
attachment
- the attachment to use.
options
- the request options.
Returns:
an Observable containing the single resource response with the replaced attachment or an error.
replaceCollection
public Observable> replaceCollection(DocumentCollection collection, RequestOptions options)
Replaces a document collection.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced document collection. In case of failure the Observable will error.
Parameters:
collection
- the document collection to use.
options
- the request options.
Returns:
an Observable containing the single resource response with the replaced document collection or an error.
replaceDocument
public Observable> replaceDocument(Document document, RequestOptions options)
Replaces a document with the passed in document.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced document. In case of failure the Observable will error.
Parameters:
document
- the document to replace (containing the document id).
options
- the request options.
Returns:
an Observable containing the single resource response with the replaced document or an error.
replaceDocument
public Observable> replaceDocument(String documentLink, Object document, RequestOptions options)
Replaces a document using a POJO object.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced document. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
document
- the document represented as a POJO or Document object.
options
- the request options.
Returns:
an Observable containing the single resource response with the replaced document or an error.
replaceOffer
public Observable> replaceOffer(Offer offer)
Replaces an offer.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced offer. In case of failure the Observable will error.
Parameters:
offer
- the offer to use.
Returns:
an Observable containing the single resource response with the replaced offer or an error.
replacePermission
public Observable> replacePermission(Permission permission, RequestOptions options)
Replaces a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced permission. In case of failure the Observable will error.
Parameters:
permission
- the permission to use.
options
- the request options.
Returns:
an Observable containing the single resource response with the replaced permission or an error.
replaceStoredProcedure
public Observable> replaceStoredProcedure(StoredProcedure storedProcedure, RequestOptions options)
Replaces a stored procedure.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced stored procedure. In case of failure the Observable will error.
Parameters:
storedProcedure
- the stored procedure to use.
options
- the request options.
Returns:
an Observable containing the single resource response with the replaced stored procedure or an error.
replaceTrigger
public Observable> replaceTrigger(Trigger trigger, RequestOptions options)
Replaces a trigger.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced trigger. In case of failure the Observable will error.
Parameters:
trigger
- the trigger to use.
options
- the request options.
Returns:
an Observable containing the single resource response with the replaced trigger or an error.
replaceUser
public Observable> replaceUser(User user, RequestOptions options)
Replaces a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced user. In case of failure the Observable will error.
Parameters:
user
- the user to use.
options
- the request options.
Returns:
an Observable containing the single resource response with the replaced user or an error.
replaceUserDefinedFunction
public Observable> replaceUserDefinedFunction(UserDefinedFunction udf, RequestOptions options)
Replaces a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the replaced user defined function. In case of failure the Observable will error.
Parameters:
udf
- the user defined function.
options
- the request options.
Returns:
an Observable containing the single resource response with the replaced user defined function or an error.
updateMedia
public Observable updateMedia(String mediaLink, InputStream mediaStream, MediaOptions options)
Updates a media by the media link.
Parameters:
mediaLink
- the media link.
mediaStream
- the media stream to upload.
options
- the media options.
Returns:
the media response.
upsertAttachment
public Observable> upsertAttachment(String documentLink, Attachment attachment, RequestOptions options)
Upserts an attachment.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted attachment. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
attachment
- the attachment to upsert.
options
- the request options.
Returns:
an Observable containing the single resource response with the upserted attachment or an error.
upsertAttachment
public Observable> upsertAttachment(String documentLink, InputStream mediaStream, MediaOptions options, RequestOptions requestOptions)
Upserts an attachment to the media stream
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted attachment. In case of failure the Observable will error.
Parameters:
documentLink
- the document link.
mediaStream
- the media stream for upserting the attachment.
options
- the media options.
requestOptions
- the request options
Returns:
an Observable containing the single resource response with the upserted attachment or an error.
upsertDocument
public Observable> upsertDocument(String collectionLink, Object document, RequestOptions options, boolean disableAutomaticIdGeneration)
Upserts a document.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted document. In case of failure the Observable will error.
Parameters:
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.
Returns:
an Observable containing the single resource response with the upserted document or an error.
upsertPermission
public Observable> upsertPermission(String userLink, Permission permission, RequestOptions options)
Upserts a permission.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted permission. In case of failure the Observable will error.
Parameters:
userLink
- the user link.
permission
- the permission to upsert.
options
- the request options.
Returns:
an Observable containing the single resource response with the upserted permission or an error.
upsertStoredProcedure
public Observable> upsertStoredProcedure(String collectionLink, StoredProcedure storedProcedure, RequestOptions options)
Upserts a stored procedure.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted stored procedure. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
storedProcedure
- the stored procedure to upsert.
options
- the request options.
Returns:
an Observable containing the single resource response with the upserted stored procedure or an error.
upsertTrigger
public Observable> upsertTrigger(String collectionLink, Trigger trigger, RequestOptions options)
Upserts a trigger.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted trigger. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
trigger
- the trigger to upsert.
options
- the request options.
Returns:
an Observable containing the single resource response with the upserted trigger or an error.
upsertUser
public Observable> upsertUser(String databaseLink, User user, RequestOptions options)
Upserts a user.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted user. In case of failure the Observable will error.
Parameters:
databaseLink
- the database link.
user
- the user to upsert.
options
- the request options.
Returns:
an Observable containing the single resource response with the upserted user or an error.
upsertUserDefinedFunction
public Observable> upsertUserDefinedFunction(String collectionLink, UserDefinedFunction udf, RequestOptions options)
Upserts a user defined function.
After subscription the operation will be performed. The Observable upon successful completion will contain a single resource response with the upserted user defined function. In case of failure the Observable will error.
Parameters:
collectionLink
- the collection link.
udf
- the user defined function to upsert.
options
- the request options.
Returns:
an Observable containing the single resource response with the upserted user defined function or an error.
Applies to
Azure SDK for Java