Skip to content

Commit 6a9a3ad

Browse files
authored
[DE-322] v7 documentation (#471)
* http client * ArangoDB.execute * ConfigPropertiesProvider * docs upd
1 parent 3944b0e commit 6a9a3ad

File tree

3 files changed

+100
-67
lines changed

3 files changed

+100
-67
lines changed

driver/ChangeLog.md renamed to ChangeLog.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
1010

1111
### Changed
1212

13-
- changed default communication protocol from VST to HTTP/1.1
14-
- changed default content-type encoding format from VPACK to JSON
15-
- transitive dependency on `org.apache.httpcomponents:httpclient:4.5.x` is not optional anymore, but it can be excluded
16-
if using VST only
13+
- configuration properties from local files are not read automatically anymore
14+
- `ArangoDB.execute()` accepts now target deserialization type
15+
- `Request` and `Response` support now generic body type
16+
- removed default host configuration to `127.0.0.1:8529`
17+
- changed http client library to Vert.x WebClient
18+
- changed default communication protocol from `VST` to `HTTP/2`
19+
- changed default content-type encoding format from `VPACK` to `JSON`
1720
- VPACK support is now provided by the optional dependency `com.arangodb:jackson-dataformat-velocypack` as dataformat
1821
backend for Jackson
1922
- changed serialization module, which is now based on Jackson API
2023
- data objects passed as arguments to API methods are now treated as immutable and the related metadata fields are not
2124
updated anymore (updated metadata can be found anyway in the object returned by the API method)
2225
- changed some API signatures which were using unnecessary generics
23-
- changed `com.arangodb.ArangoCursor#getStats()` to return untyped map
24-
- modeled replication factor with a new interface (`com.arangodb.entity.ReplicationFactor`) with
26+
- changed `ArangoCursor#getStats()` to return untyped map
27+
- modeled replication factor with a new interface (`ReplicationFactor`) with
2528
implementations: `NumericReplicationFactor` and `SatelliteReplicationFactor`
2629
- all data definition classes are now `final`
2730
- `BaseDocument` and `BaseEdgeDocument` are now `final`
@@ -31,40 +34,45 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
3134

3235
### Removed
3336

34-
- removed user data custom serializer API based on `com.arangodb.util.ArangoSerialization` (in favor
35-
of `com.arangodb.serde.ArangoSerde`)
36-
- removed user data custom serializer implementation `com.arangodb.mapping.ArangoJack` (in favor
37-
of `com.arangodb.serde.JacksonSerde`)
38-
- removed support for interpreting raw strings as JSON (in favor of `com.arangodb.util.RawJson`)
39-
- removed support of data type `com.arangodb.velocypack.VPackSlice` (in favor of Jackson types: `JsonNode`, `ArrayNode`, `ObjectNode`, ...)
37+
- removed user data custom serializer API based on `ArangoSerialization` (in favor of `ArangoSerde`)
38+
- removed user data custom serializer implementation `ArangoJack` (in favor of `JacksonSerde`)
39+
- removed support for interpreting raw strings as JSON (in favor of `RawJson`)
40+
- removed support of data type `VPackSlice` (in favor of Jackson types: `JsonNode`, `ArrayNode`, `ObjectNode`, ...)
4041
- removed client APIs already deprecated in Java Driver version `6.19.0`
4142
- removed deprecated server APIs:
4243
- `MMFiles` related APIs
4344
- `ArangoDatabase.executeTraversal()`
4445
- `ArangoDB.getLogs()`
4546
- `minReplicationFactor` in collections and graphs
4647
- `overwrite` flag in `DocumentCreateOptions`
48+
- removed `ArangoCursorInitializer`
4749

4850
### Added
4951

52+
- added `ArangoDB.Builder.loadProperties(ConfigPropertiesProvider)` to register custom configuration providers
53+
- added `FileConfigPropertiesProvider` to load properties from local files
54+
- added support to `HTTP/2` communication protocol
55+
- added transitive dependency on `io.vertx:vertx-web-client`, which can be excluded if using VST only
5056
- added transitive dependency on Jackson Core, Databind and Annotations
51-
- added wrapper class for raw JSON content (`com.arangodb.util.RawJson`)
52-
- added wrapper class for content already encoded as byte array (`com.arangodb.util.RawBytes`)
57+
- added wrapper class for raw JSON content (`RawJson`)
58+
- added wrapper class for content already encoded as byte array (`RawBytes`)
5359
- added support for Jackson types (`JsonNode`, `ArrayNode`, `ObjectNode`, ...)
5460
- added support for Jackson annotations in data types
55-
- added new user data custom serializer API based on `com.arangodb.serde.ArangoSerde`
56-
- added new user data custom serializer implementation based on Jackson (`com.arangodb.serde.JacksonSerde`)
61+
- added new user data custom serializer API based on `ArangoSerde`
62+
- added new user data custom serializer implementation based on Jackson (`JacksonSerde`)
5763
- added methods and parameters targets to meta binding annotations
5864
- added overloaded methods for CRUD operations allowing specifying the return type
5965
- added API to support CRUD operations from raw data (`RawBytes` and `RawJson`) containing multiple documents
6066
- added `BaseDocument#removeAttribute(String)` and `BaseEdgeDocument#removeAttribute(String)`
67+
- added request id to `ArangoDBException`
6168

6269
### Fixed
6370

6471
- removed `--allow-incomplete-classpath` from native image configuration (#397)
6572
- ability to control whether `null` values are included in the serialization (#389)
66-
- added support to `com.arangodb.model.DocumentCreateOptions#keepNull` (#374)
73+
- added support to `DocumentCreateOptions#keepNull` (#374)
6774
- allow specifying the return type on insertDocuments (#373)
75+
- removed credentials logging (#410)
6876

6977
## [6.19.0]
7078

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The official [ArangoDB](https://www.arangodb.com/) Java Driver.
99

1010
## Learn more
1111

12-
- [ChangeLog](driver/ChangeLog.md)
12+
- [ChangeLog](ChangeLog.md)
1313
- [Examples](driver/src/test/java/com/arangodb/example)
1414
- [Examples Async](driver/src/test/java/com/arangodb/async/example)
1515
- [Tutorial](https://www.arangodb.com/docs/stable/drivers/java-tutorial.html)

docs/v7_detailed_changes.md

Lines changed: 74 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,48 @@
11
# Version 7.0: detailed changes
22

3+
## HTTP client
34

4-
## Default protocol
5+
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.
57

6-
The default communication protocol is now `HTTP_JSON` (`HTTP/1.1` with `JSON` content type).
8+
## Configuration changes
79

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`.
820

921
## Transitive dependencies
1022

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+
1733
Transitive dependencies on Jackson Core, Databind and Annotations have been added, using by default version `2.13`.
1834
The versions of such libraries can be overridden, the driver is compatible with Jackson versions: `2.10`, `2.11`, `2.12`
1935
, `2.13`.
2036

21-
2237
## User Data Types
2338

2439
Before version `7.0` the driver always parsed raw strings as JSON, but unfortunately this does not allow distinguishing
2540
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.
2842

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).
3246

3347
`BaseDocument` and `BaseEdgeDocument` are now `final`, they have a new method `removeAttribute(String)`
3448
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
3852
treated as immutable and the related metadata fields are not updated anymore. The updated metadata can still be found in
3953
the object returned by the API method.
4054

41-
4255
## Serialization
4356

4457
The serialization module has been changed and is now based on the Jackson API.
4558

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
6174
the [tests](../src/test/java/com/arangodb/serde/JsonbSerdeImpl.java).
6275

6376
Independently of the user data serializer, the following data types are (de)serialized with specific handlers (not
6477
customizable):
78+
6579
- `JsonNode` and its children (`ArrayNode`, `ObjectNode`, ...)
6680
- `RawJson`
6781
- `RawBytes`
6882
- `BaseDocument`
6983
- `BaseEdgeDocument`
7084

71-
7285
## Removed APIs
7386

7487
The following client APIs have been removed:
88+
7589
- client APIs already deprecated in Java Driver version `6.19.0`
7690
- 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`
8596

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`.
8998

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`).
91100

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+
...).
95103

104+
Support for custom initialization of
105+
cursors (`ArangoDB._setCursorInitializer(ArangoCursorInitializer cursorInitializer)`) has been removed.
96106

97107
## API methods changes
98108

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.
100111

101112
CRUD operations operating with multiple documents have now an overloaded variant which accepts raw data (`RawBytes`
102113
and `RawJson`) containing multiple documents.
103114

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.
105120

121+
`ArangoDBException` has been enhanced with the id of the request causing it.
106122

107123
## API entities
108124

109125
All entities and options classes are now `final`.
110126

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
112128
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
137+
migration alternatives to use.

0 commit comments

Comments
 (0)