You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HTTP client has been changed to Vert.x WebClient. `HTTP/2` is now supported. `HTTP/2` supports multiplexing and uses
6
+
`1` connection per host by default.
5
7
6
-
The default communication protocol is now `HTTP_JSON` (`HTTP/1.1` with `JSON` content type).
8
+
## Configuration changes
7
9
10
+
The default communication protocol is now `HTTP2_JSON` (`HTTP/2` with `JSON` content type).
11
+
12
+
The default host configuration to `127.0.0.1:8529` has been removed.
13
+
14
+
Configuration properties are not read automatically from properties files anymore.
15
+
16
+
A new configuration option for loading properties has been
17
+
introduced: `ArangoDB.Builder.loadProperties(ConfigPropertiesProvider)`. Implementations could supply configuration
18
+
properties coming from different sources, eg. system properties, remote stores, frameworks facilities, etc. An
19
+
implementation for loading properties from local files is provided by `FileConfigPropertiesProvider`.
8
20
9
21
## Transitive dependencies
10
22
11
-
A transitive dependency on `org.apache.httpcomponents:httpclient:4.5.x` has been added and the dependency
12
-
on `com.arangodb:velocypack` has been removed.
13
-
The dependency on `org.apache.httpcomponents:httpclient` can be excluded when using `VST` communication protocol only.
14
-
When using `VST` or `HTTP_VPACK`, the optional dependency on `com.arangodb:jackson-dataformat-velocypack` must be
15
-
provided.
16
-
When using `HTTP_JSON` (default), no dependencies on `VPACK` libraries are required.
23
+
A transitive dependency on `io.vertx:vertx-web-client` has been added. In can be excluded when using `VST` protocol
24
+
only.
25
+
26
+
The dependency on `com.arangodb:velocypack` has been removed.
27
+
28
+
When using protocol `VST`, `HTTP_VPACK` or `HTTP2_VPACK`, the optional dependency
29
+
on `com.arangodb:jackson-dataformat-velocypack` must be provided.
30
+
31
+
When using protocol `HTTP_JSON` or `HTTP2_JSON` (default), no dependencies on `VPACK` libraries are required.
32
+
17
33
Transitive dependencies on Jackson Core, Databind and Annotations have been added, using by default version `2.13`.
18
34
The versions of such libraries can be overridden, the driver is compatible with Jackson versions: `2.10`, `2.11`, `2.12`
19
35
, `2.13`.
20
36
21
-
22
37
## User Data Types
23
38
24
39
Before version `7.0` the driver always parsed raw strings as JSON, but unfortunately this does not allow distinguishing
25
40
the case when the intent is to use the raw string as such, without parsing it. Since version `7.0`, strings are not
26
-
interpreted as JSON anymore. To represent user data as raw JSON, the wrapper class `com.arangodb.util.RawJson` has been
27
-
added.
41
+
interpreted as JSON anymore. To represent user data as raw JSON, the wrapper class `RawJson` has been added.
28
42
29
-
To represent user data already encoded as byte array, the wrapper class `com.arangodb.util.RawBytes` has been added.
30
-
The byte array can either represent a `JSON` string (UTF-8 encoded) or a `VPACK` value, but the encoding must be the
31
-
same used for the driver protocol configuration (`JSON` for `HTTP_JSON`, `VPACK` otherwise).
43
+
To represent user data already encoded as byte array, the wrapper class `RawBytes` has been added.
44
+
The byte array can either represent a `JSON` string (UTF-8 encoded) or a `VPACK` value, but the encoding must be the
45
+
same used for the driver protocol configuration (`JSON` for `HTTP_JSON` and `HTTP2_JSON`, `VPACK` otherwise).
32
46
33
47
`BaseDocument` and `BaseEdgeDocument` are now `final`, they have a new method `removeAttribute(String)`
34
48
and `getProperties()` returns now an unmodifiable map.
@@ -38,75 +52,86 @@ metadata received in the response. Since version `7.0`, the input data objects p
38
52
treated as immutable and the related metadata fields are not updated anymore. The updated metadata can still be found in
39
53
the object returned by the API method.
40
54
41
-
42
55
## Serialization
43
56
44
57
The serialization module has been changed and is now based on the Jackson API.
45
58
46
-
Up to version 6, the (de)serialization was always performed to/from `VPACK`. In case the JSON representation was required,
47
-
the raw `VPACK` was then converted to `JSON`. Since version 7, the serialization module is a dataformat agnostic API, based
48
-
on the Jackson API. By default, it reads and writes `JSON` format. `VPACK` support is provided by the optional
49
-
dependency `com.arangodb:jackson-dataformat-velocypack`, which is a dataformat backend implementation for Jackson.
50
-
51
-
The (de)serialization of user data can be customized by registering an implementation
52
-
of `com.arangodb.serde.ArangoSerde` via `com.arangodb.ArangoDB.Builder#serializer()`.
53
-
The default user data serializer is `com.arangodb.serde.JacksonSerde`, which is based on Jackson API and is available
54
-
for both `JSON` and `VPACK`. It (de)serializes user data using Jackson Databind and can handle Jackson Annotations.
55
-
It can be customized through `com.arangodb.serde.JacksonSerde#configure(Consumer<ObjectMapper>)`,
56
-
i.e. registering Kotlin or Scala modules. Furthermore, meta binding annotations (`@Id`, `@Key`, `@Rev`, `@From`, `@To`)
57
-
are supported for mapping documents and edges metadata fields (`_id`, `_key`, `_rev`, `_from`, `_to`).
58
-
59
-
`com.arangodb.serde.ArangoSerde` interface is not constrained to Jackson. It is instead an abstract API that can be
60
-
implemented using any custom serialization library, e.g. an example of `JSON-B` implementation can be found in
59
+
Up to version 6, the (de)serialization was always performed to/from `VPACK`. In case the JSON representation was
60
+
required, the raw `VPACK` was then converted to `JSON`. Since version 7, the serialization module is a dataformat
61
+
agnostic API, based on the Jackson API. By default, it reads and writes `JSON` format. `VPACK` support is provided by
62
+
the optional dependency `com.arangodb:jackson-dataformat-velocypack`, which is a dataformat backend implementation for
63
+
Jackson.
64
+
65
+
The (de)serialization of user data can be customized by registering an implementation of `ArangoSerde`
66
+
via `ArangoDB.Builder#serializer()`. The default user data serializer is `JacksonSerde`, which is based on Jackson API
67
+
and is available for both `JSON` and `VPACK`. It (de)serializes user data using Jackson Databind and can handle Jackson
68
+
Annotations. It can be customized through `JacksonSerde#configure(Consumer<ObjectMapper>)`, i.e. registering Kotlin or
69
+
Scala modules. Furthermore, meta binding annotations (`@Id`, `@Key`, `@Rev`, `@From`, `@To`) are supported for mapping
70
+
documents and edges metadata fields (`_id`, `_key`, `_rev`, `_from`, `_to`).
71
+
72
+
`ArangoSerde` interface is not constrained to Jackson. It is instead an abstract API that can be implemented using any
73
+
custom serialization library, e.g. an example of `JSON-B` implementation can be found in
61
74
the [tests](../src/test/java/com/arangodb/serde/JsonbSerdeImpl.java).
62
75
63
76
Independently of the user data serializer, the following data types are (de)serialized with specific handlers (not
64
77
customizable):
78
+
65
79
-`JsonNode` and its children (`ArrayNode`, `ObjectNode`, ...)
66
80
-`RawJson`
67
81
-`RawBytes`
68
82
-`BaseDocument`
69
83
-`BaseEdgeDocument`
70
84
71
-
72
85
## Removed APIs
73
86
74
87
The following client APIs have been removed:
88
+
75
89
- client APIs already deprecated in Java Driver version `6.19.0`
76
90
- client API to interact with deprecated server APIs:
77
-
-`MMFiles` related APIs
78
-
-`ArangoDatabase.executeTraversal()`
79
-
-`ArangoDB.getLogs()`
80
-
-`minReplicationFactor` in collections and graphs
81
-
-`overwrite` flag in `DocumentCreateOptions`
82
-
83
-
The deprecation notes in the related javadoc contain information about the reason of the deprecation and suggest
84
-
migration alternatives to use.
91
+
-`MMFiles` related APIs
92
+
-`ArangoDatabase.executeTraversal()`
93
+
-`ArangoDB.getLogs()`
94
+
-`minReplicationFactor` in collections and graphs
95
+
-`overwrite` flag in `DocumentCreateOptions`
85
96
86
-
To migrate your existing project to Java Driver version `7.0`, it is recommended updating to version `6.19` first and
87
-
make sure that your code does not use any deprecated API. This can be done by checking the presence of deprecation
88
-
warnings in the Java compiler output.
97
+
The user data custom serializer implementation `ArangoJack` has been removed in favor of `JacksonSerde`.
89
98
90
-
The user data custom serializer implementation `com.arangodb.mapping.ArangoJack` has been removed in favor of `com.arangodb.serde.JacksonSerde`.
99
+
Support for interpreting raw strings as JSON has been removed (in favor of `RawJson`).
91
100
92
-
Support for interpreting raw strings as JSON has been removed (in favor of `com.arangodb.util.RawJson`).
93
-
94
-
Support of data type `com.arangodb.velocypack.VPackSlice` has been removed (in favor of Jackson types: `JsonNode`, `ArrayNode`, `ObjectNode`, ...).
101
+
Support of data type `VPackSlice` has been removed (in favor of Jackson types: `JsonNode`, `ArrayNode`, `ObjectNode`,
102
+
...).
95
103
104
+
Support for custom initialization of
105
+
cursors (`ArangoDB._setCursorInitializer(ArangoCursorInitializer cursorInitializer)`) has been removed.
96
106
97
107
## API methods changes
98
108
99
-
Before version `7.0` some CRUD API methods inferred the return type from the type of the data object passed as input. Now the return type can be explicitly set for each CRUD API method.
109
+
Before version `7.0` some CRUD API methods inferred the return type from the type of the data object passed as input.
110
+
Now the return type can be explicitly set for each CRUD API method.
100
111
101
112
CRUD operations operating with multiple documents have now an overloaded variant which accepts raw data (`RawBytes`
102
113
and `RawJson`) containing multiple documents.
103
114
104
-
`com.arangodb.ArangoCursor#getStats()` returns now an untyped map.
115
+
`ArangoCursor#getStats()` returns now an untyped map.
116
+
117
+
`Request` and `Response` classes have been refactored to support generic body
118
+
type. `ArangoDB.execute(Request<T>, Class<U>): Response<U>` accepts now the target deserialization type for the response
119
+
body.
105
120
121
+
`ArangoDBException` has been enhanced with the id of the request causing it.
106
122
107
123
## API entities
108
124
109
125
All entities and options classes are now `final`.
110
126
111
-
The replication factor is now modeled with a new interface (`com.arangodb.entity.ReplicationFactor`) with
127
+
The replication factor is now modeled with a new interface (`ReplicationFactor`) with
112
128
implementations: `NumericReplicationFactor` and `SatelliteReplicationFactor`.
129
+
130
+
## Migration
131
+
132
+
To migrate your existing project to Java Driver version `7.0`, it is recommended updating to version `6.19` first and
133
+
make sure that your code does not use any deprecated API. This can be done by checking the presence of deprecation
134
+
warnings in the Java compiler output.
135
+
136
+
The deprecation notes in the related javadoc contain information about the reason of the deprecation and suggest
0 commit comments