CosmosContainerProperties Class
- java.
lang. Object - com.
azure. cosmos. models. CosmosContainerProperties
- com.
public final class CosmosContainerProperties
Represents a container in the Azure Cosmos DB database service. A cosmos container is a named logical container for cosmos items.
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 Summary
Constructor | Description |
---|---|
CosmosContainerProperties(String id, PartitionKeyDefinition partitionKeyDefinition) |
Constructor |
CosmosContainerProperties(String id, String partitionKeyPath) |
Constructor |
Method Summary
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. |
Change |
getChangeFeedPolicy()
Gets the change |
Client |
getClientEncryptionPolicy()
Gets the Client |
Collection<Computed |
getComputedProperties()
Gets the computed |
Conflict |
getConflictResolutionPolicy()
Gets the conflict |
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. |
Indexing |
getIndexingPolicy()
Gets the container's indexing policy. |
Partition |
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. |
Unique |
getUniqueKeyPolicy()
Gets the containers unique key policy |
Cosmos |
getVectorEmbeddingPolicy()
Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item used in performing vector search on the items in a collection in the Azure CosmosDB database service. |
Cosmos |
setAnalyticalStoreTimeToLiveInSeconds(Integer timeToLive)
Sets the analytical store time to live in seconds for items in a container from the Azure Cosmos DB service. |
Cosmos |
setChangeFeedPolicy(ChangeFeedPolicy value)
Sets the change |
Cosmos |
setClientEncryptionPolicy(ClientEncryptionPolicy value)
Sets the Client |
Cosmos |
setComputedProperties(Collection<ComputedProperty> computedProperties)
Sets the computed |
Cosmos |
setConflictResolutionPolicy(ConflictResolutionPolicy value)
Sets the conflict |
Cosmos |
setDefaultTimeToLiveInSeconds(Integer timeToLive)
Sets the container's default time-to-live value. |
Cosmos |
setId(String id)
Sets the name of the resource. |
Cosmos |
setIndexingPolicy(IndexingPolicy indexingPolicy)
Sets the container's indexing policy |
Cosmos |
setPartitionKeyDefinition(PartitionKeyDefinition partitionKeyDefinition)
Sets the containers's partition key definition. |
Cosmos |
setUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy)
Sets the Containers unique key policy |
Cosmos |
setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value)
Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item used in performing vector search on the items in a collection in the Azure CosmosDB database service. |
Methods inherited from java.lang.Object
Constructor Details
CosmosContainerProperties
public CosmosContainerProperties(String id, PartitionKeyDefinition partitionKeyDefinition)
Constructor
Parameters:
CosmosContainerProperties
public CosmosContainerProperties(String id, String partitionKeyPath)
Constructor
Parameters:
Method Details
getAnalyticalStoreTimeToLiveInSeconds
public Integer getAnalyticalStoreTimeToLiveInSeconds()
Gets the analytical store time to live in seconds for items in a container from the Azure Cosmos DB service. It is an optional property. A valid value must be either a nonzero positive integer, '-1', or 0. By default, AnalyticalStoreTimeToLive is set to 0 meaning the analytical store is turned off for the container; -1 means items in analytical store never expire. The unit of measurement is seconds. The maximum allowed value is 2147483647.
Returns:
getChangeFeedPolicy
public ChangeFeedPolicy getChangeFeedPolicy()
Gets the changeFeedPolicy for this container in the Azure Cosmos DB service.
Returns:
getClientEncryptionPolicy
public ClientEncryptionPolicy getClientEncryptionPolicy()
Gets the ClientEncryptionPolicy that is used for encrypting item fields
Returns:
getComputedProperties
public Collection
Gets the computedProperties for this container in the Azure Cosmos DB service.
Returns:
getConflictResolutionPolicy
public 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.
Returns:
getDefaultTimeToLiveInSeconds
public Integer getDefaultTimeToLiveInSeconds()
Gets the container's default time-to-live value.
Returns:
getETag
public String getETag()
Get the entity tag associated with the resource. This is only relevant when getting response from the server.
Returns:
getId
public String getId()
Gets the name of the resource.
Returns:
getIndexingPolicy
public IndexingPolicy getIndexingPolicy()
Gets the container's indexing policy.
Returns:
getPartitionKeyDefinition
public PartitionKeyDefinition getPartitionKeyDefinition()
Gets the containers's partition key definition.
Returns:
getResourceId
public String getResourceId()
Gets the ID associated with the resource.
Returns:
getTimestamp
public Instant getTimestamp()
Get the last modified timestamp associated with the resource. This is only relevant when getting response from the server.
Returns:
getUniqueKeyPolicy
public UniqueKeyPolicy getUniqueKeyPolicy()
Gets the containers unique key policy
Returns:
getVectorEmbeddingPolicy
public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy()
Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item used in performing vector search on the items in a collection in the Azure CosmosDB database service.
Returns:
setAnalyticalStoreTimeToLiveInSeconds
public CosmosContainerProperties setAnalyticalStoreTimeToLiveInSeconds(Integer timeToLive)
Sets the analytical store time to live in seconds for items in a container from the Azure Cosmos DB service. It is an optional property. A valid value must be either a nonzero positive integer, '-1', or 0. By default, AnalyticalStoreTimeToLive is set to 0 meaning the analytical store is turned off for the container; -1 means items in analytical store never expire. The unit of measurement is seconds. The maximum allowed value is 2147483647.
Parameters:
Returns:
setChangeFeedPolicy
public CosmosContainerProperties setChangeFeedPolicy(ChangeFeedPolicy value)
Sets the changeFeedPolicy for this container in the Azure Cosmos DB service.
Parameters:
Returns:
setClientEncryptionPolicy
public CosmosContainerProperties setClientEncryptionPolicy(ClientEncryptionPolicy value)
Sets the ClientEncryptionPolicy that is used for encrypting item fields
Parameters:
Returns:
setComputedProperties
public CosmosContainerProperties setComputedProperties(Collection
Sets the computedProperties for this container in the Azure Cosmos DB service. For more information on how to use computed properties visit Computed Properties in Azure Cosmos DB
Parameters:
Returns:
setConflictResolutionPolicy
public 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.
Parameters:
Returns:
setDefaultTimeToLiveInSeconds
public CosmosContainerProperties setDefaultTimeToLiveInSeconds(Integer timeToLive)
Sets the container's default time-to-live value.
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.
Parameters:
Returns:
setId
public CosmosContainerProperties setId(String id)
Sets the name of the resource.
Parameters:
Returns:
setIndexingPolicy
public CosmosContainerProperties setIndexingPolicy(IndexingPolicy indexingPolicy)
Sets the container's indexing policy
Parameters:
Returns:
setPartitionKeyDefinition
public CosmosContainerProperties setPartitionKeyDefinition(PartitionKeyDefinition partitionKeyDefinition)
Sets the containers's partition key definition.
Parameters:
Returns:
setUniqueKeyPolicy
public CosmosContainerProperties setUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy)
Sets the Containers unique key policy
Parameters:
Returns:
setVectorEmbeddingPolicy
public CosmosContainerProperties setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value)
Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item used in performing vector search on the items in a collection in the Azure CosmosDB database service.
Parameters:
Returns:
Applies to
Azure SDK for Java