public final class CosmosContainerProperties extends Object
A database may contain zero or more named containers and each container consists of zero or more JSON items. Being schema-free, the items in a container do not need to share the same structure or fields. Since containers are application resources, they can be authorized using either the master key or resource keys.
Constructor and Description |
---|
CosmosContainerProperties(String id,
PartitionKeyDefinition partitionKeyDefinition)
Constructor
|
CosmosContainerProperties(String id,
String partitionKeyPath)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Integer |
getAnalyticalStoreTimeToLiveInSeconds()
Gets the analytical store time to live in seconds for items in a container from the Azure Cosmos DB service.
|
ChangeFeedPolicy |
getChangeFeedPolicy()
Gets the changeFeedPolicy for this container in the Azure Cosmos DB service.
|
ClientEncryptionPolicy |
getClientEncryptionPolicy()
Gets the ClientEncryptionPolicy that is used for encrypting item fields
|
ConflictResolutionPolicy |
getConflictResolutionPolicy()
Gets the conflictResolutionPolicy that is used for resolving conflicting writes
on items in different regions, in a container in the Azure Cosmos DB service.
|
Integer |
getDefaultTimeToLiveInSeconds()
Gets the container's default time-to-live value.
|
String |
getETag()
Get the entity tag associated with the resource.
|
String |
getId()
Gets the name of the resource.
|
IndexingPolicy |
getIndexingPolicy()
Gets the container's indexing policy.
|
PartitionKeyDefinition |
getPartitionKeyDefinition()
Gets the containers's partition key definition.
|
String |
getResourceId()
Gets the ID associated with the resource.
|
Instant |
getTimestamp()
Get the last modified timestamp associated with the resource.
|
UniqueKeyPolicy |
getUniqueKeyPolicy()
Gets the containers unique key policy
|
CosmosContainerProperties |
setAnalyticalStoreTimeToLiveInSeconds(Integer timeToLive)
Sets the analytical store time to live in seconds for items in a container from the Azure Cosmos DB service.
|
CosmosContainerProperties |
setChangeFeedPolicy(ChangeFeedPolicy value)
Sets the changeFeedPolicy for this container in the Azure Cosmos DB service.
|
CosmosContainerProperties |
setClientEncryptionPolicy(ClientEncryptionPolicy value)
Sets the ClientEncryptionPolicy that is used for encrypting item fields
|
CosmosContainerProperties |
setConflictResolutionPolicy(ConflictResolutionPolicy value)
Sets the conflictResolutionPolicy that is used for resolving conflicting writes
on items in different regions, in a container in the Azure Cosmos DB service.
|
CosmosContainerProperties |
setDefaultTimeToLiveInSeconds(Integer timeToLive)
Sets the container's default time-to-live value.
|
CosmosContainerProperties |
setId(String id)
Sets the name of the resource.
|
CosmosContainerProperties |
setIndexingPolicy(IndexingPolicy indexingPolicy)
Sets the container's indexing policy
|
CosmosContainerProperties |
setPartitionKeyDefinition(PartitionKeyDefinition partitionKeyDefinition)
Sets the containers's partition key definition.
|
CosmosContainerProperties |
setUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy)
Sets the Containers unique key policy
|
public CosmosContainerProperties(String id, String partitionKeyPath)
id
- id of the ContainerpartitionKeyPath
- partition key pathpublic CosmosContainerProperties(String id, PartitionKeyDefinition partitionKeyDefinition)
id
- id of the containerpartitionKeyDefinition
- the PartitionKeyDefinition
public IndexingPolicy getIndexingPolicy()
public CosmosContainerProperties setIndexingPolicy(IndexingPolicy indexingPolicy)
indexingPolicy
- IndexingPolicy
the indexing policypublic UniqueKeyPolicy getUniqueKeyPolicy()
public CosmosContainerProperties setUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy)
uniqueKeyPolicy
- the unique key policypublic PartitionKeyDefinition getPartitionKeyDefinition()
public CosmosContainerProperties setPartitionKeyDefinition(PartitionKeyDefinition partitionKeyDefinition)
partitionKeyDefinition
- the partition key definition.public ConflictResolutionPolicy getConflictResolutionPolicy()
public CosmosContainerProperties setConflictResolutionPolicy(ConflictResolutionPolicy value)
value
- ConflictResolutionPolicy to be used.@Beta(value=V4_12_0, warningText="Preview API - subject to change in non-backwards compatible way") public ChangeFeedPolicy getChangeFeedPolicy()
@Beta(value=V4_12_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosContainerProperties setChangeFeedPolicy(ChangeFeedPolicy value)
value
- ChangeFeedPolicy to be used.public Integer getDefaultTimeToLiveInSeconds()
public CosmosContainerProperties setDefaultTimeToLiveInSeconds(Integer timeToLive)
The default time-to-live value on a container is an optional property. If set, the items within the container expires after the specified number of seconds since their last write time. The value of this property should be one of the following:
null - indicates evaluation of time-to-live is disabled and items within the container will never expire, regardless whether individual items have their time-to-live set.
nonzero positive integer - indicates the default time-to-live value for all items within the container. This value can be overridden by individual items time-to-live value.
-1 - indicates by default all items within the container never expire. This value can be overridden by individual items time-to-live value.
timeToLive
- the default time-to-live value in seconds.public CosmosContainerProperties setAnalyticalStoreTimeToLiveInSeconds(Integer timeToLive)
timeToLive
- the analytical store time to live in seconds.public Integer getAnalyticalStoreTimeToLiveInSeconds()
public String getId()
public CosmosContainerProperties setId(String id)
id
- the name of the resource.CosmosContainerProperties
.public String getResourceId()
public Instant getTimestamp()
public String getETag()
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public ClientEncryptionPolicy getClientEncryptionPolicy()
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosContainerProperties setClientEncryptionPolicy(ClientEncryptionPolicy value)
value
- ClientEncryptionPolicy to be used.Copyright © 2021 Microsoft Corporation. All rights reserved.