Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions sdk/cosmos/changelog/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog

### 3.3.1
- Added @JsonIgnore on getLogger in JsonSerializable

### 3.3.0
- **Version Upgrades**
- Project Reactor version upgrade to 3.3.0.RELEASE
Expand Down
6 changes: 3 additions & 3 deletions sdk/cosmos/microsoft-azure-cosmos-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Licensed under the MIT License.
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos-parent</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-parent;current} -->
Copy link
Member

@mbhaskar mbhaskar Oct 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double check - 3.4.0 was just a snapshot right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not anymore.
The practice has been changed to update the versions to next to be released version.

<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-parent;current} -->
</parent>

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos-benchmark</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-benchmark;current} -->
<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-benchmark;current} -->
<name>Microsoft Azure SDK for SQL API of Azure Cosmos DB Service - Benchmarking tool</name>
<description>This package contains Benchmarking tool for Microsoft Azure SDK for SQL API of Azure Cosmos DB Service</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>
Expand All @@ -33,7 +33,7 @@ Licensed under the MIT License.
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos;current} -->
<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos;current} -->
</dependency>

<dependency>
Expand Down
6 changes: 3 additions & 3 deletions sdk/cosmos/microsoft-azure-cosmos-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Licensed under the MIT License.
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos-parent</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-parent;current} -->
<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-parent;current} -->
</parent>

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos-examples</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-examples;current} -->
<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-examples;current} -->
<name>Microsoft Azure SDK for SQL API of Azure Cosmos DB Service - Examples</name>
<description>This package contains examples for Microsoft Azure SDK for SQL API of Azure Cosmos DB Service</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>
Expand Down Expand Up @@ -89,7 +89,7 @@ Licensed under the MIT License.
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos;current} -->
<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos;current} -->
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/microsoft-azure-cosmos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Licensed under the MIT License.
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos-parent</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-parent;current} -->
<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-parent;current} -->
</parent>

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos;current} -->
<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos;current} -->
<name>Microsoft Azure SDK for SQL API of Azure Cosmos DB Service</name>
<description>This Package contains Microsoft Azure Cosmos SDK (with Reactive Extension rx support) for Azure Cosmos DB SQL API</description>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.data.cosmos.internal.Strings;
import com.azure.data.cosmos.internal.Utils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -32,14 +33,14 @@ public class JsonSerializable {
private final static ObjectMapper OBJECT_MAPPER = Utils.getSimpleObjectMapper();
private ObjectMapper om;
transient ObjectNode propertyBag = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refrain from making unrelated formatting changes, you can configure intellij to stop doing this automatically

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wanted to, but couldn't stop it. :(
You can show me a demo sometime :)


protected JsonSerializable() {
this.propertyBag = OBJECT_MAPPER.createObjectNode();
}

/**
* Constructor.
*
*
* @param jsonString the json string that represents the JsonSerializable.
* @param objectMapper the custom object mapper
*/
Expand All @@ -48,10 +49,10 @@ protected JsonSerializable() {
this.propertyBag = fromJson(jsonString);
this.om = objectMapper;
}

