/** * Gets the conflictResolutionPolicy that is used for resolving conflicting writes * on documents in different regions, in a collection in the Azure Cosmos DB service. * * @return ConflictResolutionPolicy */ public ConflictResolutionPolicy getConflictResolutionPolicy() { return super.getObject(Constants.Properties.CONFLICT_RESOLUTION_POLICY, ConflictResolutionPolicy.class); }
/** * Gets the content object that contains the details of the offer. * * @return the offer content. */ public JSONObject getContent() { return super.getObject(Constants.Properties.OFFER_CONTENT); }
/** * Sets the Uni that guarantees uniqueness of documents in collection in the Azure Cosmos DB service. * @return UniqueKeyPolicy */ public UniqueKeyPolicy getUniqueKeyPolicy() { // Thread safe lazy initialization for case when collection is cached (and is basically readonly). if (this.uniqueKeyPolicy == null) { this.uniqueKeyPolicy = super.getObject(Constants.Properties.UNIQUE_KEY_POLICY, UniqueKeyPolicy.class); if (this.uniqueKeyPolicy == null) { this.uniqueKeyPolicy = new UniqueKeyPolicy(); } } return this.uniqueKeyPolicy; }
/** * Gets the ReplicationPolicy settings. * * @return the replication policy. */ public ReplicationPolicy getReplicationPolicy() { if (this.replicationPolicy == null) { this.replicationPolicy = super.getObject(Constants.Properties.REPLICATION_POLICY, ReplicationPolicy.class); if (this.replicationPolicy == null) { this.replicationPolicy = new ReplicationPolicy(); } } return this.replicationPolicy; }
/** * Gets the ConsistencyPolicy settings. * * @return the consistency policy. */ public ConsistencyPolicy getConsistencyPolicy() { if (this.consistencyPolicy == null) { this.consistencyPolicy = super.getObject(Constants.Properties.USER_CONSISTENCY_POLICY, ConsistencyPolicy.class); if (this.consistencyPolicy == null) { this.consistencyPolicy = new ConsistencyPolicy(); } } return this.consistencyPolicy; }
/** * Gets the indexing policy. * * @return the indexing policy. */ public IndexingPolicy getIndexingPolicy() { if (this.indexingPolicy == null) { if (super.has(Constants.Properties.INDEXING_POLICY)) { this.indexingPolicy = super.getObject(Constants.Properties.INDEXING_POLICY, IndexingPolicy.class); } else { this.indexingPolicy = new IndexingPolicy(); } } return this.indexingPolicy; }
/** * Gets the collection's partition key definition. * * @return the partition key definition. */ public PartitionKeyDefinition getPartitionKey() { if (super.has(Constants.Properties.PARTITION_KEY)) { return super.getObject(Constants.Properties.PARTITION_KEY, PartitionKeyDefinition.class); } this.setPartitionKey(new PartitionKeyDefinition()); return this.getPartitionKey(); }