Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
* Represents the connection mode to be used by the client in the Azure Cosmos DB database service.
* <p>
* DIRECT and GATEWAY connectivity modes are supported. DIRECT is the default.
* Refer to &lt;see&gt;http://azure.microsoft.com/documentation/articles/documentdb-
* interactions-with-resources/#connectivity-options&lt;/see&gt; for additional
* details.
* </p>
*/
public enum ConnectionMode {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* <p>
* The requested ConsistencyLevel must match or be weaker than that provisioned for the database account. Consistency
* levels by order of strength are STRONG, BOUNDED_STALENESS, SESSION and EVENTUAL.
*
* Refer to consistency level documentation for additional details: https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels
*/
public enum ConsistencyLevel {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.cosmos.models;
package com.azure.cosmos.implementation;


import com.azure.cosmos.ConsistencyLevel;
import com.azure.cosmos.implementation.Constants;
import com.azure.cosmos.implementation.JsonSerializable;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.azure.cosmos.implementation.guava25.base.CaseFormat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
package com.azure.cosmos.implementation;

import com.azure.cosmos.BridgeInternal;
import com.azure.cosmos.models.ConsistencyPolicy;
import com.azure.cosmos.models.DatabaseAccountLocation;
import com.azure.cosmos.models.ModelBridgeInternal;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.azure.cosmos.implementation.apachecommons.lang.ObjectUtils;
Expand Down Expand Up @@ -273,7 +271,7 @@ public void setEnableMultipleWriteLocations(boolean value) {
public void populatePropertyBag() {
super.populatePropertyBag();
if (this.consistencyPolicy != null) {
ModelBridgeInternal.populatePropertyBag(this.consistencyPolicy);
this.consistencyPolicy.populatePropertyBag();
BridgeInternal.setProperty(this, Constants.Properties.USER_CONSISTENCY_POLICY, this.consistencyPolicy);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import com.azure.cosmos.models.CompositePath;
import com.azure.cosmos.models.ConflictResolutionPolicy;
import com.azure.cosmos.models.ConsistencyPolicy;
import com.azure.cosmos.models.CosmosError;
import com.azure.cosmos.models.DatabaseAccountLocation;
import com.azure.cosmos.models.ExcludedPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,24 +147,6 @@ public static ConflictResolutionPolicy createCustomPolicy() {
this.jsonSerializable = new JsonSerializable();
}

/**
* Instantiates a new Conflict resolution policy.
*
* @param jsonString the json string
*/
public ConflictResolutionPolicy(String jsonString) {
this.jsonSerializable = new JsonSerializable(jsonString);
}

/**
* Instantiates a new Conflict resolution policy.
*
* @param objectNode the object node.
*/
ConflictResolutionPolicy(ObjectNode objectNode) {
this.jsonSerializable = new JsonSerializable(objectNode);
}

/**
* Gets the {@link ConflictResolutionMode} in the Azure Cosmos DB service.
* By default it is {@link ConflictResolutionMode#LAST_WRITER_WINS}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.azure.cosmos.CosmosTrigger;
import com.azure.cosmos.CosmosUserDefinedFunction;
import com.azure.cosmos.implementation.Conflict;
import com.azure.cosmos.implementation.ConsistencyPolicy;
import com.azure.cosmos.implementation.CosmosItemProperties;
import com.azure.cosmos.implementation.CosmosResourceType;
import com.azure.cosmos.implementation.Database;
Expand Down Expand Up @@ -615,8 +616,6 @@ public static <T> void populatePropertyBag(T t) {
((CompositePath) t).populatePropertyBag();
} else if (t instanceof ConflictResolutionPolicy) {
((ConflictResolutionPolicy) t).populatePropertyBag();
} else if (t instanceof ConsistencyPolicy) {
((ConsistencyPolicy) t).populatePropertyBag();
} else if (t instanceof DatabaseAccountLocation) {
((DatabaseAccountLocation) t).populatePropertyBag();
} else if (t instanceof ExcludedPath) {
Expand Down Expand Up @@ -652,8 +651,6 @@ public static <T> JsonSerializable getJsonSerializable(T t) {
return ((CompositePath) t).getJsonSerializable();
} else if (t instanceof ConflictResolutionPolicy) {
return ((ConflictResolutionPolicy) t).getJsonSerializable();
} else if (t instanceof ConsistencyPolicy) {
return ((ConsistencyPolicy) t).getJsonSerializable();
} else if (t instanceof DatabaseAccountLocation) {
return ((DatabaseAccountLocation) t).getJsonSerializable();
} else if (t instanceof ExcludedPath) {
Expand Down