/**
* Constructor.
*
*
* @param jsonString the json string that represents the JsonSerializable.
*/
protected JsonSerializable(String jsonString) {
Expand All @@ -76,7 +77,7 @@ private ObjectMapper getMapper() {
void setMapper(ObjectMapper om) {
this.om = om;
}

private static void checkForValidPOJO(Class<?> c) {
if (c.isAnonymousClass() || c.isLocalClass()) {
throw new IllegalArgumentException(
Expand All @@ -88,6 +89,7 @@ private static void checkForValidPOJO(Class<?> c) {
}
}

@JsonIgnore
public Logger getLogger() {
return logger;
}
Expand All @@ -106,7 +108,7 @@ public Map<String, Object> getMap() {

/**
* Checks whether a property exists.
*
*
* @param propertyName the property to look up.
* @return true if the property exists.
*/
Expand All @@ -116,7 +118,7 @@ public boolean has(String propertyName) {

/**
* Removes a value by propertyName.
*
*
* @param propertyName the property to remove.
*/
void remove(String propertyName) {
Expand All @@ -125,7 +127,7 @@ void remove(String propertyName) {

/**
* Sets the value of a property.
*
*
* @param <T> the type of the object.
* @param propertyName the property to set.
* @param value the value of the property.
Expand Down Expand Up @@ -183,7 +185,7 @@ private <T> void internalSetCollection(String propertyName, Collection<T> collec

/**
* Gets a property value as Object.
*
*
* @param propertyName the property to get.
* @return the value of the property.
*/
Expand All @@ -194,10 +196,10 @@ public Object get(String propertyName) {
return null;
}
}

/**
* Gets a string value.
*
*
* @param propertyName the property to get.
* @return the string value.
*/
Expand All @@ -211,7 +213,7 @@ public String getString(String propertyName) {

/**
* Gets a boolean value.
*
*
* @param propertyName the property to get.
* @return the boolean value.
*/
Expand All @@ -225,7 +227,7 @@ public Boolean getBoolean(String propertyName) {

/**
* Gets an integer value.
*
*
* @param propertyName the property to get.
* @return the boolean value
*/
Expand All @@ -239,7 +241,7 @@ public Integer getInt(String propertyName) {

/**
* Gets a long value.
*
*
* @param propertyName the property to get.
* @return the long value
*/
Expand All @@ -253,7 +255,7 @@ public Long getLong(String propertyName) {

/**
* Gets a double value.
*
*
* @param propertyName the property to get.
* @return the double value.
*/
Expand All @@ -267,7 +269,7 @@ public Double getDouble(String propertyName) {

/**
* Gets an object value.
*
*
* @param <T> the type of the object.
* @param propertyName the property to get.
* @param c the class of the object. If c is a POJO class, it must be a member (and not an anonymous or local)
Expand Down Expand Up @@ -390,7 +392,7 @@ public <T> List<T> getList(String propertyName, Class<T> c, boolean ... convertF

/**
* Gets an object collection.
*
*
* @param <T> the type of the objects in the collection.
* @param propertyName the property to get
* @param c the class of the object. If c is a POJO class, it must be a member (and not an anonymous or local)
Expand All @@ -405,7 +407,7 @@ public <T> Collection<T> getCollection(String propertyName, Class<T> c, boolean

/**
* Gets a JSONObject.
*
*
* @param propertyName the property to get.
* @return the JSONObject.
*/
Expand All @@ -419,7 +421,7 @@ ObjectNode getObject(String propertyName) {

/**
* Gets a JSONObject collection.
*
*
* @param propertyName the property to get.
* @return the JSONObject collection.
*/
Expand All @@ -433,12 +435,12 @@ Collection<ObjectNode> getCollection(String propertyName) {
}
}

return result;
return result;
}

/**
* Gets the value of a property identified by an array of property names that forms the path.
*
*
* @param propertyNames that form the path to the property to get.
* @return the value of the property.
*/
Expand All @@ -462,12 +464,12 @@ public Object getObjectByPath(List<String> propertyNames) {
break;
}
} while (iterator.hasNext());

if (value != null && matchedProperties == propertyNames.size()) {
return getValue(value);
}
}

return null;
}

Expand Down Expand Up @@ -517,7 +519,7 @@ private String toPrettyJson(Object object){

/**
* Converts to an Object (only POJOs and JSONObject are supported).
*
*
* @param <T> the type of the object.
* @param c the class of the object, either a POJO class or JSONObject. If c is a POJO class, it must be a member
* (and not an anonymous or local) and a static one.
Expand Down Expand Up @@ -547,16 +549,16 @@ public <T> T toObject(Class<T> c) {

/**
* Converts to a JSON string.
*
*
* @return the JSON string.
*/
public String toJson() {
return this.toJson(SerializationFormattingPolicy.NONE);
}

/**
* Converts to a JSON string.
*
*
* @param formattingPolicy the formatting policy to be used.
* @return the JSON string.
*/
Expand All @@ -571,10 +573,10 @@ public String toJson(SerializationFormattingPolicy formattingPolicy) {

/**
* Gets Simple STRING representation of property bag.
*
* For proper conversion to json and inclusion of the default values
*
* For proper conversion to json and inclusion of the default values
* use {@link #toJson()}.
*
*
* @return string representation of property bag.
*/
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static class Versions {
// TODO: FIXME we can use maven plugin for generating a version file
// @see
// https://stackoverflow.com/questions/2469922/generate-a-version-java-file-in-maven
public static final String SDK_VERSION = "3.4.0";
public static final String SDK_VERSION = "3.3.1";
public static final String SDK_NAME = "cosmosdb-java-sdk";
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Licensed under the MIT License.

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos-parent</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-parent;current} -->
<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos-parent;current} -->
<packaging>pom</packaging>

<name>Microsoft Azure Cosmos DB SQL API</name>
Expand Down Expand Up @@ -55,7 +55,7 @@ Licensed under the MIT License.
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-cosmos</artifactId>
<version>3.4.0</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos;current} -->
<version>3.3.1</version> <!-- {x-version-update;com.microsoft.azure:azure-cosmos;current} -->
</dependency>

<dependency>
Expand Down