* {@code
* ChangeFeedProcessor changeFeedProcessor = ChangeFeedProcessor.Builder()
- * .hostName(hostName)
- * .feedContainer(feedContainer)
- * .leaseContainer(leaseContainer)
- * .handleChanges(docs -> {
+ * .setHostName(setHostName)
+ * .setFeedContainer(setFeedContainer)
+ * .setLeaseContainer(setLeaseContainer)
+ * .setHandleChanges(docs -> {
* // Implementation for handling and processing CosmosItemProperties list goes here
* })
- * .build();
+ * .buildAsyncClient();
* }
*/
public interface ChangeFeedProcessor {
@@ -52,19 +52,19 @@ public interface ChangeFeedProcessor {
Mono
* {@code
*
* ChangeFeedProcessor.Builder()
- * .hostName("SampleHost")
- * .feedContainer(feedContainer)
- * .leaseContainer(leaseContainer)
- * .handleChanges(docs -> {
+ * .setHostName("SampleHost")
+ * .setFeedContainer(setFeedContainer)
+ * .setLeaseContainer(setLeaseContainer)
+ * .setHandleChanges(docs -> {
* // Implementation for handling and processing CosmosItemProperties list goes here
* })
- * .build();
+ * .buildAsyncClient();
* }
*
* @return a builder definition instance.
@@ -83,15 +83,15 @@ interface BuilderDefinition {
* @param hostName the name to be used for the host. When using multiple hosts, each host must have a unique name.
* @return current Builder.
*/
- BuilderDefinition hostName(String hostName);
+ BuilderDefinition setHostName(String hostName);
/**
- * Sets and existing {@link CosmosContainer} to be used to read from the monitored collection.
+ * Sets and existing {@link CosmosAsyncContainer} to be used to read from the monitored collection.
*
- * @param feedContainer the instance of {@link CosmosContainer} to be used.
+ * @param feedContainer the instance of {@link CosmosAsyncContainer} to be used.
* @return current Builder.
*/
- BuilderDefinition feedContainer(CosmosContainer feedContainer);
+ BuilderDefinition setFeedContainer(CosmosAsyncContainer feedContainer);
/**
* Sets the {@link ChangeFeedProcessorOptions} to be used.
@@ -107,7 +107,7 @@ interface BuilderDefinition {
* @param changeFeedProcessorOptions the change feed processor options to use.
* @return current Builder.
*/
- BuilderDefinition options(ChangeFeedProcessorOptions changeFeedProcessorOptions);
+ BuilderDefinition setOptions(ChangeFeedProcessorOptions changeFeedProcessorOptions);
/**
* Sets a consumer function which will be called to process changes.
@@ -115,15 +115,15 @@ interface BuilderDefinition {
* @param consumer the consumer of {@link ChangeFeedObserver} to call for handling the feeds.
* @return current Builder.
*/
- BuilderDefinition handleChanges(Consumer> consumer);
+ BuilderDefinition setHandleChanges(Consumer
> consumer);
/**
- * Sets an existing {@link CosmosContainer} to be used to read from the leases collection.
+ * Sets an existing {@link CosmosAsyncContainer} to be used to read from the leases collection.
*
- * @param leaseContainer the instance of {@link CosmosContainer} to use.
+ * @param leaseContainer the instance of {@link CosmosAsyncContainer} to use.
* @return current Builder.
*/
- BuilderDefinition leaseContainer(CosmosContainer leaseContainer);
+ BuilderDefinition setLeaseContainer(CosmosAsyncContainer leaseContainer);
/**
* Builds a new instance of the {@link ChangeFeedProcessor} with the specified configuration asynchronously.
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ChangeFeedProcessorOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ChangeFeedProcessorOptions.java
similarity index 88%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ChangeFeedProcessorOptions.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ChangeFeedProcessorOptions.java
index 6d2686bba32f..fcca233c881d 100644
--- a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ChangeFeedProcessorOptions.java
+++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ChangeFeedProcessorOptions.java
@@ -43,7 +43,7 @@ public ChangeFeedProcessorOptions() {
*
* @return the renew interval for all leases for partitions.
*/
- public Duration leaseRenewInterval() {
+ public Duration getLeaseRenewInterval() {
return this.leaseRenewInterval;
}
@@ -53,7 +53,7 @@ public Duration leaseRenewInterval() {
* @param leaseRenewInterval the renew interval for all leases for partitions currently held by {@link ChangeFeedProcessor} instance.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions leaseRenewInterval(Duration leaseRenewInterval) {
+ public ChangeFeedProcessorOptions setLeaseRenewInterval(Duration leaseRenewInterval) {
this.leaseRenewInterval = leaseRenewInterval;
return this;
}
@@ -63,7 +63,7 @@ public ChangeFeedProcessorOptions leaseRenewInterval(Duration leaseRenewInterval
*
* @return the interval to kick off a task to compute if partitions are distributed evenly among known host instances.
*/
- public Duration leaseAcquireInterval() {
+ public Duration getLeaseAcquireInterval() {
return this.leaseAcquireInterval;
}
@@ -72,7 +72,7 @@ public Duration leaseAcquireInterval() {
* @param leaseAcquireInterval he interval to kick off a task to compute if partitions are distributed evenly among known host instances.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions leaseAcquireInterval(Duration leaseAcquireInterval) {
+ public ChangeFeedProcessorOptions setLeaseAcquireInterval(Duration leaseAcquireInterval) {
this.leaseAcquireInterval = leaseAcquireInterval;
return this;
}
@@ -86,7 +86,7 @@ public ChangeFeedProcessorOptions leaseAcquireInterval(Duration leaseAcquireInte
*
* @return the interval for which the lease is taken on a lease representing a partition.
*/
- public Duration leaseExpirationInterval() {
+ public Duration getLeaseExpirationInterval() {
return this.leaseExpirationInterval;
}
@@ -100,7 +100,7 @@ public Duration leaseExpirationInterval() {
* @param leaseExpirationInterval the interval for which the lease is taken on a lease representing a partition.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions leaseExpirationInterval(Duration leaseExpirationInterval) {
+ public ChangeFeedProcessorOptions setLeaseExpirationInterval(Duration leaseExpirationInterval) {
this.leaseExpirationInterval = leaseExpirationInterval;
return this;
}
@@ -110,7 +110,7 @@ public ChangeFeedProcessorOptions leaseExpirationInterval(Duration leaseExpirati
*
* @return the delay in between polling a partition for new changes on the feed.
*/
- public Duration feedPollDelay() {
+ public Duration getFeedPollDelay() {
return this.feedPollDelay;
}
@@ -120,7 +120,7 @@ public Duration feedPollDelay() {
* @param feedPollDelay the delay in between polling a partition for new changes on the feed, after all current changes are drained.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions feedPollDelay(Duration feedPollDelay) {
+ public ChangeFeedProcessorOptions setFeedPollDelay(Duration feedPollDelay) {
this.feedPollDelay = feedPollDelay;
return this;
}
@@ -133,7 +133,7 @@ public ChangeFeedProcessorOptions feedPollDelay(Duration feedPollDelay) {
*
* @return a prefix to be used as part of the lease ID.
*/
- public String leasePrefix() {
+ public String getLeasePrefix() {
return this.leasePrefix;
}
@@ -143,7 +143,7 @@ public String leasePrefix() {
* @param leasePrefix a prefix to be used as part of the lease ID.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions leasePrefix(String leasePrefix) {
+ public ChangeFeedProcessorOptions setLeasePrefix(String leasePrefix) {
this.leasePrefix = leasePrefix;
return this;
}
@@ -153,7 +153,7 @@ public ChangeFeedProcessorOptions leasePrefix(String leasePrefix) {
*
* @return the maximum number of items to be returned in the enumeration operation in the Azure Cosmos DB service.
*/
- public int maxItemCount() {
+ public int getMaxItemCount() {
return this.maxItemCount;
}
@@ -163,7 +163,7 @@ public int maxItemCount() {
* @param maxItemCount the maximum number of items to be returned in the enumeration operation.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions maxItemCount(int maxItemCount) {
+ public ChangeFeedProcessorOptions setMaxItemCount(int maxItemCount) {
this.maxItemCount = maxItemCount;
return this;
}
@@ -176,7 +176,7 @@ public ChangeFeedProcessorOptions maxItemCount(int maxItemCount) {
*
* @return the start request continuation token to start looking for changes after.
*/
- public String startContinuation() {
+ public String getStartContinuation() {
return this.startContinuation;
}
@@ -189,7 +189,7 @@ public String startContinuation() {
* @param startContinuation the start request continuation token to start looking for changes after.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions startContinuation(String startContinuation) {
+ public ChangeFeedProcessorOptions setStartContinuation(String startContinuation) {
this.startContinuation= startContinuation;
return this;
}
@@ -204,7 +204,7 @@ public ChangeFeedProcessorOptions startContinuation(String startContinuation) {
*
* @return the time (exclusive) to start looking for changes after.
*/
- public OffsetDateTime startTime() {
+ public OffsetDateTime getStartTime() {
return this.startTime;
}
@@ -219,7 +219,7 @@ public OffsetDateTime startTime() {
* @param startTime the time (exclusive) to start looking for changes after.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions startTime(OffsetDateTime startTime) {
+ public ChangeFeedProcessorOptions setStartTime(OffsetDateTime startTime) {
this.startTime = startTime;
return this;
}
@@ -235,7 +235,7 @@ public ChangeFeedProcessorOptions startTime(OffsetDateTime startTime) {
*
* @return a value indicating whether change feed in the Azure Cosmos DB service should start from.
*/
- public boolean startFromBeginning() {
+ public boolean getStartFromBeginning() {
return this.startFromBeginning;
}
@@ -250,7 +250,7 @@ public boolean startFromBeginning() {
* @param startFromBeginning Indicates to start from beginning if true
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions startFromBeginning(boolean startFromBeginning) {
+ public ChangeFeedProcessorOptions setStartFromBeginning(boolean startFromBeginning) {
this.startFromBeginning = startFromBeginning;
return this;
}
@@ -263,7 +263,7 @@ public ChangeFeedProcessorOptions startFromBeginning(boolean startFromBeginning)
*
* @return the minimum scale count for the host.
*/
- public int minScaleCount() {
+ public int getMinScaleCount() {
return this.minScaleCount;
}
@@ -276,7 +276,7 @@ public int minScaleCount() {
* @param minScaleCount the minimum partition count for the host.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions minScaleCount(int minScaleCount) {
+ public ChangeFeedProcessorOptions setMinScaleCount(int minScaleCount) {
this.minScaleCount = minScaleCount;
return this;
}
@@ -289,7 +289,7 @@ public ChangeFeedProcessorOptions minScaleCount(int minScaleCount) {
*
* @return the maximum number of partitions the host can serve.
*/
- public int maxScaleCount() {
+ public int getMaxScaleCount() {
return this.maxScaleCount;
}
@@ -299,7 +299,7 @@ public int maxScaleCount() {
* @param maxScaleCount the maximum number of partitions the host can serve.
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions maxScaleCount(int maxScaleCount) {
+ public ChangeFeedProcessorOptions setMaxScaleCount(int maxScaleCount) {
this.maxScaleCount = maxScaleCount;
return this;
}
@@ -310,7 +310,7 @@ public ChangeFeedProcessorOptions maxScaleCount(int maxScaleCount) {
*
* @return a value indicating whether on start of the host all existing leases should be deleted and the host should start from scratch.
*/
- public boolean discardExistingLeases() {
+ public boolean getDiscardExistingLeases() {
return this.discardExistingLeases;
}
@@ -321,7 +321,7 @@ public boolean discardExistingLeases() {
* @param discardExistingLeases Indicates whether to discard all existing leases if true
* @return the current ChangeFeedProcessorOptions instance.
*/
- public ChangeFeedProcessorOptions discardExistingLeases(boolean discardExistingLeases) {
+ public ChangeFeedProcessorOptions setDiscardExistingLeases(boolean discardExistingLeases) {
this.discardExistingLeases = discardExistingLeases;
return this;
}
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ClientSideRequestStatistics.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ClientSideRequestStatistics.java
similarity index 100%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ClientSideRequestStatistics.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ClientSideRequestStatistics.java
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CommonsBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/CommonsBridgeInternal.java
similarity index 52%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CommonsBridgeInternal.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/CommonsBridgeInternal.java
index ce7273c3cacf..400c157f77cf 100644
--- a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CommonsBridgeInternal.java
+++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/CommonsBridgeInternal.java
@@ -5,46 +5,46 @@
public class CommonsBridgeInternal {
public static boolean isV2(PartitionKeyDefinition pkd) {
- return pkd.version() != null && PartitionKeyDefinitionVersion.V2.val == pkd.version().val;
+ return pkd.getVersion() != null && PartitionKeyDefinitionVersion.V2.val == pkd.getVersion().val;
}
public static void setV2(PartitionKeyDefinition pkd) {
- pkd.version(PartitionKeyDefinitionVersion.V2);
+ pkd.setVersion(PartitionKeyDefinitionVersion.V2);
}
/**
- * Gets the partitionKeyRangeId.
+ * Gets the getPartitionKeyRangeId.
*
- * @return the partitionKeyRangeId.
+ * @return the getPartitionKeyRangeId.
*/
public static String partitionKeyRangeIdInternal(FeedOptions options) {
- return options.partitionKeyRangeIdInternal();
+ return options.getPartitionKeyRangeIdInternal();
}
/**
- * Gets the partitionKeyRangeId.
+ * Gets the getPartitionKeyRangeId.
*
- * @return the partitionKeyRangeId.
+ * @return the getPartitionKeyRangeId.
*/
public static String partitionKeyRangeIdInternal(ChangeFeedOptions options) {
- return options.partitionKeyRangeId();
+ return options.getPartitionKeyRangeId();
}
/**
- * Sets the partitionKeyRangeId.
+ * Sets the getPartitionKeyRangeId.
*
- * @return the partitionKeyRangeId.
+ * @return the getPartitionKeyRangeId.
*/
public static FeedOptions partitionKeyRangeIdInternal(FeedOptions options, String partitionKeyRangeId) {
- return options.partitionKeyRangeIdInternal(partitionKeyRangeId);
+ return options.setPartitionKeyRangeIdInternal(partitionKeyRangeId);
}
/**
- * Sets the partitionKeyRangeId.
+ * Sets the getPartitionKeyRangeId.
*
- * @return the partitionKeyRangeId.
+ * @return the getPartitionKeyRangeId.
*/
public static ChangeFeedOptions partitionKeyRangeIdInternal(ChangeFeedOptions options, String partitionKeyRangeId) {
- return options.partitionKeyRangeId(partitionKeyRangeId);
+ return options.setPartitionKeyRangeId(partitionKeyRangeId);
}
}
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePath.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePath.java
similarity index 88%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePath.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePath.java
index 3cc94f9fc300..a8b0731e3dc2 100644
--- a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePath.java
+++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePath.java
@@ -34,7 +34,7 @@ public CompositePath(String jsonString) {
*
* @return the path.
*/
- public String path() {
+ public String getPath() {
return super.getString(Constants.Properties.PATH);
}
@@ -44,7 +44,7 @@ public String path() {
* @param path the path.
* @return the CompositePath.
*/
- public CompositePath path(String path) {
+ public CompositePath setPath(String path) {
super.set(Constants.Properties.PATH, path);
return this;
}
@@ -57,13 +57,13 @@ public CompositePath path(String path) {
*
* @return the sort order.
*/
- public CompositePathSortOrder order() {
+ public CompositePathSortOrder getOrder() {
String strValue = super.getString(Constants.Properties.ORDER);
if (!StringUtils.isEmpty(strValue)) {
try {
return CompositePathSortOrder.valueOf(StringUtils.upperCase(super.getString(Constants.Properties.ORDER)));
} catch (IllegalArgumentException e) {
- this.getLogger().warn("INVALID indexingMode value {}.", super.getString(Constants.Properties.ORDER));
+ this.getLogger().warn("INVALID getIndexingMode getValue {}.", super.getString(Constants.Properties.ORDER));
return CompositePathSortOrder.ASCENDING;
}
}
@@ -79,7 +79,7 @@ public CompositePathSortOrder order() {
* @param order the sort order.
* @return the CompositePath.
*/
- public CompositePath order(CompositePathSortOrder order) {
+ public CompositePath setOrder(CompositePathSortOrder order) {
super.set(Constants.Properties.ORDER, order.toString());
return this;
}
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePathSortOrder.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePathSortOrder.java
similarity index 100%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePathSortOrder.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/CompositePathSortOrder.java
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictException.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictException.java
similarity index 100%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictException.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictException.java
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionMode.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionMode.java
similarity index 100%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionMode.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionMode.java
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionPolicy.java
similarity index 88%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionPolicy.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionPolicy.java
index 215acb251077..bfb4894d468e 100644
--- a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionPolicy.java
+++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConflictResolutionPolicy.java
@@ -17,10 +17,10 @@
* A collection with custom conflict resolution with no user-registered stored procedure.
*
{@code
* DocumentCollection collectionSpec = new DocumentCollection();
- * collectionSpec.id("Multi-master collection");
+ * collectionSpec.getId("Multi-master collection");
*
* ConflictResolutionPolicy policy = ConflictResolutionPolicy.createCustomPolicy();
- * collectionSpec.conflictResolutionPolicy(policy);
+ * collectionSpec.getConflictResolutionPolicy(policy);
*
* DocumentCollection collection = client.createCollection(databaseLink, collectionSpec, null)
* .toBlocking().single().getResource();
@@ -31,10 +31,10 @@
* A collection with custom conflict resolution with a user-registered stored procedure.
* {@code
* DocumentCollection collectionSpec = new DocumentCollection();
- * collectionSpec.id("Multi-master collection");
+ * collectionSpec.getId("Multi-master collection");
*
* ConflictResolutionPolicy policy = ConflictResolutionPolicy.createCustomPolicy(conflictResolutionSprocName);
- * collectionSpec.conflictResolutionPolicy(policy);
+ * collectionSpec.getConflictResolutionPolicy(policy);
*
* DocumentCollection collection = client.createCollection(databaseLink, collectionSpec, null)
* .toBlocking().single().getResource();
@@ -46,10 +46,10 @@
* A collection with custom conflict resolution with a user-registered stored procedure.
* {@code
* DocumentCollection collectionSpec = new DocumentCollection();
- * collectionSpec.id("Multi-master collection");
+ * collectionSpec.getId("Multi-master collection");
*
* ConflictResolutionPolicy policy = ConflictResolutionPolicy.createLastWriterWinsPolicy("/path/for/conflict/resolution");
- * collectionSpec.conflictResolutionPolicy(policy);
+ * collectionSpec.getConflictResolutionPolicy(policy);
*
* DocumentCollection collection = client.createCollection(databaseLink, collectionSpec, null)
* .toBlocking().single().getResource();
@@ -64,12 +64,13 @@ public class ConflictResolutionPolicy extends JsonSerializable {
*
* In case of a conflict occurring on a document, the document with the higher integer value in the default path
* {@link Resource#timestamp()}, i.e., "/_ts" will be used.
+ * {@link Resource#getTimestamp()}, i.e., "/_ts" will be used.
*
* @return ConflictResolutionPolicy.
*/
public static ConflictResolutionPolicy createLastWriterWinsPolicy() {
ConflictResolutionPolicy policy = new ConflictResolutionPolicy();
- policy.mode(ConflictResolutionMode.LAST_WRITER_WINS);
+ policy.setMode(ConflictResolutionMode.LAST_WRITER_WINS);
return policy;
}
@@ -87,9 +88,9 @@ public static ConflictResolutionPolicy createLastWriterWinsPolicy() {
*/
public static ConflictResolutionPolicy createLastWriterWinsPolicy(String conflictResolutionPath) {
ConflictResolutionPolicy policy = new ConflictResolutionPolicy();
- policy.mode(ConflictResolutionMode.LAST_WRITER_WINS);
+ policy.setMode(ConflictResolutionMode.LAST_WRITER_WINS);
if (conflictResolutionPath != null) {
- policy.conflictResolutionPath(conflictResolutionPath);
+ policy.setConflictResolutionPath(conflictResolutionPath);
}
return policy;
}
@@ -110,9 +111,9 @@ public static ConflictResolutionPolicy createLastWriterWinsPolicy(String conflic
*/
public static ConflictResolutionPolicy createCustomPolicy(String conflictResolutionSprocName) {
ConflictResolutionPolicy policy = new ConflictResolutionPolicy();
- policy.mode(ConflictResolutionMode.CUSTOM);
+ policy.setMode(ConflictResolutionMode.CUSTOM);
if (conflictResolutionSprocName != null) {
- policy.conflictResolutionProcedure(conflictResolutionSprocName);
+ policy.setConflictResolutionProcedure(conflictResolutionSprocName);
}
return policy;
}
@@ -127,7 +128,7 @@ public static ConflictResolutionPolicy createCustomPolicy(String conflictResolut
*/
public static ConflictResolutionPolicy createCustomPolicy() {
ConflictResolutionPolicy policy = new ConflictResolutionPolicy();
- policy.mode(ConflictResolutionMode.CUSTOM);
+ policy.setMode(ConflictResolutionMode.CUSTOM);
return policy;
}
@@ -146,7 +147,7 @@ public ConflictResolutionPolicy(String jsonString) {
*
* @return ConflictResolutionMode.
*/
- public ConflictResolutionMode mode() {
+ public ConflictResolutionMode getMode() {
String strValue = super.getString(Constants.Properties.MODE);
@@ -154,7 +155,7 @@ public ConflictResolutionMode mode() {
try {
return ConflictResolutionMode.valueOf(Strings.fromCamelCaseToUpperCase(super.getString(Constants.Properties.MODE)));
} catch (IllegalArgumentException e) {
- this.getLogger().warn("INVALID ConflictResolutionMode value {}.", super.getString(Constants.Properties.MODE));
+ this.getLogger().warn("INVALID ConflictResolutionMode getValue {}.", super.getString(Constants.Properties.MODE));
return ConflictResolutionMode.INVALID;
}
}
@@ -168,7 +169,7 @@ public ConflictResolutionMode mode() {
*
* @param mode One of the values of the {@link ConflictResolutionMode} enum.
*/
- ConflictResolutionPolicy mode(ConflictResolutionMode mode) {
+ ConflictResolutionPolicy setMode(ConflictResolutionMode mode) {
super.set(Constants.Properties.MODE, mode.toString());
return this;
}
@@ -184,7 +185,7 @@ ConflictResolutionPolicy mode(ConflictResolutionMode mode) {
* @return The path to check values for last-writer wins conflict resolution.
* That path is a rooted path of the property in the document, such as "/name/first".
*/
- public String conflictResolutionPath() {
+ public String getConflictResolutionPath() {
return super.getString(Constants.Properties.CONFLICT_RESOLUTION_PATH);
}
@@ -199,7 +200,7 @@ public String conflictResolutionPath() {
* @param value The path to check values for last-writer wins conflict resolution.
* That path is a rooted path of the property in the document, such as "/name/first".
*/
- ConflictResolutionPolicy conflictResolutionPath(String value) {
+ ConflictResolutionPolicy setConflictResolutionPath(String value) {
super.set(Constants.Properties.CONFLICT_RESOLUTION_PATH, value);
return this;
}
@@ -217,11 +218,11 @@ ConflictResolutionPolicy conflictResolutionPath(String value) {
**
* @return the stored procedure to perform conflict resolution.]
*/
- public String conflictResolutionProcedure() {
+ public String getConflictResolutionProcedure() {
return super.getString(Constants.Properties.CONFLICT_RESOLUTION_PROCEDURE);
}
- ConflictResolutionPolicy conflictResolutionProcedure(String value) {
+ ConflictResolutionPolicy setConflictResolutionProcedure(String value) {
super.set(Constants.Properties.CONFLICT_RESOLUTION_PROCEDURE, value);
return this;
}
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionMode.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionMode.java
similarity index 100%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionMode.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionMode.java
diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionPolicy.java
similarity index 88%
rename from sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionPolicy.java
rename to sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionPolicy.java
index 328a3453d1b6..e33cc2df291e 100644
--- a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionPolicy.java
+++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/data/cosmos/ConnectionPolicy.java
@@ -53,7 +53,7 @@ public ConnectionPolicy() {
*
* @return the default connection policy.
*/
- public static ConnectionPolicy defaultPolicy() {
+ public static ConnectionPolicy getDefaultPolicy() {
if (ConnectionPolicy.default_policy == null) {
ConnectionPolicy.default_policy = new ConnectionPolicy();
}
@@ -66,7 +66,7 @@ public static ConnectionPolicy defaultPolicy() {
*
* @return the request timeout in milliseconds.
*/
- public int requestTimeoutInMillis() {
+ public int getRequestTimeoutInMillis() {
return this.requestTimeoutInMillis;
}
@@ -77,7 +77,7 @@ public int requestTimeoutInMillis() {
* @param requestTimeoutInMillis the request timeout in milliseconds.
* @return the ConnectionPolicy.
*/
- public ConnectionPolicy requestTimeoutInMillis(int requestTimeoutInMillis) {
+ public ConnectionPolicy setRequestTimeoutInMillis(int requestTimeoutInMillis) {
this.requestTimeoutInMillis = requestTimeoutInMillis;
return this;
}
@@ -87,7 +87,7 @@ public ConnectionPolicy requestTimeoutInMillis(int requestTimeoutInMillis) {
*
* @return the connection mode.
*/
- public ConnectionMode connectionMode() {
+ public ConnectionMode getConnectionMode() {
return this.connectionMode;
}
@@ -97,7 +97,7 @@ public ConnectionMode connectionMode() {
* @param connectionMode the connection mode.
* @return the ConnectionPolicy.
*/
- public ConnectionPolicy connectionMode(ConnectionMode connectionMode) {
+ public ConnectionPolicy setConnectionMode(ConnectionMode connectionMode) {
this.connectionMode = connectionMode;
return this;
}
@@ -107,7 +107,7 @@ public ConnectionPolicy connectionMode(ConnectionMode connectionMode) {
*
* @return connection pool size.
*/
- public int maxPoolSize() {
+ public int getMaxPoolSize() {
return this.maxPoolSize;
}
@@ -118,7 +118,7 @@ public int maxPoolSize() {
* @param maxPoolSize The value of the connection pool size.
* @return the ConnectionPolicy.
*/
- public ConnectionPolicy maxPoolSize(int maxPoolSize) {
+ public ConnectionPolicy setMaxPoolSize(int maxPoolSize) {
this.maxPoolSize = maxPoolSize;
return this;
}
@@ -129,7 +129,7 @@ public ConnectionPolicy maxPoolSize(int maxPoolSize) {
*
* @return Idle connection timeout.
*/
- public int idleConnectionTimeoutInMillis() {
+ public int getIdleConnectionTimeoutInMillis() {
return this.idleConnectionTimeoutInMillis;
}
@@ -140,7 +140,7 @@ public int idleConnectionTimeoutInMillis() {
* @param idleConnectionTimeoutInMillis the timeout for an idle connection in seconds.
* @return the ConnectionPolicy.
*/
- public ConnectionPolicy idleConnectionTimeoutInMillis(int idleConnectionTimeoutInMillis) {
+ public ConnectionPolicy setIdleConnectionTimeoutInMillis(int idleConnectionTimeoutInMillis) {
this.idleConnectionTimeoutInMillis = idleConnectionTimeoutInMillis;
return this;
}
@@ -150,7 +150,7 @@ public ConnectionPolicy idleConnectionTimeoutInMillis(int idleConnectionTimeoutI
*
* @return the value of user-agent suffix.
*/
- public String userAgentSuffix() {
+ public String getUserAgentSuffix() {
return this.userAgentSuffix;
}
@@ -161,7 +161,7 @@ public String userAgentSuffix() {
* used for monitoring purposes.
* @return the ConnectionPolicy.
*/
- public ConnectionPolicy userAgentSuffix(String userAgentSuffix) {
+ public ConnectionPolicy setUserAgentSuffix(String userAgentSuffix) {
this.userAgentSuffix = userAgentSuffix;
return this;
}
@@ -171,7 +171,7 @@ public ConnectionPolicy userAgentSuffix(String userAgentSuffix) {
*
* @return the RetryOptions instance.
*/
- public RetryOptions retryOptions() {
+ public RetryOptions getRetryOptions() {
return this.retryOptions;
}
@@ -186,7 +186,7 @@ public RetryOptions retryOptions() {
* @param retryOptions the RetryOptions instance.
* @return the ConnectionPolicy.
*/
- public ConnectionPolicy retryOptions(RetryOptions retryOptions) {
+ public ConnectionPolicy setRetryOptions(RetryOptions retryOptions) {
if (retryOptions == null) {
throw new IllegalArgumentException("retryOptions value must not be null.");
}
@@ -200,7 +200,7 @@ public ConnectionPolicy retryOptions(RetryOptions retryOptions) {
*
* @return whether endpoint discovery is enabled.
*/
- public boolean enableEndpointDiscovery() {
+ public boolean getEnableEndpointDiscovery() {
return this.enableEndpointDiscovery;
}
@@ -216,7 +216,7 @@ public boolean enableEndpointDiscovery() {
* @param enableEndpointDiscovery true if EndpointDiscovery is enabled.
* @return the ConnectionPolicy.
*/
- public ConnectionPolicy enableEndpointDiscovery(boolean enableEndpointDiscovery) {
+ public ConnectionPolicy setEnableEndpointDiscovery(boolean enableEndpointDiscovery) {
this.enableEndpointDiscovery = enableEndpointDiscovery;
return this;
}
@@ -235,7 +235,7 @@ public ConnectionPolicy enableEndpointDiscovery(boolean enableEndpointDiscovery)
*
* @return flag to enable writes on any locations (regions) for geo-replicated database accounts.
*/
- public boolean usingMultipleWriteLocations() {
+ public boolean getUsingMultipleWriteLocations() {
return this.usingMultipleWriteLocations;
}
@@ -251,7 +251,7 @@ public boolean usingMultipleWriteLocations() {
*
* @return flag to allow for reads to go to multiple regions configured on an account of Azure Cosmos DB service.
*/
- public Boolean enableReadRequestsFallback() {
+ public Boolean getEnableReadRequestsFallback() {
return this.enableReadRequestsFallback;
}
@@ -270,7 +270,7 @@ public Boolean enableReadRequestsFallback() {
* @param usingMultipleWriteLocations flag to enable writes on any locations (regions) for geo-replicated database accounts.
* @return the ConnectionPolicy.
*/
- public ConnectionPolicy usingMultipleWriteLocations(boolean usingMultipleWriteLocations) {
+ public ConnectionPolicy setUsingMultipleWriteLocations(boolean usingMultipleWriteLocations) {
this.usingMultipleWriteLocations = usingMultipleWriteLocations;
return this;
}
@@ -288,7 +288,7 @@ public ConnectionPolicy usingMultipleWriteLocations(boolean usingMultipleWriteLo
* @param enableReadRequestsFallback flag to enable reads to go to multiple regions configured on an account of Azure Cosmos DB service.
* @return the ConnectionPolicy.
*/
- public ConnectionPolicy enableReadRequestsFallback(Boolean enableReadRequestsFallback) {
+ public ConnectionPolicy setEnableReadRequestsFallback(Boolean enableReadRequestsFallback) {
this.enableReadRequestsFallback = enableReadRequestsFallback;
return this;
}
@@ -298,7 +298,7 @@ public ConnectionPolicy enableReadRequestsFallback(Boolean enableReadRequestsFal
*
* @return the list of preferred location.
*/
- public List