Package com.azure.data.cosmos.sync
Class CosmosSyncContainer
- java.lang.Object
-
- com.azure.data.cosmos.sync.CosmosSyncContainer
-
public class CosmosSyncContainer extends Object
Provides synchronous methods for reading, deleting, and replacing existing Containers Provides methods for interacting with child resources (Items, Scripts, Conflicts)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CosmosSyncItemResponse
createItem(Object item)
Create item cosmos sync item response.CosmosSyncItemResponse
createItem(Object item, CosmosItemRequestOptions options)
Create item cosmos sync item response.CosmosSyncContainerResponse
delete()
Delete cosmos sync container response.CosmosSyncContainerResponse
delete(CosmosContainerRequestOptions options)
Delete cosmos sync container response.CosmosSyncItem
getItem(String id, Object partitionKey)
Gets item.CosmosSyncScripts
getScripts()
Gets the cosmos sync scripts.String
id()
Id string.Iterator<FeedResponse<CosmosItemProperties>>
queryChangeFeedItems(ChangeFeedOptions changeFeedOptions)
Query change feed items iterator.Iterator<FeedResponse<CosmosItemProperties>>
queryItems(SqlQuerySpec querySpec, FeedOptions options)
Query items iterator.Iterator<FeedResponse<CosmosItemProperties>>
queryItems(String query, FeedOptions options)
Query items iterator.CosmosSyncContainerResponse
read()
Read cosmos sync container response.CosmosSyncContainerResponse
read(CosmosContainerRequestOptions options)
Read cosmos sync container response.Iterator<FeedResponse<CosmosItemProperties>>
readAllItems(FeedOptions options)
Read all items iterator.Integer
readProvisionedThroughput()
Read provisioned throughput integer.CosmosSyncContainerResponse
replace(CosmosContainerProperties containerProperties)
Replace cosmos sync container response.CosmosSyncContainerResponse
replace(CosmosContainerProperties containerProperties, CosmosContainerRequestOptions options)
Replace cosmos sync container response.Integer
replaceProvisionedThroughput(int requestUnitsPerSecond)
Replace provisioned throughput integer.CosmosSyncItemResponse
upsertItem(Object item)
Upsert item cosmos sync item response.CosmosSyncItemResponse
upsertItem(Object item, CosmosItemRequestOptions options)
Upsert item cosmos sync item response.
-
-
-
Method Detail
-
id
public String id()
Id string.- Returns:
- the string
-
read
public CosmosSyncContainerResponse read() throws CosmosClientException
Read cosmos sync container response.- Returns:
- the cosmos sync container response
- Throws:
CosmosClientException
- the cosmos client exception
-
read
public CosmosSyncContainerResponse read(CosmosContainerRequestOptions options) throws CosmosClientException
Read cosmos sync container response.- Parameters:
options
- the options- Returns:
- the cosmos sync container response
- Throws:
CosmosClientException
- the cosmos client exception
-
delete
public CosmosSyncContainerResponse delete(CosmosContainerRequestOptions options) throws CosmosClientException
Delete cosmos sync container response.- Parameters:
options
- the options- Returns:
- the cosmos sync container response
- Throws:
CosmosClientException
- the cosmos client exception
-
delete
public CosmosSyncContainerResponse delete() throws CosmosClientException
Delete cosmos sync container response.- Returns:
- the cosmos sync container response
- Throws:
CosmosClientException
- the cosmos client exception
-
replace
public CosmosSyncContainerResponse replace(CosmosContainerProperties containerProperties) throws CosmosClientException
Replace cosmos sync container response.- Parameters:
containerProperties
- the container properties- Returns:
- the cosmos sync container response
- Throws:
CosmosClientException
- the cosmos client exception
-
replace
public CosmosSyncContainerResponse replace(CosmosContainerProperties containerProperties, CosmosContainerRequestOptions options) throws CosmosClientException
Replace cosmos sync container response.- Parameters:
containerProperties
- the container propertiesoptions
- the options- Returns:
- the cosmos sync container response
- Throws:
CosmosClientException
- the cosmos client exception
-
readProvisionedThroughput
public Integer readProvisionedThroughput() throws CosmosClientException
Read provisioned throughput integer.- Returns:
- the integer. null response indicates database doesn't have any provisioned RUs
- Throws:
CosmosClientException
- the cosmos client exception
-
replaceProvisionedThroughput
public Integer replaceProvisionedThroughput(int requestUnitsPerSecond) throws CosmosClientException
Replace provisioned throughput integer.- Parameters:
requestUnitsPerSecond
- the request units per second- Returns:
- the integer
- Throws:
CosmosClientException
- the cosmos client exception
-
createItem
public CosmosSyncItemResponse createItem(Object item) throws CosmosClientException
Create item cosmos sync item response.- Parameters:
item
- the item- Returns:
- the cosmos sync item response
- Throws:
CosmosClientException
- the cosmos client exception
-
createItem
public CosmosSyncItemResponse createItem(Object item, CosmosItemRequestOptions options) throws CosmosClientException
Create item cosmos sync item response.- Parameters:
item
- the itemoptions
- the options- Returns:
- the cosmos sync item response
- Throws:
CosmosClientException
- the cosmos client exception
-
upsertItem
public CosmosSyncItemResponse upsertItem(Object item) throws CosmosClientException
Upsert item cosmos sync item response.- Parameters:
item
- the item- Returns:
- the cosmos sync item response
- Throws:
CosmosClientException
- the cosmos client exception
-
upsertItem
public CosmosSyncItemResponse upsertItem(Object item, CosmosItemRequestOptions options) throws CosmosClientException
Upsert item cosmos sync item response.- Parameters:
item
- the itemoptions
- the options- Returns:
- the cosmos sync item response
- Throws:
CosmosClientException
- the cosmos client exception
-
readAllItems
public Iterator<FeedResponse<CosmosItemProperties>> readAllItems(FeedOptions options)
Read all items iterator.- Parameters:
options
- the options- Returns:
- the iterator
-
queryItems
public Iterator<FeedResponse<CosmosItemProperties>> queryItems(String query, FeedOptions options)
Query items iterator.- Parameters:
query
- the queryoptions
- the options- Returns:
- the iterator
-
queryItems
public Iterator<FeedResponse<CosmosItemProperties>> queryItems(SqlQuerySpec querySpec, FeedOptions options)
Query items iterator.- Parameters:
querySpec
- the query specoptions
- the options- Returns:
- the iterator
-
queryChangeFeedItems
public Iterator<FeedResponse<CosmosItemProperties>> queryChangeFeedItems(ChangeFeedOptions changeFeedOptions)
Query change feed items iterator.- Parameters:
changeFeedOptions
- the change feed options- Returns:
- the iterator
-
getItem
public CosmosSyncItem getItem(String id, Object partitionKey)
Gets item.- Parameters:
id
- the idpartitionKey
- the partition key- Returns:
- the item
-
getScripts
public CosmosSyncScripts getScripts()
Gets the cosmos sync scripts.- Returns:
- the cosmos sync scripts
-
-