From 96fb0a683ab2df6d8dcf5b3ec031a74df5d6c170 Mon Sep 17 00:00:00 2001 From: jenow Date: Wed, 3 Feb 2021 19:01:41 +0100 Subject: [PATCH 01/13] replace ConcurrentHashMap by Map --- .ci/doc/templates/catch.tpl.java | 2 +- .ci/doc/templates/catch.tpl.kt | 2 +- .ci/doc/templates/default.tpl.java | 2 +- .ci/doc/templates/default.tpl.kt | 2 +- .ci/doc/templates/print-result-array.tpl.java | 2 +- .ci/doc/templates/print-result-array.tpl.kt | 2 +- .../templates/print-result-arraylist.tpl.java | 2 +- .../templates/print-result-arraylist.tpl.kt | 2 +- .ci/doc/templates/print-result.tpl.java | 2 +- .ci/doc/templates/print-result.tpl.kt | 2 +- .../templates/print-search-result.tpl.java | 2 +- .ci/doc/templates/print-search-result.tpl.kt | 2 +- .ci/doc/templates/without-connect.tpl.kt | 2 +- .ci/doc/templates/without-ctor.tpl.kt | 2 +- build.gradle.kts | 2 +- doc/1/controllers/auth/check-token/index.md | 8 +- .../snippets/check-token-java.java | 6 +- .../snippets/check-token-kotlin.kt | 4 +- .../auth/create-my-credentials/index.md | 14 +-- .../snippets/create-my-credentials-java.java | 6 +- .../snippets/create-my-credentials-kotlin.kt | 4 +- .../snippets/credentials-exist-java.java | 2 +- .../snippets/credentials-exist-kotlin.kt | 2 +- .../snippets/delete-my-credentials-java.java | 4 +- .../snippets/delete-my-credentials-kotlin.kt | 2 +- .../auth/get-current-user/index.md | 12 +-- .../snippets/get-current-user-java.java | 4 +- .../snippets/get-current-user-kotlin.kt | 4 +- .../auth/get-my-credentials/index.md | 8 +- .../snippets/get-my-credentials-java.java | 4 +- .../snippets/get-my-credentials-kotlin.kt | 4 +- .../snippets/get-my-rights-java.java | 2 +- .../snippets/get-my-rights-kotlin.kt | 2 +- .../snippets/get-strategies-java.java | 2 +- .../snippets/get-strategies-kotlin.kt | 2 +- doc/1/controllers/auth/login/index.md | 16 ++-- .../auth/login/snippets/login-java.java | 4 +- .../auth/login/snippets/login-kotlin.kt | 4 +- .../auth/logout/snippets/logout-java.java | 2 +- .../auth/logout/snippets/logout-kotlin.kt | 2 +- doc/1/controllers/auth/refresh-token/index.md | 10 +-- .../snippets/refresh-token-java.java | 4 +- .../snippets/refresh-token-kotlin.kt | 4 +- .../auth/update-my-credentials/index.md | 14 +-- .../snippets/update-my-credentials-java.java | 4 +- .../snippets/update-my-credentials-kotlin.kt | 4 +- doc/1/controllers/auth/update-self/index.md | 18 ++-- .../snippets/update-self-java.java | 6 +- .../snippets/update-self-kotlin.kt | 6 +- .../auth/validate-my-credentials/index.md | 8 +- .../validate-my-credentials-java.java | 2 +- .../validate-my-credentials-kotlin.kt | 2 +- .../controllers/bulk/delete-by-query/index.md | 10 +-- .../snippets/delete-by-query-java.java | 4 +- .../snippets/delete-by-query-kotlin.kt | 6 +- doc/1/controllers/bulk/import-data/index.md | 28 +++--- .../snippets/import-data-java.java | 24 ++--- .../snippets/import-data-kotlin.kt | 24 ++--- doc/1/controllers/bulk/m-write/index.md | 28 +++--- .../bulk/m-write/snippets/mwrite-java.java | 8 +- .../bulk/m-write/snippets/mwrite-kotlin.kt | 8 +- doc/1/controllers/bulk/write/index.md | 32 +++---- .../bulk/write/snippets/write-java.java | 6 +- .../bulk/write/snippets/write-kotlin.kt | 6 +- doc/1/controllers/collection/create/index.md | 8 +- .../create/snippets/create-java.java | 8 +- .../create/snippets/create-kotlin.kt | 8 +- .../collection/get-mapping/index.md | 8 +- .../snippets/get-mapping-java.java | 2 +- .../collection/get-specifications/index.md | 8 +- .../snippets/get-specifications-java.java | 2 +- doc/1/controllers/collection/list/index.md | 8 +- .../collection/list/snippets/list-java.java | 2 +- .../collection/search-specifications/index.md | 14 +-- .../snippets/search-specifications-java.java | 6 +- .../snippets/search-specifications-kotlin.kt | 10 +-- .../collection/update-specifications/index.md | 20 ++--- .../snippets/update-specifications-java.java | 8 +- .../snippets/update-specifications-kotlin.kt | 14 +-- doc/1/controllers/collection/update/index.md | 10 +-- .../update/snippets/update-java.java | 8 +- .../update/snippets/update-kotlin.kt | 16 ++-- .../validate-specifications/index.md | 20 ++--- .../validate-specifications-java.java | 8 +- .../validate-specifications-kotlin.kt | 6 +- doc/1/controllers/document/count/index.md | 6 +- .../document/count/snippets/count-java.java | 4 +- .../document/count/snippets/count-kotlin.kt | 6 +- .../document/create-or-replace/index.md | 24 ++--- .../snippets/create-or-replace-java.java | 4 +- .../snippets/create-or-replace-kotlin.kt | 4 +- doc/1/controllers/document/create/index.md | 28 +++--- .../document/create/snippets/create-java.java | 4 +- .../document/create/snippets/create-kotlin.kt | 4 +- .../document/delete-by-query/index.md | 10 +-- .../snippets/delete-by-query-java.java | 6 +- .../snippets/delete-by-query-kotlin.kt | 6 +- doc/1/controllers/document/delete/index.md | 10 +-- doc/1/controllers/document/get/index.md | 12 +-- .../document/get/snippets/get-java.java | 2 +- .../document/get/snippets/get-kotlin.kt | 2 +- .../document/m-create-or-replace/index.md | 32 +++---- .../snippets/m-create-or-replace-java.java | 12 +-- .../snippets/m-create-or-replace-kotlin.kt | 18 ++-- doc/1/controllers/document/m-create/index.md | 32 +++---- .../m-create/snippets/m-create-java.java | 12 +-- .../m-create/snippets/m-create-kotlin.kt | 18 ++-- doc/1/controllers/document/m-delete/index.md | 10 +-- .../m-delete/snippets/m-delete-java.java | 2 +- .../m-delete/snippets/m-delete-kotlin.kt | 2 +- doc/1/controllers/document/m-get/index.md | 12 +-- .../document/m-get/snippets/m-get-java.java | 2 +- .../document/m-get/snippets/m-get-kotlin.kt | 2 +- doc/1/controllers/document/m-replace/index.md | 32 +++---- .../m-replace/snippets/m-replace-java.java | 12 +-- .../m-replace/snippets/m-replace-kotlin.kt | 18 ++-- doc/1/controllers/document/m-update/index.md | 32 +++---- .../m-update/snippets/m-update-java.java | 12 +-- .../m-update/snippets/m-update-kotlin.kt | 18 ++-- doc/1/controllers/document/replace/index.md | 24 ++--- .../replace/snippets/replace-java.java | 4 +- .../replace/snippets/replace-kotlin.kt | 6 +- doc/1/controllers/document/search/index.md | 14 +-- .../document/search/snippets/search-java.java | 6 +- .../document/search/snippets/search-kotlin.kt | 12 +-- .../document/update-by-query/index.md | 38 ++++---- .../snippets/update-by-query-java.java | 8 +- .../snippets/update-by-query-kotlin.kt | 14 +-- doc/1/controllers/document/update/index.md | 32 +++---- .../document/update/snippets/update-java.java | 4 +- .../document/update/snippets/update-kotlin.kt | 6 +- doc/1/controllers/document/validate/index.md | 8 +- .../validate/snippets/validate-java.java | 2 +- .../validate/snippets/validate-kotlin.kt | 4 +- .../realtime/count/snippets/count-java.java | 2 +- .../realtime/count/snippets/count-kotlin.kt | 2 +- doc/1/controllers/realtime/publish/index.md | 8 +- .../publish/snippets/publish-java.java | 2 +- .../publish/snippets/publish-kotlin.kt | 2 +- doc/1/controllers/realtime/subscribe/index.md | 24 ++--- .../snippets/document-notifications-java.java | 6 +- .../snippets/document-notifications-kotlin.kt | 6 +- ...cument-notifications-leave-scope-java.java | 10 +-- ...cument-notifications-leave-scope-kotlin.kt | 10 +-- .../snippets/unsubscribe-java.java | 4 +- .../snippets/unsubscribe-kotlin.kt | 4 +- .../controllers/server/get-all-stats/index.md | 8 +- .../snippets/get-all-stats-java.java | 2 +- .../snippets/get-all-stats-kotlin.kt | 2 +- doc/1/controllers/server/get-config/index.md | 8 +- .../get-config/snippets/get-config-java.java | 2 +- .../get-config/snippets/get-config-kotlin.kt | 2 +- .../server/get-last-stats/index.md | 8 +- .../snippets/get-last-stats-java.java | 2 +- .../snippets/get-last-stats-kotlin.kt | 2 +- doc/1/controllers/server/get-stats/index.md | 8 +- .../get-stats/snippets/get-stats-java.java | 2 +- .../get-stats/snippets/get-stats-kotlin.kt | 2 +- doc/1/controllers/server/info/index.md | 6 +- .../server/info/snippets/info-java.java | 2 +- .../server/info/snippets/info-kotlin.kt | 2 +- doc/1/core-classes/kuzzle/query/index.md | 16 ++-- .../kuzzle/query/snippets/query-java.java | 4 +- .../kuzzle/query/snippets/query-kotlin.kt | 4 +- .../response/introduction/index.md | 2 +- .../search-result/introduction/index.md | 16 ++-- .../next/snippets/fromsize-java.java | 8 +- .../next/snippets/fromsize-kotlin.kt | 14 +-- .../next/snippets/scroll-java.java | 8 +- .../next/snippets/scroll-kotlin.kt | 14 +-- doc/1/getting-started/java/index.md | 2 +- .../java/snippets/document-java.java | 4 +- .../java/snippets/firstconnection-java.java | 2 +- .../java/snippets/realtime-java.java | 10 +-- doc/1/getting-started/kotlin/index.md | 2 +- .../kotlin/snippets/document-kotlin.kt | 4 +- .../kotlin/snippets/firstconnection-kotlin.kt | 2 +- .../kotlin/snippets/realtime-kotlin.kt | 10 +-- src/main/kotlin/io/kuzzle/sdk/Kuzzle.kt | 9 +- .../kuzzle/sdk/controllers/AuthController.kt | 44 ++++----- .../kuzzle/sdk/controllers/BulkController.kt | 28 +++--- .../sdk/controllers/CollectionController.kt | 33 ++++--- .../sdk/controllers/DocumentController.kt | 90 +++++++++---------- .../sdk/controllers/RealtimeController.kt | 27 +++--- .../sdk/controllers/ServerController.kt | 26 +++--- .../io/kuzzle/sdk/coreClasses/SearchResult.kt | 44 ++++----- .../exceptions/KuzzleExceptionCode.kt | 2 +- .../json/ConcurrentHashMapTypeAdapter.kt | 12 +-- .../sdk/coreClasses/json/JsonSerializer.kt | 14 +-- .../kuzzle/sdk/coreClasses/maps/KuzzleMap.kt | 45 +++++----- .../sdk/coreClasses/maps/Serializable.kt | 6 +- .../coreClasses/responses/ErrorResponse.kt | 8 +- .../sdk/coreClasses/responses/Response.kt | 14 +-- .../kuzzle/sdk/protocol/AbstractProtocol.kt | 4 +- .../io/kuzzle/sdk/protocol/WebSocket.kt | 4 +- .../kuzzle/sdk/protocolTest/WebSocketTests.kt | 4 +- 196 files changed, 935 insertions(+), 945 deletions(-) diff --git a/.ci/doc/templates/catch.tpl.java b/.ci/doc/templates/catch.tpl.java index ade16116..f6ae68f6 100644 --- a/.ci/doc/templates/catch.tpl.java +++ b/.ci/doc/templates/catch.tpl.java @@ -1,7 +1,7 @@ import io.kuzzle.sdk.Kuzzle; import java.util.ArrayList; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.concurrent.ConcurrentHashMap; +; import io.kuzzle.sdk.coreClasses.responses.Response; public class SnippetTest { diff --git a/.ci/doc/templates/catch.tpl.kt b/.ci/doc/templates/catch.tpl.kt index ccde86d5..18fb01d6 100644 --- a/.ci/doc/templates/catch.tpl.kt +++ b/.ci/doc/templates/catch.tpl.kt @@ -1,6 +1,6 @@ import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.protocol.WebSocket -import java.util.concurrent.ConcurrentHashMap + import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response diff --git a/.ci/doc/templates/default.tpl.java b/.ci/doc/templates/default.tpl.java index b79c54f1..76821f81 100644 --- a/.ci/doc/templates/default.tpl.java +++ b/.ci/doc/templates/default.tpl.java @@ -1,7 +1,7 @@ import io.kuzzle.sdk.Kuzzle; import java.util.ArrayList; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.concurrent.ConcurrentHashMap; +; import io.kuzzle.sdk.coreClasses.responses.Response; import io.kuzzle.sdk.coreClasses.SearchResult; diff --git a/.ci/doc/templates/default.tpl.kt b/.ci/doc/templates/default.tpl.kt index 2e7e859c..efc8c4e4 100644 --- a/.ci/doc/templates/default.tpl.kt +++ b/.ci/doc/templates/default.tpl.kt @@ -1,6 +1,6 @@ import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.protocol.WebSocket -import java.util.concurrent.ConcurrentHashMap + import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response import io.kuzzle.sdk.coreClasses.SearchResult diff --git a/.ci/doc/templates/print-result-array.tpl.java b/.ci/doc/templates/print-result-array.tpl.java index b52f5665..266fd411 100644 --- a/.ci/doc/templates/print-result-array.tpl.java +++ b/.ci/doc/templates/print-result-array.tpl.java @@ -2,7 +2,7 @@ import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; -import java.util.concurrent.ConcurrentHashMap; +; import java.util.ArrayList; public class SnippetTest { diff --git a/.ci/doc/templates/print-result-array.tpl.kt b/.ci/doc/templates/print-result-array.tpl.kt index b46b7dfb..7651156e 100644 --- a/.ci/doc/templates/print-result-array.tpl.kt +++ b/.ci/doc/templates/print-result-array.tpl.kt @@ -1,6 +1,6 @@ import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.protocol.WebSocket -import java.util.concurrent.ConcurrentHashMap + import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response import io.kuzzle.sdk.coreClasses.maps.KuzzleMap diff --git a/.ci/doc/templates/print-result-arraylist.tpl.java b/.ci/doc/templates/print-result-arraylist.tpl.java index 15c0164d..5b00f925 100644 --- a/.ci/doc/templates/print-result-arraylist.tpl.java +++ b/.ci/doc/templates/print-result-arraylist.tpl.java @@ -2,7 +2,7 @@ import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; -import java.util.concurrent.ConcurrentHashMap; +; import java.util.ArrayList; public class SnippetTest { diff --git a/.ci/doc/templates/print-result-arraylist.tpl.kt b/.ci/doc/templates/print-result-arraylist.tpl.kt index de2643cd..5e1c6ed6 100644 --- a/.ci/doc/templates/print-result-arraylist.tpl.kt +++ b/.ci/doc/templates/print-result-arraylist.tpl.kt @@ -1,6 +1,6 @@ import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.protocol.WebSocket -import java.util.concurrent.ConcurrentHashMap + import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response diff --git a/.ci/doc/templates/print-result.tpl.java b/.ci/doc/templates/print-result.tpl.java index 4099320b..2bf5c8ed 100644 --- a/.ci/doc/templates/print-result.tpl.java +++ b/.ci/doc/templates/print-result.tpl.java @@ -3,7 +3,7 @@ import java.util.Date; import io.kuzzle.sdk.coreClasses.responses.Response; -import java.util.concurrent.ConcurrentHashMap; +; import java.util.ArrayList; public class SnippetTest { diff --git a/.ci/doc/templates/print-result.tpl.kt b/.ci/doc/templates/print-result.tpl.kt index a6adbcfc..3eb829be 100644 --- a/.ci/doc/templates/print-result.tpl.kt +++ b/.ci/doc/templates/print-result.tpl.kt @@ -1,7 +1,7 @@ import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.protocol.WebSocket import java.util.Date -import java.util.concurrent.ConcurrentHashMap + import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response diff --git a/.ci/doc/templates/print-search-result.tpl.java b/.ci/doc/templates/print-search-result.tpl.java index 7f59b4f1..1fde9d3d 100644 --- a/.ci/doc/templates/print-search-result.tpl.java +++ b/.ci/doc/templates/print-search-result.tpl.java @@ -1,7 +1,7 @@ import io.kuzzle.sdk.Kuzzle; import java.util.ArrayList; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.concurrent.ConcurrentHashMap; +; import io.kuzzle.sdk.coreClasses.responses.Response; import io.kuzzle.sdk.coreClasses.SearchResult; diff --git a/.ci/doc/templates/print-search-result.tpl.kt b/.ci/doc/templates/print-search-result.tpl.kt index 7e24a10b..be36ad44 100644 --- a/.ci/doc/templates/print-search-result.tpl.kt +++ b/.ci/doc/templates/print-search-result.tpl.kt @@ -1,6 +1,6 @@ import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.protocol.WebSocket -import java.util.concurrent.ConcurrentHashMap + import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response import io.kuzzle.sdk.coreClasses.SearchResult diff --git a/.ci/doc/templates/without-connect.tpl.kt b/.ci/doc/templates/without-connect.tpl.kt index a9f78f53..45ba2270 100644 --- a/.ci/doc/templates/without-connect.tpl.kt +++ b/.ci/doc/templates/without-connect.tpl.kt @@ -1,6 +1,6 @@ import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.protocol.WebSocket -import java.util.concurrent.ConcurrentHashMap + import java.util.concurrent.ExecutionException fun main() { diff --git a/.ci/doc/templates/without-ctor.tpl.kt b/.ci/doc/templates/without-ctor.tpl.kt index 84841516..5f546733 100644 --- a/.ci/doc/templates/without-ctor.tpl.kt +++ b/.ci/doc/templates/without-ctor.tpl.kt @@ -1,6 +1,6 @@ import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.protocol.WebSocket -import java.util.concurrent.ConcurrentHashMap + import java.util.concurrent.ExecutionException fun main() { diff --git a/build.gradle.kts b/build.gradle.kts index e32b1233..08e67c11 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,7 @@ plugins { val artifactName = "sdk-jvm" val artifactGroup = "io.kuzzle" -val artifactVersion = "1.0.2" +val artifactVersion = "1.0.3-" val pomUrl = "https://github.com/kuzzleio/sdk-jvm" val pomScmUrl = "https://github.com/kuzzleio/sdk-jvm" diff --git a/doc/1/controllers/auth/check-token/index.md b/doc/1/controllers/auth/check-token/index.md index 03ff1b8f..acc297b4 100644 --- a/doc/1/controllers/auth/check-token/index.md +++ b/doc/1/controllers/auth/check-token/index.md @@ -15,7 +15,7 @@ Checks an authentication token's validity. ## Arguments ```java -public CompletableFuture> checkToken(String token) +public CompletableFuture> checkToken(String token) throws NotConnectedException, InternalException ``` @@ -25,7 +25,7 @@ public CompletableFuture> checkToken(String to ## Return -A ConcurrentHashMap which has the following properties: +A Map which has the following properties: | Property | Type | Description | |--------------|-------------------|----------------------------------| @@ -43,7 +43,7 @@ A ConcurrentHashMap which has the following properties: ## Arguments ```kotlin -fun checkToken(token: String): CompletableFuture> +fun checkToken(token: String): CompletableFuture> ``` | Argument | Type | Description | @@ -52,7 +52,7 @@ fun checkToken(token: String): CompletableFuture ## Return -A ConcurrentHashMap which has the following properties: +A Map which has the following properties: | Property | Type | Description | |--------------|-------------------|----------------------------------| diff --git a/doc/1/controllers/auth/check-token/snippets/check-token-java.java b/doc/1/controllers/auth/check-token/snippets/check-token-java.java index cbfcac5f..9ea01a94 100644 --- a/doc/1/controllers/auth/check-token/snippets/check-token-java.java +++ b/doc/1/controllers/auth/check-token/snippets/check-token-java.java @@ -1,8 +1,8 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); -ConcurrentHashMap response = +Map response = kuzzle.getAuthController().login("local", credentials).get(); -ConcurrentHashMap responseToken = +Map responseToken = kuzzle.getAuthController().checkToken(response.get("jwt").toString()).get(); diff --git a/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt b/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt index 84fa15b4..459b5e11 100644 --- a/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt +++ b/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt @@ -1,7 +1,7 @@ -val response = kuzzle.authController.login("local", ConcurrentHashMap().apply { +val response = kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() -val responseToken: ConcurrentHashMap = +val responseToken: Map = kuzzle.authController.checkToken(response["jwt"].toString()).get() \ No newline at end of file diff --git a/doc/1/controllers/auth/create-my-credentials/index.md b/doc/1/controllers/auth/create-my-credentials/index.md index 4e090fd3..f1f66303 100644 --- a/doc/1/controllers/auth/create-my-credentials/index.md +++ b/doc/1/controllers/auth/create-my-credentials/index.md @@ -15,19 +15,19 @@ Creates the current user's credentials for the specified strategy. ## Arguments ```java -public CompletableFuture> createMyCredentials(final String strategy, - final ConcurrentHashMap credentials) +public CompletableFuture> createMyCredentials(final String strategy, + final Map credentials) throws NotConnectedException, InternalException ``` | Argument | Type | Description | |---------------|--------------------|--------------------------------------| | `strategy` |
String
| Strategy to use | -| `credentials` |
ConcurrentHashMap
| ConcurrentHashMap representing the credentials | +| `credentials` |
Map
| Map representing the credentials | ## Return -A ConcurrentHashMap representing the new credentials. +A Map representing the new credentials. ## Usage @@ -41,17 +41,17 @@ A ConcurrentHashMap representing the new credentials. ```kotlin fun createMyCredentials( strategy: String, - credentials: ConcurrentHashMap): CompletableFuture> + credentials: Map): CompletableFuture> ``` | Argument | Type | Description | |---------------|--------------------|--------------------------------------| | `strategy` |
String
| Strategy to use | -| `credentials` |
ConcurrentHashMap
| ConcurrentHashMap representing the credentials | +| `credentials` |
Map
| Map representing the credentials | ## Return -A ConcurrentHashMap representing the new credentials. +A Map representing the new credentials. ## Usage diff --git a/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-java.java b/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-java.java index 04c80a31..410b34bf 100644 --- a/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-java.java +++ b/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-java.java @@ -1,11 +1,11 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); -ConcurrentHashMap newCredentials = new ConcurrentHashMap<>(); +Map newCredentials = new HashMap<>(); newCredentials.put("username", "foo2"); newCredentials.put("password", "bar2"); -ConcurrentHashMap response = +Map response = kuzzle.getAuthController().login("local", credentials).get(); kuzzle.getAuthController().createMyCredentials("other", newCredentials).get(); diff --git a/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-kotlin.kt b/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-kotlin.kt index 7c1b9b3a..7a0d7a9d 100644 --- a/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-kotlin.kt @@ -1,9 +1,9 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() -kuzzle.authController.createMyCredentials("other", ConcurrentHashMap().apply { +kuzzle.authController.createMyCredentials("other", Map().apply { put("username", "foo2") put("password", "bar2") }).get() diff --git a/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-java.java b/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-java.java index dc50f1d9..2ad6c13d 100644 --- a/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-java.java +++ b/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); diff --git a/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-kotlin.kt b/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-kotlin.kt index 25154bbd..a20879c9 100644 --- a/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-kotlin.kt +++ b/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-java.java b/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-java.java index debdfa83..cdcafb6e 100644 --- a/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-java.java +++ b/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-java.java @@ -1,6 +1,6 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); -ConcurrentHashMap response = kuzzle.getAuthController().login("local", credentials).get(); +Map response = kuzzle.getAuthController().login("local", credentials).get(); kuzzle.getAuthController().deleteMyCredentials("local").get(); diff --git a/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-kotlin.kt b/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-kotlin.kt index f11e479f..3e36cf17 100644 --- a/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/get-current-user/index.md b/doc/1/controllers/auth/get-current-user/index.md index 84c6d2ee..50c3bf28 100644 --- a/doc/1/controllers/auth/get-current-user/index.md +++ b/doc/1/controllers/auth/get-current-user/index.md @@ -15,19 +15,19 @@ Returns informations about the user currently loggued with the SDK instance. ## Arguments ```java -public CompletableFuture> getCurrentUser() +public CompletableFuture> getCurrentUser() throws NotConnectedException, InternalException ``` ## Return -A ConcurrentHashMap representing the User. +A Map representing the User. | Property | Type | Description | |--------------|--------------------|---------------------------------------------------| | `_id` |
String
| Representing the current user `kuid` | | `strategies` |
Array
| Available authentication strategies for that user | -| `_source` |
ConcurrentHashMap
| User information | +| `_source` |
Map
| User information | ## Usage @@ -39,18 +39,18 @@ A ConcurrentHashMap representing the User. ## Arguments ```kotlin -fun getCurrentUser(): CompletableFuture> +fun getCurrentUser(): CompletableFuture> ``` ## Return -A ConcurrentHashMap representing the User. +A Map representing the User. | Property | Type | Description | |--------------|--------------------|---------------------------------------------------| | `_id` |
String
| Representing the current user `kuid` | | `strategies` |
Array
| Available authentication strategies for that user | -| `_source` |
ConcurrentHashMap
| User information | +| `_source` |
Map
| User information | ## Usage diff --git a/doc/1/controllers/auth/get-current-user/snippets/get-current-user-java.java b/doc/1/controllers/auth/get-current-user/snippets/get-current-user-java.java index 0ee6ec1e..eb9b72a7 100644 --- a/doc/1/controllers/auth/get-current-user/snippets/get-current-user-java.java +++ b/doc/1/controllers/auth/get-current-user/snippets/get-current-user-java.java @@ -1,6 +1,6 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); kuzzle.getAuthController().login("local", credentials).get(); -ConcurrentHashMap result = kuzzle.getAuthController().getCurrentUser().get(); +Map result = kuzzle.getAuthController().getCurrentUser().get(); diff --git a/doc/1/controllers/auth/get-current-user/snippets/get-current-user-kotlin.kt b/doc/1/controllers/auth/get-current-user/snippets/get-current-user-kotlin.kt index 1cd88997..b8b8eaf8 100644 --- a/doc/1/controllers/auth/get-current-user/snippets/get-current-user-kotlin.kt +++ b/doc/1/controllers/auth/get-current-user/snippets/get-current-user-kotlin.kt @@ -1,7 +1,7 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() -val result: ConcurrentHashMap = +val result: Map = kuzzle.authController.getCurrentUser().get() diff --git a/doc/1/controllers/auth/get-my-credentials/index.md b/doc/1/controllers/auth/get-my-credentials/index.md index 4f52fca2..a0b7dfae 100644 --- a/doc/1/controllers/auth/get-my-credentials/index.md +++ b/doc/1/controllers/auth/get-my-credentials/index.md @@ -15,7 +15,7 @@ Returns the current user's credential information for the specified strategy. Th ## Arguments ```java -public CompletableFuture> getMyCredentials(String strategy) +public CompletableFuture> getMyCredentials(String strategy) throws NotConnectedException, InternalException ``` @@ -25,7 +25,7 @@ public CompletableFuture> getMyCredentials(Str ## Return -Returns a ConcurrentHashMap representing the credentials for the provided authentication strategy. +Returns a Map representing the credentials for the provided authentication strategy. ## Usage @@ -38,7 +38,7 @@ Returns a ConcurrentHashMap representing the credentials for the provided authen ```kotlin fun getMyCredentials( - strategy: String): CompletableFuture> + strategy: String): CompletableFuture> ``` | Argument | Type | Description | @@ -47,7 +47,7 @@ fun getMyCredentials( ## Return -Returns a ConcurrentHashMap representing the credentials for the provided authentication strategy. +Returns a Map representing the credentials for the provided authentication strategy. ## Usage diff --git a/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-java.java b/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-java.java index 916cc641..910e976a 100644 --- a/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-java.java +++ b/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); kuzzle.getAuthController().login("local", credentials).get(); -ConcurrentHashMap result = +Map result = kuzzle.getAuthController().getMyCredentials("local").get(); diff --git a/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-kotlin.kt b/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-kotlin.kt index cade3802..d3abcaee 100644 --- a/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-kotlin.kt @@ -1,7 +1,7 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() -val result: ConcurrentHashMap = +val result: Map = kuzzle.authController.getMyCredentials("local").get() diff --git a/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-java.java b/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-java.java index d93e5473..34448e8e 100644 --- a/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-java.java +++ b/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); diff --git a/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-kotlin.kt b/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-kotlin.kt index f1bc2ad5..fd7adc31 100644 --- a/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-kotlin.kt +++ b/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/get-strategies/snippets/get-strategies-java.java b/doc/1/controllers/auth/get-strategies/snippets/get-strategies-java.java index 0f19782b..9f8537e2 100644 --- a/doc/1/controllers/auth/get-strategies/snippets/get-strategies-java.java +++ b/doc/1/controllers/auth/get-strategies/snippets/get-strategies-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); diff --git a/doc/1/controllers/auth/get-strategies/snippets/get-strategies-kotlin.kt b/doc/1/controllers/auth/get-strategies/snippets/get-strategies-kotlin.kt index 458a310e..d9bded55 100644 --- a/doc/1/controllers/auth/get-strategies/snippets/get-strategies-kotlin.kt +++ b/doc/1/controllers/auth/get-strategies/snippets/get-strategies-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/login/index.md b/doc/1/controllers/auth/login/index.md index e97d72ec..40d02401 100644 --- a/doc/1/controllers/auth/login/index.md +++ b/doc/1/controllers/auth/login/index.md @@ -17,15 +17,15 @@ If this action is successful, all further requests emitted by this SDK instance ## Arguments ```java -CompletableFuture> login( +CompletableFuture> login( final String strategy, - final ConcurrentHashMap credentials, + final Map credentials, final String expiresIn) throws NotConnectedException, InternalException -CompletableFuture> login( +CompletableFuture> login( final String strategy, - final ConcurrentHashMap credentials) + final Map credentials) throws NotConnectedException, InternalException ``` @@ -34,7 +34,7 @@ CompletableFuture> login( | Argument | Type | Description | |---------------|----------------------|--------------------------------------| | `strategy` |
String
| Strategy to use | -| `credentials` |
ConcurrentHashMap
| Hashmap representing the credentials | +| `credentials` |
Map
| Hashmap representing the credentials | | `expiresIn` |
String
| Token duration | #### strategy @@ -77,8 +77,8 @@ Once `auth:login` has been called, the returned authentication token is stored b ```kotlin fun login( strategy: String, - credentials: ConcurrentHashMap?, - expiresIn: String? = null): CompletableFuture> + credentials: Map?, + expiresIn: String? = null): CompletableFuture> ```
@@ -86,7 +86,7 @@ fun login( | Argument | Type | Description | |---------------|----------------------|--------------------------------------| | `strategy` |
String
| Strategy to use | -| `credentials` |
ConcurrentHashMap
| Hashmap representing the credentials | +| `credentials` |
Map
| Hashmap representing the credentials | | `expiresIn` |
String?
| Token duration | #### strategy diff --git a/doc/1/controllers/auth/login/snippets/login-java.java b/doc/1/controllers/auth/login/snippets/login-java.java index 7db19af2..25dfc414 100644 --- a/doc/1/controllers/auth/login/snippets/login-java.java +++ b/doc/1/controllers/auth/login/snippets/login-java.java @@ -1,6 +1,6 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); -ConcurrentHashMap result = +Map result = kuzzle.getAuthController().login("local", credentials).get(); diff --git a/doc/1/controllers/auth/login/snippets/login-kotlin.kt b/doc/1/controllers/auth/login/snippets/login-kotlin.kt index c825d6b4..4d094b6d 100644 --- a/doc/1/controllers/auth/login/snippets/login-kotlin.kt +++ b/doc/1/controllers/auth/login/snippets/login-kotlin.kt @@ -1,5 +1,5 @@ -val result: ConcurrentHashMap = - kuzzle.authController.login("local", ConcurrentHashMap().apply { +val result: Map = + kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() \ No newline at end of file diff --git a/doc/1/controllers/auth/logout/snippets/logout-java.java b/doc/1/controllers/auth/logout/snippets/logout-java.java index d2a8f8b2..ff7bb5d1 100644 --- a/doc/1/controllers/auth/logout/snippets/logout-java.java +++ b/doc/1/controllers/auth/logout/snippets/logout-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); diff --git a/doc/1/controllers/auth/logout/snippets/logout-kotlin.kt b/doc/1/controllers/auth/logout/snippets/logout-kotlin.kt index 1883221e..f5d6b8d2 100644 --- a/doc/1/controllers/auth/logout/snippets/logout-kotlin.kt +++ b/doc/1/controllers/auth/logout/snippets/logout-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/refresh-token/index.md b/doc/1/controllers/auth/refresh-token/index.md index f998c1b0..925f6d3b 100644 --- a/doc/1/controllers/auth/refresh-token/index.md +++ b/doc/1/controllers/auth/refresh-token/index.md @@ -19,10 +19,10 @@ Refreshes an authentication token. ## Arguments ```java -CompletableFuture> refreshToken( +CompletableFuture> refreshToken( String expiresIn) throws NotConnectedException, InternalException -CompletableFuture> refreshToken() +CompletableFuture> refreshToken() throws NotConnectedException, InternalException ``` @@ -34,7 +34,7 @@ CompletableFuture> refreshToken() ## Return -A ConcurrentHashMap with the following properties: +A Map with the following properties: | Property | Type | Description | |-------------|-------------------|------------------------------------------------------------------------------------------| @@ -55,7 +55,7 @@ Once `auth:refreshToken` has been called, the returned authentication token is s ```kotlin fun refreshToken( - expiresIn: String? = null): CompletableFuture> + expiresIn: String? = null): CompletableFuture> ``` **Optional:** @@ -66,7 +66,7 @@ fun refreshToken( ## Return -A ConcurrentHashMap with the following properties: +A Map with the following properties: | Property | Type | Description | |-------------|-------------------|------------------------------------------------------------------------------------------| diff --git a/doc/1/controllers/auth/refresh-token/snippets/refresh-token-java.java b/doc/1/controllers/auth/refresh-token/snippets/refresh-token-java.java index 4883c424..53226b47 100644 --- a/doc/1/controllers/auth/refresh-token/snippets/refresh-token-java.java +++ b/doc/1/controllers/auth/refresh-token/snippets/refresh-token-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); kuzzle.getAuthController().login("local", credentials).get(); -ConcurrentHashMap result = +Map result = kuzzle.getAuthController().refreshToken("1h").get(); diff --git a/doc/1/controllers/auth/refresh-token/snippets/refresh-token-kotlin.kt b/doc/1/controllers/auth/refresh-token/snippets/refresh-token-kotlin.kt index 80de17c5..2a153783 100644 --- a/doc/1/controllers/auth/refresh-token/snippets/refresh-token-kotlin.kt +++ b/doc/1/controllers/auth/refresh-token/snippets/refresh-token-kotlin.kt @@ -1,7 +1,7 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() -val result: ConcurrentHashMap = +val result: Map = kuzzle.authController.refreshToken("1h").get(); diff --git a/doc/1/controllers/auth/update-my-credentials/index.md b/doc/1/controllers/auth/update-my-credentials/index.md index 8dc35dc2..d1019370 100644 --- a/doc/1/controllers/auth/update-my-credentials/index.md +++ b/doc/1/controllers/auth/update-my-credentials/index.md @@ -15,20 +15,20 @@ Updates the current user's credentials for the specified strategy. The credentia ## Arguments ```java -CompletableFuture> updateMyCredentials( +CompletableFuture> updateMyCredentials( String strategy, - ConcurrentHashMap credentials) + Map credentials) throws NotConnectedException, InternalException ``` | Argument | Type | Description | |---------------|--------------------|--------------------------------------| | `strategy` |
String
| Strategy to use | -| `credentials` |
ConcurrentHashMap
| JObject representing the credentials | +| `credentials` |
Map
| JObject representing the credentials | ## Return -A ConcurrentHashMap representing the updated credentials with the following properties: +A Map representing the updated credentials with the following properties: | Property | Type | Description | |------------|-------------------|-------------------| @@ -46,17 +46,17 @@ A ConcurrentHashMap representing the updated credentials with the following prop ```kotlin fun updateMyCredentials( strategy: String, - credentials: ConcurrentHashMap): CompletableFuture> + credentials: Map): CompletableFuture> ``` | Argument | Type | Description | |---------------|--------------------|--------------------------------------| | `strategy` |
String
| Strategy to use | -| `credentials` |
ConcurrentHashMap
| JObject representing the credentials | +| `credentials` |
Map
| JObject representing the credentials | ## Return -A ConcurrentHashMap representing the updated credentials with the following properties: +A Map representing the updated credentials with the following properties: | Property | Type | Description | |------------|-------------------|-------------------| diff --git a/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-java.java b/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-java.java index 73021f4f..5c6e53e6 100644 --- a/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-java.java +++ b/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-java.java @@ -1,6 +1,6 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); kuzzle.getAuthController().login("local", credentials).get(); -ConcurrentHashMap result = kuzzle.getAuthController().updateMyCredentials("local", credentials).get(); +Map result = kuzzle.getAuthController().updateMyCredentials("local", credentials).get(); diff --git a/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-kotlin.kt b/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-kotlin.kt index 7340f5f1..2f5435b3 100644 --- a/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-kotlin.kt @@ -1,9 +1,9 @@ -val credentials = ConcurrentHashMap().apply { +val credentials = Map().apply { put("username", "foo") put("password", "bar") } kuzzle.authController.login("local", credentials).get() -val result: ConcurrentHashMap = +val result: Map = kuzzle.authController.updateMyCredentials("local", credentials).get(); diff --git a/doc/1/controllers/auth/update-self/index.md b/doc/1/controllers/auth/update-self/index.md index 0ba67e61..2ae8a186 100644 --- a/doc/1/controllers/auth/update-self/index.md +++ b/doc/1/controllers/auth/update-self/index.md @@ -15,23 +15,23 @@ Updates the current user object in Kuzzle. ## Arguments ```java -CompletableFuture> updateSelf( - final ConcurrentHashMap content) +CompletableFuture> updateSelf( + final Map content) throws NotConnectedException, InternalException ``` | Argument | Type | Description | |-----------|--------------------|---------------------------------------| -| `content` |
ConcurrentHashMap
| Hashmap representing the user content | +| `content` |
Map
| Hashmap representing the user content | ## Return -Returns a ConcurrentHashMap with the following properties: +Returns a Map with the following properties: | Property | Type | Description | |-----------|--------------------|-------------------------------------------| | `_id` |
String
| User's `kuid` | -| `_source` |
ConcurrentHashMap
| Additional (and optional) user properties | +| `_source` |
Map
| Additional (and optional) user properties | ## Usage @@ -44,21 +44,21 @@ Returns a ConcurrentHashMap with the following properties: ```kotlin fun updateSelf( - content: ConcurrentHashMap): CompletableFuture> + content: Map): CompletableFuture> ``` | Argument | Type | Description | |-----------|--------------------|---------------------------------------| -| `content` |
ConcurrentHashMap
| Hashmap representing the user content | +| `content` |
Map
| Hashmap representing the user content | ## Return -Returns a ConcurrentHashMap with the following properties: +Returns a Map with the following properties: | Property | Type | Description | |-----------|--------------------|-------------------------------------------| | `_id` |
String
| User's `kuid` | -| `_source` |
ConcurrentHashMap
| Additional (and optional) user properties | +| `_source` |
Map
| Additional (and optional) user properties | ## Usage diff --git a/doc/1/controllers/auth/update-self/snippets/update-self-java.java b/doc/1/controllers/auth/update-self/snippets/update-self-java.java index 4d142b15..4cdab2f3 100644 --- a/doc/1/controllers/auth/update-self/snippets/update-self-java.java +++ b/doc/1/controllers/auth/update-self/snippets/update-self-java.java @@ -1,11 +1,11 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); kuzzle.getAuthController().login("local", credentials).get(); -ConcurrentHashMap custom = new ConcurrentHashMap<>(); +Map custom = new HashMap<>(); custom.put("age", 42); -ConcurrentHashMap result = +Map result = kuzzle.getAuthController().updateSelf(custom).get(); diff --git a/doc/1/controllers/auth/update-self/snippets/update-self-kotlin.kt b/doc/1/controllers/auth/update-self/snippets/update-self-kotlin.kt index 171d8752..adf3a0ed 100644 --- a/doc/1/controllers/auth/update-self/snippets/update-self-kotlin.kt +++ b/doc/1/controllers/auth/update-self/snippets/update-self-kotlin.kt @@ -1,9 +1,9 @@ -kuzzle.authController.login("local", ConcurrentHashMap().apply { +kuzzle.authController.login("local", Map().apply { put("username", "foo") put("password", "bar") }).get() -val result: ConcurrentHashMap = - kuzzle.authController.updateSelf(ConcurrentHashMap().apply { +val result: Map = + kuzzle.authController.updateSelf(Map().apply { put("age", 42) }).get(); diff --git a/doc/1/controllers/auth/validate-my-credentials/index.md b/doc/1/controllers/auth/validate-my-credentials/index.md index 883ada6c..dd090474 100644 --- a/doc/1/controllers/auth/validate-my-credentials/index.md +++ b/doc/1/controllers/auth/validate-my-credentials/index.md @@ -16,14 +16,14 @@ Validates the current user's credentials for the specified strategy. This method ```java CompletableFuture validateMyCredentials(final String strategy, - final ConcurrentHashMap credentials) + final Map credentials) throws NotConnectedException, InternalException ``` | Argument | Type | Description | |---------------|--------------------|--------------------------------------| | `strategy` |
String
| Strategy to use | -| `credentials` |
ConcurrentHashMap
| A Hashmap representing the credentials | +| `credentials` |
Map
| A Hashmap representing the credentials | ## Return @@ -40,13 +40,13 @@ A Boolean indicating if the credentials are valid. ```kotlin fun validateMyCredentials(strategy: String, - credentials: ConcurrentHashMap): CompletableFuture + credentials: Map): CompletableFuture ``` | Argument | Type | Description | |---------------|--------------------|--------------------------------------| | `strategy` |
String
| Strategy to use | -| `credentials` |
ConcurrentHashMap
| A Hashmap representing the credentials | +| `credentials` |
Map
| A Hashmap representing the credentials | ## Return diff --git a/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-java.java b/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-java.java index 2888af52..1d5a2402 100644 --- a/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-java.java +++ b/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap credentials = new ConcurrentHashMap<>(); +Map credentials = new HashMap<>(); credentials.put("username", "foo"); credentials.put("password", "bar"); diff --git a/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-kotlin.kt b/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-kotlin.kt index 8b3e1e51..36262b80 100644 --- a/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-kotlin.kt @@ -1,4 +1,4 @@ -val credentials = ConcurrentHashMap().apply { +val credentials = Map().apply { put("username", "foo") put("password", "bar") } diff --git a/doc/1/controllers/bulk/delete-by-query/index.md b/doc/1/controllers/bulk/delete-by-query/index.md index 137c70a7..ed177a98 100644 --- a/doc/1/controllers/bulk/delete-by-query/index.md +++ b/doc/1/controllers/bulk/delete-by-query/index.md @@ -20,14 +20,14 @@ Kuzzle uses the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasti public CompletableFuture deleteByQuery( String index, String collection, - ConcurrentHashMap searchQuery, + Map searchQuery, Boolean waitForRefresh ) throws NotConnectedException, InternalException public CompletableFuture deleteByQuery( String index, String collection, - ConcurrentHashMap searchQuery + Map searchQuery ) throws NotConnectedException, InternalException ``` @@ -37,7 +37,7 @@ public CompletableFuture deleteByQuery( | ------------ | ------------------------------------ | --------------------------------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `searchQuery` |
ConcurrentHashMap
| JSON representing the query to match | +| `searchQuery` |
Map
| JSON representing the query to match | | `waitForRefresh` |
Bool

(`false`) | If set to true, Kuzzle will not respond until the delete documents are indexed | @@ -58,7 +58,7 @@ An Int containing the number of deleted documents. fun deleteByQuery( index: String, collection: String, - searchQuery: ConcurrentHashMap, + searchQuery: Map, waitForRefresh: Boolean? = null ): CompletableFuture ``` @@ -69,7 +69,7 @@ fun deleteByQuery( | ------------ | ------------------------------------ | --------------------------------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `searchQuery` |
ConcurrentHashMap
| JSON representing the query to match | +| `searchQuery` |
Map
| JSON representing the query to match | | `waitForRefresh` |
Boolean

(`false`) | If set to true, Kuzzle will not respond until the delete documents are indexed | diff --git a/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-java.java b/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-java.java index bb52990d..2fce92b0 100644 --- a/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-java.java +++ b/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap term = new ConcurrentHashMap(); +Map term = new HashMap(); term.put("capacity", 7); -ConcurrentHashMap searchQuery = new ConcurrentHashMap(); +Map searchQuery = new HashMap(); searchQuery.put("query", term); Integer result = kuzzle.getBulkController().deleteByQuery("nyc-open-data", "yellow-taxi", searchQuery).get(); diff --git a/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-kotlin.kt b/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-kotlin.kt index 4e6cfabb..9808c725 100644 --- a/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-kotlin.kt +++ b/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-kotlin.kt @@ -1,6 +1,6 @@ -val searchQuery: ConcurrentHashMap = ConcurrentHashMap().apply { - put("query", ConcurrentHashMap().apply { - put("term", ConcurrentHashMap().apply { +val searchQuery: Map = Map().apply { + put("query", Map().apply { + put("term", Map().apply { put("capacity", 7) }) }) diff --git a/doc/1/controllers/bulk/import-data/index.md b/doc/1/controllers/bulk/import-data/index.md index 519c14e3..680af115 100644 --- a/doc/1/controllers/bulk/import-data/index.md +++ b/doc/1/controllers/bulk/import-data/index.md @@ -17,10 +17,10 @@ This route is faster than the `document:m*` routes family (e.g. [document:mCreat ## Arguments ```java -public CompletableFuture> importData( +public CompletableFuture> importData( String index, String collection, - ArrayList> bulkData + ArrayList> bulkData ) throws NotConnectedException, InternalException ``` @@ -28,7 +28,7 @@ public CompletableFuture> importData( |--------------|-------------------|--------------------------------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `bulkData` |
ArrayList>
| Bulk operations to perform, following ElasticSearch Bulk API | +| `bulkData` |
ArrayList>
| Bulk operations to perform, following ElasticSearch Bulk API | ### bulkData @@ -55,12 +55,12 @@ Learn more at [Elasticsearch Bulk API](https://www.elastic.co/guide/en/elasticse ## Return -A ConcurrentHashMap containing 2 arrays: +A Map containing 2 arrays: | Property | Type | Description | | -------- | ------------------- | --------------------------------------------------- | -| `successes` |
ArrayList>
| Array of object containing successful document import | -| `errors` |
ArrayList>
| Array of object containing failed document import | +| `successes` |
ArrayList>
| Array of object containing successful document import | +| `errors` |
ArrayList>
| Array of object containing failed document import | Each item of the `successes` array is an object containing the action name as key and the corresponding object contain the following properties: @@ -75,7 +75,7 @@ Each item of the `errors` array is an object containing the action name as key a | -------- | ------------------- | --------------------------------------------------- | | `_id` |
String
| Document unique identifier | | `status` |
Integer
| HTTP status code for that query | -| `error` |
| Error object | +| `error` |
| Error object | Each `error` object contain the following properties: @@ -97,15 +97,15 @@ Each `error` object contain the following properties: fun importData( index: String, collection: String, - bulkData: ArrayList> - ): CompletableFuture> + bulkData: ArrayList> + ): CompletableFuture> ``` | Argument | Type | Description | |--------------|-------------------|--------------------------------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `bulkData` |
ArrayList>
| Bulk operations to perform, following ElasticSearch Bulk API | +| `bulkData` |
ArrayList>
| Bulk operations to perform, following ElasticSearch Bulk API | ### bulkData @@ -132,12 +132,12 @@ Learn more at [Elasticsearch Bulk API](https://www.elastic.co/guide/en/elasticse ## Return -A ConcurrentHashMap containing 2 arrays: +A Map containing 2 arrays: | Property | Type | Description | | -------- | ------------------- | --------------------------------------------------- | -| `successes` |
ArrayList>
| Array of object containing successful document import | -| `errors` |
ArrayList>
| Array of object containing failed document import | +| `successes` |
ArrayList>
| Array of object containing successful document import | +| `errors` |
ArrayList>
| Array of object containing failed document import | Each item of the `successes` array is an object containing the action name as key and the corresponding object contain the following properties: @@ -152,7 +152,7 @@ Each item of the `errors` array is an object containing the action name as key a | -------- | ------------------- | --------------------------------------------------- | | `_id` |
String
| Document unique identifier | | `status` |
Int
| HTTP status code for that query | -| `error` |
| Error object | +| `error` |
| Error object | Each `error` object contain the following properties: diff --git a/doc/1/controllers/bulk/import-data/snippets/import-data-java.java b/doc/1/controllers/bulk/import-data/snippets/import-data-java.java index 7cb56f83..6d6c8791 100644 --- a/doc/1/controllers/bulk/import-data/snippets/import-data-java.java +++ b/doc/1/controllers/bulk/import-data/snippets/import-data-java.java @@ -1,31 +1,31 @@ -ConcurrentHashMap index = new ConcurrentHashMap(); -index.put("index", new ConcurrentHashMap()); +Map index = new HashMap(); +index.put("index", new HashMap()); -ConcurrentHashMap document = new ConcurrentHashMap(); +Map document = new HashMap(); document.put("a", "document"); document.put("with", "any"); document.put("number", "of fields"); -ConcurrentHashMap id = new ConcurrentHashMap(); +Map id = new HashMap(); id.put("_id", "uniq-id-1"); -ConcurrentHashMap create = new ConcurrentHashMap(); +Map create = new HashMap(); create.put("create", id); -ConcurrentHashMap document2 = new ConcurrentHashMap(); +Map document2 = new HashMap(); document2.put("another", "document"); -ConcurrentHashMap id2 = new ConcurrentHashMap(); +Map id2 = new HashMap(); id2.put("_id", "uniq-id-2"); -ConcurrentHashMap create2 = new ConcurrentHashMap(); +Map create2 = new HashMap(); create2.put("create", id2); -ConcurrentHashMap another = new ConcurrentHashMap(); +Map another = new HashMap(); id2.put("another", "one"); -ConcurrentHashMap and = new ConcurrentHashMap(); +Map and = new HashMap(); create2.put("and", another); -ArrayList> bulkData = new ArrayList>(); +ArrayList> bulkData = new ArrayList>(); bulkData.add(index); bulkData.add(document); bulkData.add(create); @@ -33,7 +33,7 @@ bulkData.add(create2); bulkData.add(and); -ConcurrentHashMap result = +Map result = kuzzle.getBulkController().importData( "nyc-open-data", "yellow-taxi", diff --git a/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt b/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt index 0707aed3..947cf1aa 100644 --- a/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt +++ b/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt @@ -1,39 +1,39 @@ -val bulkData: ArrayList> = ArrayList>().apply { - add(ConcurrentHashMap().apply { - put("index", ConcurrentHashMap()); +val bulkData: ArrayList> = ArrayList>().apply { + add(Map().apply { + put("index", Map()); }); - add(ConcurrentHashMap().apply { + add(Map().apply { put("a", "document"); put("with", "any"); put("number", "of fields"); }); - add(ConcurrentHashMap().apply { + add(Map().apply { put("create", - ConcurrentHashMap().apply { + Map().apply { put("_id", "uniq-id-1"); } ); }); - add(ConcurrentHashMap().apply { + add(Map().apply { put("another", "document"); }); - add(ConcurrentHashMap().apply { + add(Map().apply { put("create", - ConcurrentHashMap().apply { + Map().apply { put("_id", "uniq-id-2"); } ); }); - add(ConcurrentHashMap().apply { + add(Map().apply { put("and", - ConcurrentHashMap().apply { + Map().apply { put("another", "one"); } ); }); }; -val result: ConcurrentHashMap = +val result: Map = kuzzle.bulkController.importData( "nyc-open-data", "yellow-taxi", diff --git a/doc/1/controllers/bulk/m-write/index.md b/doc/1/controllers/bulk/m-write/index.md index 4847f7c9..a2f60974 100644 --- a/doc/1/controllers/bulk/m-write/index.md +++ b/doc/1/controllers/bulk/m-write/index.md @@ -18,10 +18,10 @@ This is a low level route intended to bypass Kuzzle actions on document creation ## Arguments ```java -public CompletableFuture> importData ( +public CompletableFuture> importData ( String index, String collection, - ArrayList> bulkData + ArrayList> bulkData ) throws NotConnectedException, InternalException ``` @@ -29,11 +29,11 @@ public CompletableFuture> importData ( |--------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `documents` |
ArrayList>
| An array of JObject representing the documents| +| `documents` |
ArrayList>
| An array of JObject representing the documents| ### documents -An array of `ConcurrentHashMap`. Each object describes a document to create or replace, by exposing the following properties: +An array of `Map`. Each object describes a document to create or replace, by exposing the following properties: - `_id`: document unique identifier (optional) - `body`: document content @@ -46,7 +46,7 @@ An array of `ConcurrentHashMap`. Each object describes a documen ## Return -Returns a `ConcurrentHashMap` containing 2 arrays: `successes` and `errors` +Returns a `Map` containing 2 arrays: `successes` and `errors` Each created or replaced document is an object of the `successes` array with the following properties: @@ -54,14 +54,14 @@ Each created or replaced document is an object of the `successes` array with the | --------- | ----------------- | ------------------------------------------------------ | | `_id` |
String
| Document ID | | `_version` |
Integer
| Version of the document in the persistent data storage | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | | `created` |
Bool
| True if the document was created | Each errored document is an object of the `errors` array with the following properties: | Name | Type | Description | | --------- | ----------------- | ------------------------------------------------------ | -| `document` |
ConcurrentHashMap
| Document that cause the error | +| `document` |
Map
| Document that cause the error | | `status` |
Integer
| HTTP error status | | `reason` |
String
| Human readable reason | @@ -78,19 +78,19 @@ Each errored document is an object of the `errors` array with the following prop fun importData( index: String, collection: String, - bulkData: ArrayList> -): CompletableFuture> + bulkData: ArrayList> +): CompletableFuture> ``` | Argument | Type | Description | |--------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `documents` |
ArrayList>
| An array of JObject representing the documents| +| `documents` |
ArrayList>
| An array of JObject representing the documents| ### documents -An array of `ConcurrentHashMap`. Each object describes a document to create or replace, by exposing the following properties: +An array of `Map`. Each object describes a document to create or replace, by exposing the following properties: - `_id`: document unique identifier (optional) - `body`: document content @@ -103,7 +103,7 @@ An array of `ConcurrentHashMap`. Each object describes a document ## Return -Returns a `ConcurrentHashMap` containing 2 arrays: `successes` and `errors` +Returns a `Map` containing 2 arrays: `successes` and `errors` Each created or replaced document is an object of the `successes` array with the following properties: @@ -111,14 +111,14 @@ Each created or replaced document is an object of the `successes` array with the | --------- | ----------------- | ------------------------------------------------------ | | `_id` |
String
| Document ID | | `_version` |
Int
| Version of the document in the persistent data storage | -| `_source` |
| Document content | +| `_source` |
| Document content | | `created` |
Bool
| True if the document was created | Each errored document is an object of the `errors` array with the following properties: | Name | Type | Description | | --------- | ----------------- | ------------------------------------------------------ | -| `document` |
ConcurrentHashMap
| Document that cause the error | +| `document` |
Map
| Document that cause the error | | `status` |
Int
| HTTP error status | | `reason` |
String
| Human readable reason | diff --git a/doc/1/controllers/bulk/m-write/snippets/mwrite-java.java b/doc/1/controllers/bulk/m-write/snippets/mwrite-java.java index 61ada271..586418b6 100644 --- a/doc/1/controllers/bulk/m-write/snippets/mwrite-java.java +++ b/doc/1/controllers/bulk/m-write/snippets/mwrite-java.java @@ -1,8 +1,8 @@ -ConcurrentHashMap document = new ConcurrentHashMap(); -ArrayList> documents = new ArrayList>(); +Map document = new HashMap(); +ArrayList> documents = new ArrayList>(); documents.add(document); document.put("_id", "foo"); -document.put("body", new ConcurrentHashMap()); +document.put("body", new HashMap()); -ConcurrentHashMap result = +Map result = kuzzle.getBulkController().mWrite("nyc-open-data", "yellow-taxi", documents).get(); \ No newline at end of file diff --git a/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt b/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt index 65801dfe..4ee6b54c 100644 --- a/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt +++ b/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt @@ -1,9 +1,9 @@ -val documents: ArrayList> = ArrayList>().apply { - add(ConcurrentHashMap().apply { +val documents: ArrayList> = ArrayList>().apply { + add(Map().apply { put("_id", "foo") - put("body", ConcurrentHashMap()) + put("body", Map()) }) }; -val result: ConcurrentHashMap = +val result: Map = kuzzle.bulkController.mWrite("nyc-open-data", "yellow-taxi", documents).get(); \ No newline at end of file diff --git a/doc/1/controllers/bulk/write/index.md b/doc/1/controllers/bulk/write/index.md index 2762c1fb..64c0ac30 100644 --- a/doc/1/controllers/bulk/write/index.md +++ b/doc/1/controllers/bulk/write/index.md @@ -15,34 +15,34 @@ Create or replace a document directly into the storage engine. ## Arguments ```java -public CompletableFuture> write( +public CompletableFuture> write( String index, String collection, - ConcurrentHashMap content, + Map content, String id, Bool notify, Bool waitForRefresh ) throws NotConnectedException, InternalException -public CompletableFuture> write( +public CompletableFuture> write( String index, String collection, - ConcurrentHashMap content, + Map content, String id, Bool notify ) throws NotConnectedException, InternalException -public CompletableFuture> write( +public CompletableFuture> write( String index, String collection, - ConcurrentHashMap content, + Map content, String id ) throws NotConnectedException, InternalException -public CompletableFuture> write( +public CompletableFuture> write( String index, String collection, - ConcurrentHashMap content + Map content ) throws NotConnectedException, InternalException ``` @@ -50,19 +50,19 @@ public CompletableFuture> write( |--------------|--------------------|-----------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `content` |
ConcurrentHashMap
| Document content to create. | +| `content` |
Map
| Document content to create. | | `id` |
String

(`null`) | set the document unique ID to the provided value, instead of auto-generating a random ID | | `waitForRefresh` |
Bool

(`false`) | If set to true, Kuzzle will not respond until the created/replaced documents are indexed | | `notify` |
Bool

(`false`) | If set to true, Kuzzle will trigger realtime notifications | ## Return -Return a ConcurrentHashMap with the following properties: +Return a Map with the following properties: | Property | Type | Description | |------------|--------------------|-------------------------------------------------| | `_id` |
String
| Created document unique identifier. | -| `_source` |
ConcurrentHashMap
| Document content. | +| `_source` |
Map
| Document content. | | `_version` |
Int
| Version number of the document | ## Usage @@ -78,18 +78,18 @@ Return a ConcurrentHashMap with the following properties: fun write( index: String, collection: String, - content: ConcurrentHashMap, + content: Map, id: String? = null, notify: Boolean? = null, waitForRefresh: Boolean? = null): - CompletableFuture> + CompletableFuture> ``` | Argument | Type | Description | |--------------|--------------------|-----------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `content` |
ConcurrentHashMap
| Document content to create. | +| `content` |
Map
| Document content to create. | ### Options @@ -102,12 +102,12 @@ fun write( ## Return -Return a ConcurrentHashMap with the following properties: +Return a Map with the following properties: | Property | Type | Description | |------------|--------------------|-------------------------------------------------| | `_id` |
String
| Created document unique identifier. | -| `_source` |
ConcurrentHashMap
| Document content. | +| `_source` |
Map
| Document content. | | `_version` |
Int
| Version number of the document | ## Usage diff --git a/doc/1/controllers/bulk/write/snippets/write-java.java b/doc/1/controllers/bulk/write/snippets/write-java.java index 8a99a89e..5cee8e5e 100644 --- a/doc/1/controllers/bulk/write/snippets/write-java.java +++ b/doc/1/controllers/bulk/write/snippets/write-java.java @@ -1,9 +1,9 @@ -ConcurrentHashMap content = new ConcurrentHashMap(); -ConcurrentHashMap kuzzleInfo = new ConcurrentHashMap(); +Map content = new HashMap(); +Map kuzzleInfo = new HashMap(); kuzzleInfo.put("author", ""); kuzzleInfo.put("createdAd", "1481816934209"); content.put("_kuzzle_info", kuzzleInfo); -ConcurrentHashMap result = +Map result = kuzzle.getBulkController().write("nyc-open-data", "yellow-taxi", content).get(); \ No newline at end of file diff --git a/doc/1/controllers/bulk/write/snippets/write-kotlin.kt b/doc/1/controllers/bulk/write/snippets/write-kotlin.kt index 7cef1c2e..95798480 100644 --- a/doc/1/controllers/bulk/write/snippets/write-kotlin.kt +++ b/doc/1/controllers/bulk/write/snippets/write-kotlin.kt @@ -1,9 +1,9 @@ -val content: ConcurrentHashMap = ConcurrentHashMap().apply { - put("_kuzzle_info", ConcurrentHashMap().apply { +val content: Map = Map().apply { + put("_kuzzle_info", Map().apply { put("author", "") put("createdAd", "1481816934209") }); } -val result: ConcurrentHashMap = +val result: Map = kuzzle.bulkController.write("nyc-open-data", "yellow-taxi", content).get(); \ No newline at end of file diff --git a/doc/1/controllers/collection/create/index.md b/doc/1/controllers/collection/create/index.md index 953e38a1..5298c00a 100644 --- a/doc/1/controllers/collection/create/index.md +++ b/doc/1/controllers/collection/create/index.md @@ -25,7 +25,7 @@ This method will only update the mappings and/or the settings if the collection public CompletableFuture create( final String index, final String collection, - final ConcurrentHashMap definition) + final Map definition) throws NotConnectedException, InternalException public CompletableFuture create( @@ -38,7 +38,7 @@ throws NotConnectedException, InternalException | ------------------ | -------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `definition` |
ConcurrentHashMap
| Describes the collection mappings and the ES index settings | +| `definition` |
Map
| Describes the collection mappings and the ES index settings | --- @@ -80,14 +80,14 @@ The mappings must have a root field `properties` that contain the mapping defini fun create( index: String, collection: String, - definition: ConcurrentHashMap? + definition: Map? ): CompletableFuture ``` | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `definition` |
ConcurrentHashMap?
| Describes the collection mappings and the ES index settings | +| `definition` |
Map?
| Describes the collection mappings and the ES index settings | --- diff --git a/doc/1/controllers/collection/create/snippets/create-java.java b/doc/1/controllers/collection/create/snippets/create-java.java index a14f491c..71fab277 100644 --- a/doc/1/controllers/collection/create/snippets/create-java.java +++ b/doc/1/controllers/collection/create/snippets/create-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap definition = new ConcurrentHashMap<>(); -ConcurrentHashMap mappings = new ConcurrentHashMap<>(); -ConcurrentHashMap properties = new ConcurrentHashMap<>(); -ConcurrentHashMap license = new ConcurrentHashMap<>(); +Map definition = new HashMap<>(); +Map mappings = new HashMap<>(); +Map properties = new HashMap<>(); +Map license = new HashMap<>(); license.put("type", "keyword"); properties.put("license", license); diff --git a/doc/1/controllers/collection/create/snippets/create-kotlin.kt b/doc/1/controllers/collection/create/snippets/create-kotlin.kt index 5ca6d0bb..603b23d1 100644 --- a/doc/1/controllers/collection/create/snippets/create-kotlin.kt +++ b/doc/1/controllers/collection/create/snippets/create-kotlin.kt @@ -1,13 +1,13 @@ -val type: ConcurrentHashMap = ConcurrentHashMap().apply { +val type: Map = Map().apply { put("type", "keyword") } -val license: ConcurrentHashMap = ConcurrentHashMap().apply { +val license: Map = Map().apply { put("license", type) } -val mappings: ConcurrentHashMap = ConcurrentHashMap().apply { +val mappings: Map = Map().apply { put("properties", license) } -val definition: ConcurrentHashMap = ConcurrentHashMap().apply { +val definition: Map = Map().apply { put("mappings", mappings) } kuzzle.collectionController.create( diff --git a/doc/1/controllers/collection/get-mapping/index.md b/doc/1/controllers/collection/get-mapping/index.md index 43194a4f..b51eaf28 100644 --- a/doc/1/controllers/collection/get-mapping/index.md +++ b/doc/1/controllers/collection/get-mapping/index.md @@ -17,7 +17,7 @@ Returns the collection mapping. ## Arguments ```java -public CompletableFuture> getMapping( +public CompletableFuture> getMapping( final String index, final String collection) throws NotConnectedException, InternalException ``` @@ -31,7 +31,7 @@ public CompletableFuture> getMapping( ## Returns -Returns a `ConcurrentHashMap` representing the collection mappings. +Returns a `Map` representing the collection mappings. ## Usage @@ -46,7 +46,7 @@ Returns a `ConcurrentHashMap` representing the collection mappin fun getMapping( index: String, collection: String - ): CompletableFuture> + ): CompletableFuture> ``` | Arguments | Type | Description | @@ -57,7 +57,7 @@ fun getMapping( ## Returns -Returns a `ConcurrentHashMap` representing the collection mappings. +Returns a `Map` representing the collection mappings. ## Usage diff --git a/doc/1/controllers/collection/get-mapping/snippets/get-mapping-java.java b/doc/1/controllers/collection/get-mapping/snippets/get-mapping-java.java index adb5fd4b..a4feef29 100644 --- a/doc/1/controllers/collection/get-mapping/snippets/get-mapping-java.java +++ b/doc/1/controllers/collection/get-mapping/snippets/get-mapping-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap result = kuzzle +Map result = kuzzle .getCollectionController() .getMapping("nyc-open-data", "yellow-taxi") .get(); diff --git a/doc/1/controllers/collection/get-specifications/index.md b/doc/1/controllers/collection/get-specifications/index.md index bd537333..5caae6b7 100644 --- a/doc/1/controllers/collection/get-specifications/index.md +++ b/doc/1/controllers/collection/get-specifications/index.md @@ -17,7 +17,7 @@ Returns the validation specifications associated to the given index and collecti ## Arguments ```java - public CompletableFuture> getSpecifications( + public CompletableFuture> getSpecifications( final String index, final String collection) ``` @@ -31,7 +31,7 @@ Returns the validation specifications associated to the given index and collecti ## Returns -Returns a `ConcurrentHashMap` representing the collection specifications. +Returns a `Map` representing the collection specifications. ## Usage @@ -46,7 +46,7 @@ Returns a `ConcurrentHashMap` representing the collection specif fun getSpecifications( index: String, collection: String - ): CompletableFuture> + ): CompletableFuture> ``` | Arguments | Type | Description | @@ -56,7 +56,7 @@ fun getSpecifications( ## Returns -Returns a `ConcurrentHashMap` representing the collection specifications. +Returns a `Map` representing the collection specifications. ## Usage diff --git a/doc/1/controllers/collection/get-specifications/snippets/get-specifications-java.java b/doc/1/controllers/collection/get-specifications/snippets/get-specifications-java.java index fb1c4e81..135198d5 100644 --- a/doc/1/controllers/collection/get-specifications/snippets/get-specifications-java.java +++ b/doc/1/controllers/collection/get-specifications/snippets/get-specifications-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap result = kuzzle +Map result = kuzzle .getCollectionController() .getSpecifications("nyc-open-data", "yellow-taxi") .get(); diff --git a/doc/1/controllers/collection/list/index.md b/doc/1/controllers/collection/list/index.md index cebf30d0..d1d8b615 100644 --- a/doc/1/controllers/collection/list/index.md +++ b/doc/1/controllers/collection/list/index.md @@ -18,7 +18,7 @@ The returned list is sorted in alphanumerical order. ## Arguments ```java -public CompletableFuture> list( +public CompletableFuture> list( final String index) throws NotConnectedException, InternalException ``` @@ -29,7 +29,7 @@ public CompletableFuture> list( ## Returns -Returns a `ConcurrentHashMap` containing the following properties: +Returns a `Map` containing the following properties: | Property | Type | Description | | ------------- | ------------------- | ------------------------------------------------------------------ | @@ -55,7 +55,7 @@ Each object in the `collections` array contains the following properties: ## Arguments ```kotlin -fun list(index: String): CompletableFuture> +fun list(index: String): CompletableFuture> ``` @@ -65,7 +65,7 @@ fun list(index: String): CompletableFuture> ## Returns -Returns a `ConcurrentHashMap` containing the following properties: +Returns a `Map` containing the following properties: | Property | Type | Description | | ------------- | ------------------- | ------------------------------------------------------------------ | diff --git a/doc/1/controllers/collection/list/snippets/list-java.java b/doc/1/controllers/collection/list/snippets/list-java.java index 05bd5975..43e6e130 100644 --- a/doc/1/controllers/collection/list/snippets/list-java.java +++ b/doc/1/controllers/collection/list/snippets/list-java.java @@ -1,4 +1,4 @@ - ConcurrentHashMap result = kuzzle + Map result = kuzzle .getCollectionController() .list("nyc-open-data") .get(); diff --git a/doc/1/controllers/collection/search-specifications/index.md b/doc/1/controllers/collection/search-specifications/index.md index 3639bad1..cd49ca27 100644 --- a/doc/1/controllers/collection/search-specifications/index.md +++ b/doc/1/controllers/collection/search-specifications/index.md @@ -26,22 +26,22 @@ When processing a large number of items (i.e. more than 1000), it is advised to ```java public CompletableFuture searchSpecifications( - ConcurrentHashMap searchQuery, + Map searchQuery, String scroll, Integer from, Integer size) throws NotConnectedException, InternalException public CompletableFuture searchSpecifications( - ConcurrentHashMap searchQuery, + Map searchQuery, String scroll, Integer from) throws NotConnectedException, InternalException public CompletableFuture searchSpecifications( - ConcurrentHashMap searchQuery, + Map searchQuery, String scroll) throws NotConnectedException, InternalException public CompletableFuture searchSpecifications( - ConcurrentHashMap searchQuery) + Map searchQuery) throws NotConnectedException, InternalException ``` @@ -49,7 +49,7 @@ throws NotConnectedException, InternalException | Arguments | Type | Description | | --------- | ----------------- | ------------------------------------- | -| `searchQuery` |
ConcurrentHashMap
| An object containing the search query | +| `searchQuery` |
Map
| An object containing the search query | | `from` |
Integer

(`0`) | Offset of the first document to fetch | | `size` |
Integer

(`10`) | Maximum number of documents to retrieve per page | | `scroll` |
String

(`""`) | When set, gets a forward-only cursor having its ttl set to the given value (e.g. `1s`; see [elasticsearch time limits](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/common-options.html#time-units)) | @@ -77,7 +77,7 @@ Returns a [SearchResult](/sdk/jvm/1/core-classes/search-result) object. ```kotlin fun searchSpecifications( - searchQuery: ConcurrentHashMap, + searchQuery: Map, scroll: String? = null, from: Int = 0, size: Int? = null @@ -88,7 +88,7 @@ fun searchSpecifications( | Arguments | Type | Description | | --------- | ----------------- | ------------------------------------- | -| `searchQuery` |
ConcurrentHashMap
| An object containing the search query | +| `searchQuery` |
Map
| An object containing the search query | | `from` |
Int

(`0`) | Offset of the first document to fetch | | `size` |
Int

(`10`) | Maximum number of documents to retrieve per page | | `scroll` |
String

(`""`) | When set, gets a forward-only cursor having its ttl set to the given value (ie `1s`; cf [elasticsearch time limits](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/common-options.html#time-units)) | diff --git a/doc/1/controllers/collection/search-specifications/snippets/search-specifications-java.java b/doc/1/controllers/collection/search-specifications/snippets/search-specifications-java.java index 5d8bfe56..0b2d33c4 100644 --- a/doc/1/controllers/collection/search-specifications/snippets/search-specifications-java.java +++ b/doc/1/controllers/collection/search-specifications/snippets/search-specifications-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap searchQuery = new ConcurrentHashMap<>(); -ConcurrentHashMap filters = new ConcurrentHashMap<>(); -ConcurrentHashMap args = new ConcurrentHashMap<>(); +Map searchQuery = new HashMap<>(); +Map filters = new HashMap<>(); +Map args = new HashMap<>(); filters.put("match_all", args); searchQuery.put("query", filters); diff --git a/doc/1/controllers/collection/search-specifications/snippets/search-specifications-kotlin.kt b/doc/1/controllers/collection/search-specifications/snippets/search-specifications-kotlin.kt index 5fae555d..a480c403 100644 --- a/doc/1/controllers/collection/search-specifications/snippets/search-specifications-kotlin.kt +++ b/doc/1/controllers/collection/search-specifications/snippets/search-specifications-kotlin.kt @@ -1,10 +1,10 @@ -val args: ConcurrentHashMap = ConcurrentHashMap() -val filters: ConcurrentHashMap = -ConcurrentHashMap().apply { +val args: Map = Map() +val filters: Map = +Map().apply { put("match_all", args) } -val searchQuery: ConcurrentHashMap = -ConcurrentHashMap().apply { +val searchQuery: Map = +Map().apply { put("query", filters) } diff --git a/doc/1/controllers/collection/update-specifications/index.md b/doc/1/controllers/collection/update-specifications/index.md index 147b8529..f45e49a0 100644 --- a/doc/1/controllers/collection/update-specifications/index.md +++ b/doc/1/controllers/collection/update-specifications/index.md @@ -18,10 +18,10 @@ When the validation specification is not formatted correctly, a detailed error m ## Arguments ```java -public CompletableFuture> updateSpecifications( +public CompletableFuture> updateSpecifications( final String index, final String collection, - final ConcurrentHashMap specifications) + final Map specifications) ```
@@ -30,17 +30,17 @@ public CompletableFuture> updateSpecifications | ---------------- | -------------------------------------------- | ------------------------ | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `specifications` |
ConcurrentHashMap
| Specifications to update | +| `specifications` |
Map
| Specifications to update | ### specifications -A `ConcurrentHashMap` representing the specifications. +A `Map` representing the specifications. It must follow the [Specification Structure](/core/2/guides/advanced/data-validation). ## Returns -Returns a `ConcurrentHashMap` containing the specifications. +Returns a `Map` containing the specifications. ## Usage @@ -55,8 +55,8 @@ Returns a `ConcurrentHashMap` containing the specifications. fun updateSpecifications( index: String, collection: String, - definition: ConcurrentHashMap - ): CompletableFuture> + definition: Map + ): CompletableFuture> ```
@@ -65,17 +65,17 @@ fun updateSpecifications( | ---------------- | -------------------------------------------- | ------------------------ | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `specifications` |
ConcurrentHashMap
| Specifications to update | +| `specifications` |
Map
| Specifications to update | ### specifications -A `ConcurrentHashMap` object representing the specifications. +A `Map` object representing the specifications. It must follow the [Specification Structure](/core/2/guides/advanced/data-validation). ## Returns -Returns a `ConcurrentHashMap` containing the specifications. +Returns a `Map` containing the specifications. ## Usage diff --git a/doc/1/controllers/collection/update-specifications/snippets/update-specifications-java.java b/doc/1/controllers/collection/update-specifications/snippets/update-specifications-java.java index e627ca17..2980a56b 100644 --- a/doc/1/controllers/collection/update-specifications/snippets/update-specifications-java.java +++ b/doc/1/controllers/collection/update-specifications/snippets/update-specifications-java.java @@ -1,6 +1,6 @@ - ConcurrentHashMap specifications = new ConcurrentHashMap<>(); - ConcurrentHashMap fields = new ConcurrentHashMap<>(); - ConcurrentHashMap license = new ConcurrentHashMap<>(); + Map specifications = new HashMap<>(); + Map fields = new HashMap<>(); + Map license = new HashMap<>(); specifications.put("strict", false); license.put("mandatory", true); @@ -8,7 +8,7 @@ fields.put("license", license); specifications.put("fields", fields); - ConcurrentHashMap result = kuzzle + Map result = kuzzle .getCollectionController() .updateSpecifications("nyc-open-data", "yellow-taxi", specifications) .get(); diff --git a/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt b/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt index d86cd43a..7cc973cf 100644 --- a/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt +++ b/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt @@ -1,19 +1,19 @@ -val license: ConcurrentHashMap = -ConcurrentHashMap().apply { +val license: Map = +Map().apply { put("mandatory", true); put("type", "string"); }; -val fields: ConcurrentHashMap = -ConcurrentHashMap().apply { +val fields: Map = +Map().apply { put("license", license); }; -val specifications: ConcurrentHashMap = -ConcurrentHashMap().apply{ +val specifications: Map = +Map().apply{ put("strict", false); put("fields", fields); }; -val result: ConcurrentHashMap = kuzzle +val result: Map = kuzzle .collectionController .updateSpecifications("nyc-open-data", "yellow-taxi", specifications) .get(); diff --git a/doc/1/controllers/collection/update/index.md b/doc/1/controllers/collection/update/index.md index 8dd13125..067478b7 100644 --- a/doc/1/controllers/collection/update/index.md +++ b/doc/1/controllers/collection/update/index.md @@ -24,10 +24,10 @@ You can also provide Elasticsearch [index settings](https://www.elastic.co/guide ## Arguments ```java -public CompletableFuture> update( +public CompletableFuture> update( final String index, final String collection, - final ConcurrentHashMap definition) + final Map definition) ``` @@ -37,7 +37,7 @@ public CompletableFuture> update( |--------------|-------------------|-------------------------------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `definition` |
ConcurrentHashMap
| Describes the collection mappings and the ES index settings | +| `definition` |
Map
| Describes the collection mappings and the ES index settings | ### definition @@ -77,7 +77,7 @@ An object containing: fun update( index: String, collection: String, - definition: ConcurrentHashMap + definition: Map ): CompletableFuture ``` @@ -87,7 +87,7 @@ fun update( |--------------|-------------------|-------------------------------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `definition` |
ConcurrentHashMap
| Describes the collection mappings and the ES index settings | +| `definition` |
Map
| Describes the collection mappings and the ES index settings | ### definition diff --git a/doc/1/controllers/collection/update/snippets/update-java.java b/doc/1/controllers/collection/update/snippets/update-java.java index 8a3c7972..788471fd 100644 --- a/doc/1/controllers/collection/update/snippets/update-java.java +++ b/doc/1/controllers/collection/update/snippets/update-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap definition = new ConcurrentHashMap<>(); -ConcurrentHashMap properties = new ConcurrentHashMap<>(); -ConcurrentHashMap _meta = new ConcurrentHashMap<>(); -ConcurrentHashMap plate = new ConcurrentHashMap<>(); +Map definition = new HashMap<>(); +Map properties = new HashMap<>(); +Map _meta = new HashMap<>(); +Map plate = new HashMap<>(); plate.put("type", "keyword"); _meta.put("area", "Panipokhari"); diff --git a/doc/1/controllers/collection/update/snippets/update-kotlin.kt b/doc/1/controllers/collection/update/snippets/update-kotlin.kt index 48883787..3ed51abb 100644 --- a/doc/1/controllers/collection/update/snippets/update-kotlin.kt +++ b/doc/1/controllers/collection/update/snippets/update-kotlin.kt @@ -1,20 +1,20 @@ -val plate: ConcurrentHashMap = -ConcurrentHashMap().apply{ +val plate: Map = +Map().apply{ put("type", "keyword") } -val _meta: ConcurrentHashMap = -ConcurrentHashMap().apply{ +val _meta: Map = +Map().apply{ put("area", "Panipokhari") } -val properties: ConcurrentHashMap = -ConcurrentHashMap().apply{ +val properties: Map = +Map().apply{ put("plate", plate) } -val definition: ConcurrentHashMap = -ConcurrentHashMap().apply{ +val definition: Map = +Map().apply{ put("dynamic", false) put("_meta", _meta) put("properties", properties) diff --git a/doc/1/controllers/collection/validate-specifications/index.md b/doc/1/controllers/collection/validate-specifications/index.md index 131dd998..de0e3830 100644 --- a/doc/1/controllers/collection/validate-specifications/index.md +++ b/doc/1/controllers/collection/validate-specifications/index.md @@ -19,10 +19,10 @@ When the validation specification is not formatted correctly, a detailed error m ## Arguments ```java - public CompletableFuture> validateSpecifications( + public CompletableFuture> validateSpecifications( final String index, final String collection, - final ConcurrentHashMap specifications) + final Map specifications) ```
@@ -31,17 +31,17 @@ When the validation specification is not formatted correctly, a detailed error m | ---------------- | -------------------------------------------- | -------------------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `specifications` |
ConcurrentHashMap
| Specifications to validate | +| `specifications` |
Map
| Specifications to validate | ### specifications -A `ConcurrentHashMap` representing the specifications. +A `Map` representing the specifications. This object must follow the [Specification Structure](/core/2/guides/advanced/data-validation). ## Returns -Returns a `ConcurrentHashMap` which contains information about the specifications validity. +Returns a `Map` which contains information about the specifications validity. It contains the following properties: @@ -64,8 +64,8 @@ It contains the following properties: fun validateSpecifications( index: String, collection: String, - specifications: ConcurrentHashMap? - ): CompletableFuture> + specifications: Map? + ): CompletableFuture> ```
@@ -74,17 +74,17 @@ fun validateSpecifications( | ---------------- | -------------------------------------------- | -------------------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `specifications` |
ConcurrentHashMap
| Specifications to validate | +| `specifications` |
Map
| Specifications to validate | ### specifications -A `ConcurrentHashMap` representing the specifications. +A `Map` representing the specifications. This object must follow the [Specification Structure](/core/2/guides/advanced/data-validation). ## Returns -Returns a `ConcurrentHashMap` which contains information about the specifications validity. +Returns a `Map` which contains information about the specifications validity. It contains the following properties: diff --git a/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-java.java b/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-java.java index 69e736cc..4cf897ca 100644 --- a/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-java.java +++ b/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-java.java @@ -1,6 +1,6 @@ - ConcurrentHashMap specifications = new ConcurrentHashMap<>(); - ConcurrentHashMap fields = new ConcurrentHashMap<>(); - ConcurrentHashMap license = new ConcurrentHashMap<>(); + Map specifications = new HashMap<>(); + Map fields = new HashMap<>(); + Map license = new HashMap<>(); specifications.put("strict", false); license.put("mandatory", true); @@ -8,7 +8,7 @@ fields.put("license", license); specifications.put("fields", fields); - ConcurrentHashMap result = kuzzle + Map result = kuzzle .getCollectionController() .validateSpecifications("nyc-open-data", "yellow-taxi", specifications) .get(); diff --git a/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt b/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt index 85e01caa..841abd68 100644 --- a/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt +++ b/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt @@ -1,11 +1,11 @@ -val license: ConcurrentHashMap = ConcurrentHashMap().apply { +val license: Map = Map().apply { put("type", "symbol") put("mandatory", true) } -val fields: ConcurrentHashMap = ConcurrentHashMap().apply { +val fields: Map = Map().apply { put("license", license) } -val specifications: ConcurrentHashMap = ConcurrentHashMap().apply { +val specifications: Map = Map().apply { put("strict", false) put("fields", fields) } diff --git a/doc/1/controllers/document/count/index.md b/doc/1/controllers/document/count/index.md index 3df0669b..acc1dd16 100644 --- a/doc/1/controllers/document/count/index.md +++ b/doc/1/controllers/document/count/index.md @@ -35,7 +35,7 @@ throws NotConnectedException, InternalException | ------------------ | -------------------------------------------- | --------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `searchQuery` |
ConcurrentHashMap

(`{}`) | Query to match | +| `searchQuery` |
Map

(`{}`) | Query to match | --- @@ -56,14 +56,14 @@ Returns an Integer. fun count( index: String, collection: String, - searchQuery: ConcurrentHashMap = ConcurrentHashMap()): CompletableFuture + searchQuery: Map = Map()): CompletableFuture ``` | Argument | Type | Description | | ------------------ | -------------------------------------------- | --------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `searchQuery` |
ConcurrentHashMap

(`{}`) | Query to match | +| `searchQuery` |
Map

(`{}`) | Query to match | --- diff --git a/doc/1/controllers/document/count/snippets/count-java.java b/doc/1/controllers/document/count/snippets/count-java.java index dcc09f6b..341ae8b9 100644 --- a/doc/1/controllers/document/count/snippets/count-java.java +++ b/doc/1/controllers/document/count/snippets/count-java.java @@ -1,5 +1,5 @@ -ConcurrentHashMap searchQuery = new ConcurrentHashMap<>(); -ConcurrentHashMap match = new ConcurrentHashMap<>(); +Map searchQuery = new HashMap<>(); +Map match = new HashMap<>(); match.put("Hello", "Clarisse"); searchQuery.put("match", match); diff --git a/doc/1/controllers/document/count/snippets/count-kotlin.kt b/doc/1/controllers/document/count/snippets/count-kotlin.kt index 141f6fff..8ef5e608 100644 --- a/doc/1/controllers/document/count/snippets/count-kotlin.kt +++ b/doc/1/controllers/document/count/snippets/count-kotlin.kt @@ -1,6 +1,6 @@ -val searchQuery : ConcurrentHashMap = - ConcurrentHashMap().apply { - put("match", ConcurrentHashMap().apply { +val searchQuery : Map = + Map().apply { + put("match", Map().apply { put("Hello", "Clarisse") }) } diff --git a/doc/1/controllers/document/create-or-replace/index.md b/doc/1/controllers/document/create-or-replace/index.md index b50a553e..f43ac65b 100644 --- a/doc/1/controllers/document/create-or-replace/index.md +++ b/doc/1/controllers/document/create-or-replace/index.md @@ -17,18 +17,18 @@ Creates a new document in the persistent data storage, or replaces its content i ## Arguments ```java -public CompletableFuture> createOrReplace( +public CompletableFuture> createOrReplace( String index, String collection, String id, - ConcurrentHashMap document) + Map document) throws NotConnectedException, InternalException -public CompletableFuture> createOrReplace( +public CompletableFuture> createOrReplace( String index, String collection, String id, - ConcurrentHashMap document, + Map document, Boolean waitForRefresh) throws NotConnectedException, InternalException ``` @@ -38,18 +38,18 @@ throws NotConnectedException, InternalException | `index` |
String
| Index | | `collection` |
String
| Collection | | `id` |
String
| Document ID | -| `document` |
ConcurrentHashMap
| Document content | +| `document` |
Map
| Document content | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| --- ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | | `_id` |
String
| ID of the document | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -67,8 +67,8 @@ fun createOrReplace( index: String, collection: String, id: String, - document: ConcurrentHashMap, - waitForRefresh: Boolean? = null): CompletableFuture> + document: Map, + waitForRefresh: Boolean? = null): CompletableFuture> ``` | Arguments | Type | Description | @@ -76,18 +76,18 @@ fun createOrReplace( | `index` |
String
| Index | | `collection` |
String
| Collection | | `id` |
String
| Document ID | -| `document` |
ConcurrentHashMap
| Document content | +| `document` |
Map
| Document content | | `waitForRefresh` |
Boolean

(`null`) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| --- ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | | `_id` |
String
| ID of the document | | `_version` |
Int
| Version of the document in the persistent data storage | diff --git a/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-java.java b/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-java.java index f88a3796..7ec05662 100644 --- a/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-java.java +++ b/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-java.java @@ -1,8 +1,8 @@ - ConcurrentHashMap document = new ConcurrentHashMap<>(); + Map document = new HashMap<>(); document.put("firstname", "John"); - ConcurrentHashMap result = kuzzle + Map result = kuzzle .getDocumentController() .createOrReplace("nyc-open-data", "yellow-taxi", "some-id", document) .get(); diff --git a/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt b/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt index 9d12a6d0..99cd8ff6 100644 --- a/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt +++ b/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt @@ -1,8 +1,8 @@ -val document: ConcurrentHashMap = ConcurrentHashMap().apply { +val document: Map = Map().apply { put("firstname", "John") } -val result: ConcurrentHashMap = +val result: Map = kuzzle .documentController .createOrReplace("nyc-open-data", "yellow-taxi", "some-id", document) diff --git a/doc/1/controllers/document/create/index.md b/doc/1/controllers/document/create/index.md index bda6020a..faf196ae 100644 --- a/doc/1/controllers/document/create/index.md +++ b/doc/1/controllers/document/create/index.md @@ -21,23 +21,23 @@ The optional parameter `waitForRefresh` can be used with the value `true` in ord ## Arguments ```java -public CompletableFuture> create( +public CompletableFuture> create( String index, String collection, - ConcurrentHashMap document) + Map document) throws NotConnectedException, InternalException -public CompletableFuture> create( +public CompletableFuture> create( String index, String collection, - ConcurrentHashMap document, + Map document, String id) throws NotConnectedException, InternalException -public CompletableFuture> create( +public CompletableFuture> create( String index, String collection, - ConcurrentHashMap document, + Map document, String id, Boolean waitForRefresh) throws NotConnectedException, InternalException @@ -47,7 +47,7 @@ throws NotConnectedException, InternalException | ------------------ | -------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `document` |
ConcurrentHashMap
| Document content | +| `document` |
Map
| Document content | | `id` |
String
(optional) | Document identifier. Auto-generated if not specified | | `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| @@ -55,11 +55,11 @@ throws NotConnectedException, InternalException ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Created document | +| `_source` |
Map
| Created document | | `_id` |
String
| ID of the newly created document | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -76,16 +76,16 @@ A `ConcurrentHashMap` which has the following properties: fun create( index: String, collection: String, - document: ConcurrentHashMap, + document: Map, id: String? = null, - waitForRefresh: Boolean? = null): CompletableFuture> + waitForRefresh: Boolean? = null): CompletableFuture> ``` | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `document` |
ConcurrentHashMap
| Document content | +| `document` |
Map
| Document content | | `id` |
String
(optional) | Document identifier. Auto-generated if not specified | | `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| @@ -93,11 +93,11 @@ fun create( ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Created document | +| `_source` |
Map
| Created document | | `_id` |
String
| ID of the newly created document | | `_version` |
Int
| Version of the document in the persistent data storage | diff --git a/doc/1/controllers/document/create/snippets/create-java.java b/doc/1/controllers/document/create/snippets/create-java.java index 27b512d8..90d73734 100644 --- a/doc/1/controllers/document/create/snippets/create-java.java +++ b/doc/1/controllers/document/create/snippets/create-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap document = new ConcurrentHashMap<>(); +Map document = new HashMap<>(); document.put("firstname", "John"); -ConcurrentHashMap result = +Map result = kuzzle .getDocumentController() .create("nyc-open-data", "yellow-taxi", document) diff --git a/doc/1/controllers/document/create/snippets/create-kotlin.kt b/doc/1/controllers/document/create/snippets/create-kotlin.kt index 7581cd38..cd7ae51f 100644 --- a/doc/1/controllers/document/create/snippets/create-kotlin.kt +++ b/doc/1/controllers/document/create/snippets/create-kotlin.kt @@ -1,8 +1,8 @@ -val document: ConcurrentHashMap = ConcurrentHashMap().apply { +val document: Map = Map().apply { put("firstname", "John") } -val result: ConcurrentHashMap = +val result: Map = kuzzle .documentController .create("nyc-open-data", "yellow-taxi", document) diff --git a/doc/1/controllers/document/delete-by-query/index.md b/doc/1/controllers/document/delete-by-query/index.md index 4ccfea4f..f6a118af 100644 --- a/doc/1/controllers/document/delete-by-query/index.md +++ b/doc/1/controllers/document/delete-by-query/index.md @@ -22,12 +22,12 @@ An empty or null query will match all documents in the collection. public CompletableFuture> deleteByQuery( String index, String collection, - ConcurrentHashMap searchQuery) throws NotConnectedException, InternalException + Map searchQuery) throws NotConnectedException, InternalException public CompletableFuture> deleteByQuery( String index, String collection, - ConcurrentHashMap searchQuery, + Map searchQuery, Boolean waitForRefresh) throws NotConnectedException, InternalException ``` @@ -35,7 +35,7 @@ An empty or null query will match all documents in the collection. | ------------------ | -------------------------------------------- | --------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `searchQuery` |
ConcurrentHashMap
| Query to match | +| `searchQuery` |
Map
| Query to match | | `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| --- @@ -57,7 +57,7 @@ Returns an `ArrayList` containing the deleted document ids. fun deleteByQuery( index: String, collection: String, - searchQuery: ConcurrentHashMap, + searchQuery: Map, waitForRefresh: Boolean? = null): CompletableFuture> ``` @@ -65,7 +65,7 @@ fun deleteByQuery( | ------------------ | -------------------------------------------- | --------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `searchQuery` |
ConcurrentHashMap
| Query to match | +| `searchQuery` |
Map
| Query to match | | `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| --- diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.java b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.java index 46b10a9a..ec1e3a2b 100644 --- a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.java +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.java @@ -1,6 +1,6 @@ - ConcurrentHashMap searchQuery = new ConcurrentHashMap<>(); - ConcurrentHashMap query = new ConcurrentHashMap<>(); - ConcurrentHashMap match = new ConcurrentHashMap<>(); + Map searchQuery = new HashMap<>(); + Map query = new HashMap<>(); + Map match = new HashMap<>(); match.put("capacity", 4); query.put("match", match); searchQuery.put("query", query); diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt index b5c68df8..795972f5 100644 --- a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt @@ -1,6 +1,6 @@ -val searchQuery: ConcurrentHashMap = ConcurrentHashMap().apply { - put("query", ConcurrentHashMap().apply { - put("match", ConcurrentHashMap().apply { +val searchQuery: Map = Map().apply { + put("query", Map().apply { + put("match", Map().apply { put("capacity", 4) }) }) diff --git a/doc/1/controllers/document/delete/index.md b/doc/1/controllers/document/delete/index.md index 0e0a4f90..033107dd 100644 --- a/doc/1/controllers/document/delete/index.md +++ b/doc/1/controllers/document/delete/index.md @@ -17,13 +17,13 @@ Deletes a document. ## Arguments ```java -public CompletableFuture> delete( +public CompletableFuture> delete( String index, String collection, String id) throws NotConnectedException, InternalException -public CompletableFuture> delete( +public CompletableFuture> delete( String index, String collection, String id, @@ -42,7 +42,7 @@ throws NotConnectedException, InternalException ## Return -A `ConcurrentHashMap` which has the following property: +A `Map` which has the following property: | Property | Type | Description | |------------- |----------------------------- |--------------------------------- | @@ -62,7 +62,7 @@ fun delete( index: String, collection: String, id: String?, - waitForRefresh: Boolean? = null): CompletableFuture> + waitForRefresh: Boolean? = null): CompletableFuture> ``` | Arguments | Type | Description | @@ -76,7 +76,7 @@ fun delete( ## Return -A `ConcurrentHashMap` which has the following property: +A `Map` which has the following property: | Property | Type | Description | |------------- |----------------------------- |--------------------------------- | diff --git a/doc/1/controllers/document/get/index.md b/doc/1/controllers/document/get/index.md index 4dff5227..e443cea1 100644 --- a/doc/1/controllers/document/get/index.md +++ b/doc/1/controllers/document/get/index.md @@ -17,7 +17,7 @@ Gets a document. ## Arguments ```java -public CompletableFuture> get( +public CompletableFuture> get( String index, String collection, String id) @@ -35,11 +35,11 @@ throws NotConnectedException, InternalException ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------------------------------------- | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | | `_id` |
String
| ID of the document | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -56,7 +56,7 @@ A `ConcurrentHashMap` which has the following properties: fun get( index: String, collection: String, - id: String): CompletableFuture> + id: String): CompletableFuture> ``` @@ -70,11 +70,11 @@ fun get( ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------------------------------------- | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | | `_id` |
String
| ID of the document | | `_version` |
Integer
| Version of the document in the persistent data storage | diff --git a/doc/1/controllers/document/get/snippets/get-java.java b/doc/1/controllers/document/get/snippets/get-java.java index 46119495..4273380d 100644 --- a/doc/1/controllers/document/get/snippets/get-java.java +++ b/doc/1/controllers/document/get/snippets/get-java.java @@ -1,4 +1,4 @@ - ConcurrentHashMap result = + Map result = kuzzle.getDocumentController().get("nyc-open-data", "yellow-taxi", "some-id") .get(); diff --git a/doc/1/controllers/document/get/snippets/get-kotlin.kt b/doc/1/controllers/document/get/snippets/get-kotlin.kt index 28e4f203..b4d5f269 100644 --- a/doc/1/controllers/document/get/snippets/get-kotlin.kt +++ b/doc/1/controllers/document/get/snippets/get-kotlin.kt @@ -1,4 +1,4 @@ -val result: ConcurrentHashMap = +val result: Map = kuzzle .documentController .get("nyc-open-data", "yellow-taxi", "some-id") diff --git a/doc/1/controllers/document/m-create-or-replace/index.md b/doc/1/controllers/document/m-create-or-replace/index.md index bb952ced..8bbb6ff2 100644 --- a/doc/1/controllers/document/m-create-or-replace/index.md +++ b/doc/1/controllers/document/m-create-or-replace/index.md @@ -17,16 +17,16 @@ Creates or replaces multiple documents. ## Arguments ```java -public CompletableFuture>> mCreateOrReplace( +public CompletableFuture>> mCreateOrReplace( String index, String collection, - ArrayList> documents) + ArrayList> documents) throws NotConnectedException, InternalException -public CompletableFuture>> mCreateOrReplace( +public CompletableFuture>> mCreateOrReplace( String index, String collection, - ArrayList> documents, + ArrayList> documents, Boolean waitForRefresh) throws NotConnectedException, InternalException ``` @@ -35,7 +35,7 @@ throws NotConnectedException, InternalException | ------------------ | ------------------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `documents` |
ArrayList>
| ArrayList containing the documents to create | +| `documents` |
ArrayList>
| ArrayList containing the documents to create | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | --- @@ -47,16 +47,16 @@ Each document has the following properties: | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `_id` |
String
| Optional document ID. Will be auto-generated if not defined. | -| `body` |
ConcurrentHashMap
| Document body | +| `body` |
Map
| Document body | ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Created document | +| `_source` |
Map
| Created document | | `_id` |
String
| ID of the newly created document | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -64,7 +64,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Integer
| HTTP error status | | `reason` |
String
| Human readable reason | @@ -81,15 +81,15 @@ Each errored document is an object of the `errors` array with the following prop fun mCreateOrReplace( index: String, collection: String, - documents: ArrayList>, - waitForRefresh: Boolean? = null): CompletableFuture>> + documents: ArrayList>, + waitForRefresh: Boolean? = null): CompletableFuture>> ``` | Arguments | Type | Description | | ------------------ | ------------------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `documents` |
ArrayList>
| ArrayList containing the documents to create | +| `documents` |
ArrayList>
| ArrayList containing the documents to create | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | --- @@ -101,16 +101,16 @@ Each document has the following properties: | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `_id` |
String
| Optional document ID. Will be auto-generated if not defined. | -| `body` |
ConcurrentHashMap
| Document body | +| `body` |
Map
| Document body | ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Created document | +| `_source` |
Map
| Created document | | `_id` |
String
| ID of the newly created document | | `_version` |
Int
| Version of the document in the persistent data storage | @@ -118,7 +118,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Int
| HTTP error status | | `reason` |
String
| Human readable reason | diff --git a/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-java.java b/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-java.java index 48af041c..ea38ed20 100644 --- a/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-java.java +++ b/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap document1 = new ConcurrentHashMap<>(); -ConcurrentHashMap document2 = new ConcurrentHashMap<>(); -ConcurrentHashMap body = new ConcurrentHashMap<>(); -ConcurrentHashMap body2 = new ConcurrentHashMap<>(); +Map document1 = new HashMap<>(); +Map document2 = new HashMap<>(); +Map body = new HashMap<>(); +Map body2 = new HashMap<>(); body.put("Agent", "Smith"); body2.put("Gordon", "Freeman"); @@ -12,11 +12,11 @@ document2.put("_id", "some-id2"); document2.put("body", body2); -final ArrayList> documents = new ArrayList<>(); +final ArrayList> documents = new ArrayList<>(); documents.add(document1); documents.add(document2); -ConcurrentHashMap> result = kuzzle +Map> result = kuzzle .getDocumentController() .mCreateOrReplace("nyc-open-data", "yellow-taxi", documents) .get(); diff --git a/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-kotlin.kt b/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-kotlin.kt index fa1f73fa..ad354610 100644 --- a/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-kotlin.kt +++ b/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-kotlin.kt @@ -1,26 +1,26 @@ -val document1: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document1: Map = + Map().apply { put("_id", "some-id") - put("body", ConcurrentHashMap().apply { + put("body", Map().apply { put("Agent", "Smith") }) } -val document2: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document2: Map = + Map().apply { put("_id", "some-id2") - put("body", ConcurrentHashMap().apply { + put("body", Map().apply { put("Gordon", "Freeman") }) } -val documents: ArrayList> = - ArrayList>().apply { +val documents: ArrayList> = + ArrayList>().apply { add(document1) add(document2) } -val result: ConcurrentHashMap> = +val result: Map> = kuzzle .documentController .mCreateOrReplace("nyc-open-data", "yellow-taxi", documents) diff --git a/doc/1/controllers/document/m-create/index.md b/doc/1/controllers/document/m-create/index.md index f082c031..29f3cad6 100644 --- a/doc/1/controllers/document/m-create/index.md +++ b/doc/1/controllers/document/m-create/index.md @@ -17,16 +17,16 @@ Creates multiple documents. ## Arguments ```java -public CompletableFuture>> mCreate( +public CompletableFuture>> mCreate( String index, String collection, - ArrayList> documents) + ArrayList> documents) throws NotConnectedException, InternalException -public CompletableFuture>> mCreate( +public CompletableFuture>> mCreate( String index, String collection, - ArrayList> documents, + ArrayList> documents, Boolean waitForRefresh) throws NotConnectedException, InternalException ``` @@ -35,7 +35,7 @@ throws NotConnectedException, InternalException | ------------------ | ------------------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `documents` |
ArrayList>
| ArrayList containing the documents to create | +| `documents` |
ArrayList>
| ArrayList containing the documents to create | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | --- @@ -47,16 +47,16 @@ Each document has the following properties: | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `_id` |
String
| Optional document ID. Will be auto-generated if not defined. | -| `body` |
ConcurrentHashMap
| Document body | +| `body` |
Map
| Document body | ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Created document | +| `_source` |
Map
| Created document | | `_id` |
String
| ID of the newly created document | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -64,7 +64,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Integer
| HTTP error status | | `reason` |
String
| Human readable reason | @@ -81,15 +81,15 @@ Each errored document is an object of the `errors` array with the following prop fun mCreate( index: String, collection: String, - documents: ArrayList>, - waitForRefresh: Boolean? = null): CompletableFuture>> + documents: ArrayList>, + waitForRefresh: Boolean? = null): CompletableFuture>> ``` | Arguments | Type | Description | | ------------------ | ------------------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `documents` |
ArrayList>
| ArrayList containing the documents to create | +| `documents` |
ArrayList>
| ArrayList containing the documents to create | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | --- @@ -101,16 +101,16 @@ Each document has the following properties: | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `_id` |
String
| Optional document ID. Will be auto-generated if not defined. | -| `body` |
ConcurrentHashMap
| Document body | +| `body` |
Map
| Document body | ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Created document | +| `_source` |
Map
| Created document | | `_id` |
String
| ID of the newly created document | | `_version` |
Int
| Version of the document in the persistent data storage | @@ -118,7 +118,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Integer
| HTTP error status | | `reason` |
String
| Human readable reason | diff --git a/doc/1/controllers/document/m-create/snippets/m-create-java.java b/doc/1/controllers/document/m-create/snippets/m-create-java.java index 24f9696f..529b2284 100644 --- a/doc/1/controllers/document/m-create/snippets/m-create-java.java +++ b/doc/1/controllers/document/m-create/snippets/m-create-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap document1 = new ConcurrentHashMap<>(); -ConcurrentHashMap document2 = new ConcurrentHashMap<>(); -ConcurrentHashMap body = new ConcurrentHashMap<>(); -ConcurrentHashMap body2 = new ConcurrentHashMap<>(); +Map document1 = new HashMap<>(); +Map document2 = new HashMap<>(); +Map body = new HashMap<>(); +Map body2 = new HashMap<>(); body.put("Agent", "Smith"); body2.put("Gordon", "Freeman"); @@ -12,11 +12,11 @@ document2.put("_id", "some-id2"); document2.put("body", body2); -final ArrayList> documents = new ArrayList<>(); +final ArrayList> documents = new ArrayList<>(); documents.add(document1); documents.add(document2); -ConcurrentHashMap> result = kuzzle +Map> result = kuzzle .getDocumentController() .mCreate("nyc-open-data", "yellow-taxi", documents) .get(); diff --git a/doc/1/controllers/document/m-create/snippets/m-create-kotlin.kt b/doc/1/controllers/document/m-create/snippets/m-create-kotlin.kt index fa1f73fa..ad354610 100644 --- a/doc/1/controllers/document/m-create/snippets/m-create-kotlin.kt +++ b/doc/1/controllers/document/m-create/snippets/m-create-kotlin.kt @@ -1,26 +1,26 @@ -val document1: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document1: Map = + Map().apply { put("_id", "some-id") - put("body", ConcurrentHashMap().apply { + put("body", Map().apply { put("Agent", "Smith") }) } -val document2: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document2: Map = + Map().apply { put("_id", "some-id2") - put("body", ConcurrentHashMap().apply { + put("body", Map().apply { put("Gordon", "Freeman") }) } -val documents: ArrayList> = - ArrayList>().apply { +val documents: ArrayList> = + ArrayList>().apply { add(document1) add(document2) } -val result: ConcurrentHashMap> = +val result: Map> = kuzzle .documentController .mCreateOrReplace("nyc-open-data", "yellow-taxi", documents) diff --git a/doc/1/controllers/document/m-delete/index.md b/doc/1/controllers/document/m-delete/index.md index ee98bb34..8d43cbdd 100644 --- a/doc/1/controllers/document/m-delete/index.md +++ b/doc/1/controllers/document/m-delete/index.md @@ -17,13 +17,13 @@ Deletes multiple documents. ## Arguments ```java -public CompletableFuture>> mDelete( +public CompletableFuture>> mDelete( String index, String collection, ArrayList ids) throws NotConnectedException, InternalException -public CompletableFuture>> mDelete( +public CompletableFuture>> mDelete( String index, String collection, ArrayList ids, @@ -42,7 +42,7 @@ throws NotConnectedException, InternalException ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: The `successes` array contains the successfully deleted document IDs. Each deletion error is an object of the errors array with the following properties: @@ -66,7 +66,7 @@ fun mDelete( index: String, collection: String, ids: ArrayList, - waitForRefresh: Boolean? = null): CompletableFuture>> + waitForRefresh: Boolean? = null): CompletableFuture>> ``` | Arguments | Type | Description | @@ -80,7 +80,7 @@ fun mDelete( ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: The `successes` array contains the successfully deleted document IDs. Each deletion error is an object of the errors array with the following properties: diff --git a/doc/1/controllers/document/m-delete/snippets/m-delete-java.java b/doc/1/controllers/document/m-delete/snippets/m-delete-java.java index 5942bdb1..839a2d16 100644 --- a/doc/1/controllers/document/m-delete/snippets/m-delete-java.java +++ b/doc/1/controllers/document/m-delete/snippets/m-delete-java.java @@ -2,7 +2,7 @@ ids.add("some-id"); ids.add("some-id2"); -ConcurrentHashMap> result = +Map> result = kuzzle .getDocumentController() .mDelete("nyc-open-data", "yellow-taxi", ids) diff --git a/doc/1/controllers/document/m-delete/snippets/m-delete-kotlin.kt b/doc/1/controllers/document/m-delete/snippets/m-delete-kotlin.kt index 08502caa..31bbf83d 100644 --- a/doc/1/controllers/document/m-delete/snippets/m-delete-kotlin.kt +++ b/doc/1/controllers/document/m-delete/snippets/m-delete-kotlin.kt @@ -3,7 +3,7 @@ val ids: ArrayList = ArrayList().apply { add("some-id2") } -val result: ConcurrentHashMap> = +val result: Map> = kuzzle .documentController .mDelete("nyc-open-data", "yellow-taxi", ids) diff --git a/doc/1/controllers/document/m-get/index.md b/doc/1/controllers/document/m-get/index.md index 3f77e945..798af7a9 100644 --- a/doc/1/controllers/document/m-get/index.md +++ b/doc/1/controllers/document/m-get/index.md @@ -17,7 +17,7 @@ Gets multiple documents. ## Arguments ```java -public CompletableFuture>> mGet( +public CompletableFuture>> mGet( String index, String collection, ArrayList ids) @@ -34,12 +34,12 @@ throws NotConnectedException, InternalException ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | | `_id` |
String
| Document ID | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -58,7 +58,7 @@ The `errors` array contain the IDs of not found documents. fun mGet( index: String, collection: String, - ids: ArrayList): CompletableFuture>> + ids: ArrayList): CompletableFuture>> ``` | Arguments | Type | Description | @@ -70,12 +70,12 @@ fun mGet( ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | | `_id` |
String
| Document ID | | `_version` |
Int
| Version of the document in the persistent data storage | diff --git a/doc/1/controllers/document/m-get/snippets/m-get-java.java b/doc/1/controllers/document/m-get/snippets/m-get-java.java index 7a4d6694..a2a98312 100644 --- a/doc/1/controllers/document/m-get/snippets/m-get-java.java +++ b/doc/1/controllers/document/m-get/snippets/m-get-java.java @@ -2,7 +2,7 @@ ids.add("some-id"); ids.add("some-id2"); -ConcurrentHashMap> result = +Map> result = kuzzle .getDocumentController() .mGet("nyc-open-data", "yellow-taxi", ids) diff --git a/doc/1/controllers/document/m-get/snippets/m-get-kotlin.kt b/doc/1/controllers/document/m-get/snippets/m-get-kotlin.kt index d98dd7e7..55764e84 100644 --- a/doc/1/controllers/document/m-get/snippets/m-get-kotlin.kt +++ b/doc/1/controllers/document/m-get/snippets/m-get-kotlin.kt @@ -3,7 +3,7 @@ val ids: ArrayList = ArrayList().apply { add("some-id2") } -val result: ConcurrentHashMap> = +val result: Map> = kuzzle .documentController .mGet("nyc-open-data", "yellow-taxi", ids) diff --git a/doc/1/controllers/document/m-replace/index.md b/doc/1/controllers/document/m-replace/index.md index 8165f7a3..22b1cf2e 100644 --- a/doc/1/controllers/document/m-replace/index.md +++ b/doc/1/controllers/document/m-replace/index.md @@ -17,16 +17,16 @@ Replaces multiple documents. ## Arguments ```java -public CompletableFuture>> mReplace( +public CompletableFuture>> mReplace( String index, String collection, - ArrayList> documents) + ArrayList> documents) throws NotConnectedException, InternalException -public CompletableFuture>> mReplace( +public CompletableFuture>> mReplace( String index, String collection, - ArrayList> documents, + ArrayList> documents, Boolean waitForRefresh) throws NotConnectedException, InternalException ``` @@ -35,7 +35,7 @@ throws NotConnectedException, InternalException | ------------------ | ------------------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `documents` |
ArrayList>
| ArrayList containing the documents to replace | +| `documents` |
ArrayList>
| ArrayList containing the documents to replace | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | --- @@ -47,16 +47,16 @@ Each document has the following properties: | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `_id` |
String
| Optional document ID. Will be auto-generated if not defined. | -| `body` |
ConcurrentHashMap
| Document body | +| `body` |
Map
| Document body | ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Created document | +| `_source` |
Map
| Created document | | `_id` |
String
| ID of the replaced document | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -64,7 +64,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Integer
| HTTP error status | | `reason` |
String
| Human readable reason | @@ -81,15 +81,15 @@ Each errored document is an object of the `errors` array with the following prop fun mReplace( index: String, collection: String, - documents: ArrayList>, - waitForRefresh: Boolean? = null): CompletableFuture?>> + documents: ArrayList>, + waitForRefresh: Boolean? = null): CompletableFuture?>> ``` | Arguments | Type | Description | | ------------------ | ------------------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `documents` |
ArrayList>
| ArrayList containing the documents to replace | +| `documents` |
ArrayList>
| ArrayList containing the documents to replace | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | --- @@ -101,16 +101,16 @@ Each document has the following properties: | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `_id` |
String
| Optional document ID. Will be auto-generated if not defined. | -| `body` |
ConcurrentHashMap
| Document body | +| `body` |
Map
| Document body | ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Created document | +| `_source` |
Map
| Created document | | `_id` |
String
| ID of the replaced document | | `_version` |
Int
| Version of the document in the persistent data storage | @@ -118,7 +118,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Int
| HTTP error status | | `reason` |
String
| Human readable reason | diff --git a/doc/1/controllers/document/m-replace/snippets/m-replace-java.java b/doc/1/controllers/document/m-replace/snippets/m-replace-java.java index f9651db0..3d6faf2f 100644 --- a/doc/1/controllers/document/m-replace/snippets/m-replace-java.java +++ b/doc/1/controllers/document/m-replace/snippets/m-replace-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap document1 = new ConcurrentHashMap<>(); -ConcurrentHashMap document2 = new ConcurrentHashMap<>(); -ConcurrentHashMap body = new ConcurrentHashMap<>(); -ConcurrentHashMap body2 = new ConcurrentHashMap<>(); +Map document1 = new HashMap<>(); +Map document2 = new HashMap<>(); +Map body = new HashMap<>(); +Map body2 = new HashMap<>(); body.put("name", "Smith"); body2.put("name", "Freeman"); @@ -12,11 +12,11 @@ document2.put("_id", "some-id2"); document2.put("body", body2); -final ArrayList> documents = new ArrayList<>(); +final ArrayList> documents = new ArrayList<>(); documents.add(document1); documents.add(document2); -ConcurrentHashMap> result = kuzzle +Map> result = kuzzle .getDocumentController() .mReplace("nyc-open-data", "yellow-taxi", documents) .get(); diff --git a/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt b/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt index a2ebdb9b..b9aea0f7 100644 --- a/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt +++ b/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt @@ -1,27 +1,27 @@ -val document1: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document1: Map = + Map().apply { put("_id", "some-id") - put("body", ConcurrentHashMap().apply { + put("body", Map().apply { put("name", "Smith") }) } -val document2: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document2: Map = + Map().apply { put("_id", "some-id2") - put("body", ConcurrentHashMap().apply { + put("body", Map().apply { put("name", "Freeman") }) } -val documents: ArrayList> = - ArrayList>().apply { +val documents: ArrayList> = + ArrayList>().apply { add(document1) add(document2) } -val result: ConcurrentHashMap?> = +val result: Map?> = kuzzle .documentController .mReplace("nyc-open-data", "yellow-taxi", documents) diff --git a/doc/1/controllers/document/m-update/index.md b/doc/1/controllers/document/m-update/index.md index fc2490b6..a9aeb99f 100644 --- a/doc/1/controllers/document/m-update/index.md +++ b/doc/1/controllers/document/m-update/index.md @@ -17,16 +17,16 @@ Updates multiple documents. ## Arguments ```java -public CompletableFuture>> mUpdate( +public CompletableFuture>> mUpdate( String index, String collection, - ArrayList> documents) + ArrayList> documents) throws NotConnectedException, InternalException -public CompletableFuture>> mUpdate( +public CompletableFuture>> mUpdate( String index, String collection, - ArrayList> documents, + ArrayList> documents, UpdateOptions options) throws NotConnectedException, InternalException ``` @@ -35,7 +35,7 @@ throws NotConnectedException, InternalException | ------------------ | ------------------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `documents` |
ArrayList>
| ArrayList containing the documents to update | +| `documents` |
ArrayList>
| ArrayList containing the documents to update | | `retryOnConflict` |
Integer
(optional) | The number of times the database layer should retry in case of version conflict | | `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | @@ -48,17 +48,17 @@ Each document has the following properties: | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `_id` |
String
| Document ID | -| `body` |
ConcurrentHashMap
| Document body | +| `body` |
Map
| Document body | ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Updated document | +| `_source` |
Map
| Updated document | | `_id` |
String
| ID of the updated document | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -66,7 +66,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Integer
| HTTP error status | | `reason` |
String
| Human readable reason | @@ -84,16 +84,16 @@ Each errored document is an object of the `errors` array with the following prop fun mUpdate( index: String, collection: String, - documents: ArrayList?>, + documents: ArrayList?>, waitForRefresh: Boolean? = null, - retryOnConflict: Int? = null): CompletableFuture?>> + retryOnConflict: Int? = null): CompletableFuture?>> ``` | Arguments | Type | Description | | ------------------ | ------------------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `documents` |
ArrayList>
| ArrayList containing the documents to update | +| `documents` |
ArrayList>
| ArrayList containing the documents to update | | `retryOnConflict` |
Int
(optional) | The number of times the database layer should retry in case of version conflict | | `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | @@ -106,17 +106,17 @@ Each document has the following properties: | Arguments | Type | Description | | ------------------ | -------------------------------------------- | --------------------------------- | | `_id` |
String
| Document ID | -| `body` |
ConcurrentHashMap
| Document body | +| `body` |
Map
| Document body | ## Return -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each created document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Updated document | +| `_source` |
Map
| Updated document | | `_id` |
String
| ID of the updated document | | `_version` |
Int
| Version of the document in the persistent data storage | @@ -124,7 +124,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Int
| HTTP error status | | `reason` |
String
| Human readable reason | diff --git a/doc/1/controllers/document/m-update/snippets/m-update-java.java b/doc/1/controllers/document/m-update/snippets/m-update-java.java index 3e271495..9529a2a1 100644 --- a/doc/1/controllers/document/m-update/snippets/m-update-java.java +++ b/doc/1/controllers/document/m-update/snippets/m-update-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap document1 = new ConcurrentHashMap<>(); -ConcurrentHashMap document2 = new ConcurrentHashMap<>(); -ConcurrentHashMap body = new ConcurrentHashMap<>(); -ConcurrentHashMap body2 = new ConcurrentHashMap<>(); +Map document1 = new HashMap<>(); +Map document2 = new HashMap<>(); +Map body = new HashMap<>(); +Map body2 = new HashMap<>(); body.put("name", "Smith"); body2.put("name", "Freeman"); @@ -12,11 +12,11 @@ document2.put("_id", "some-id2"); document2.put("body", body2); -final ArrayList> documents = new ArrayList<>(); +final ArrayList> documents = new ArrayList<>(); documents.add(document1); documents.add(document2); -ConcurrentHashMap> result = kuzzle +Map> result = kuzzle .getDocumentController() .mUpdate("nyc-open-data", "yellow-taxi", documents) .get(); diff --git a/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt b/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt index a2ebdb9b..d1052c23 100644 --- a/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt +++ b/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt @@ -1,27 +1,27 @@ -val document1: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document1: Map = + Map().apply { put("_id", "some-id") - put("body", ConcurrentHashMap().apply { + put("body", Map().apply { put("name", "Smith") }) } -val document2: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document2: Map = + Map().apply { put("_id", "some-id2") - put("body", ConcurrentHashMap().apply { + put("body", Map().apply { put("name", "Freeman") }) } -val documents: ArrayList> = - ArrayList>().apply { +val documents: ArrayList> = + ArrayList>().apply { add(document1) add(document2) } -val result: ConcurrentHashMap?> = +val result: Map?> = kuzzle .documentController .mReplace("nyc-open-data", "yellow-taxi", documents) diff --git a/doc/1/controllers/document/replace/index.md b/doc/1/controllers/document/replace/index.md index e1ba73ef..39163e70 100644 --- a/doc/1/controllers/document/replace/index.md +++ b/doc/1/controllers/document/replace/index.md @@ -17,18 +17,18 @@ Replaces the content of an existing document. ## Arguments ```java -public CompletableFuture> replace( +public CompletableFuture> replace( String index, String collection, String id, - ConcurrentHashMap document) + Map document) throws NotConnectedException, InternalException -public CompletableFuture> replace( +public CompletableFuture> replace( String index, String collection, String id, - ConcurrentHashMap document, + Map document, Boolean waitForRefresh) throws NotConnectedException, InternalException ``` @@ -38,18 +38,18 @@ throws NotConnectedException, InternalException | `index` |
String
| Index | | `collection` |
String
| Collection | | `id` |
String
| Document ID | -| `document` |
ConcurrentHashMap
| New content of the document to update | +| `document` |
Map
| New content of the document to update | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| --- ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | | `_id` |
String
| ID of the document | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -67,8 +67,8 @@ fun replace( index: String, collection: String, id: String?, - document: ConcurrentHashMap, - waitForRefresh: Boolean? = null): CompletableFuture> + document: Map, + waitForRefresh: Boolean? = null): CompletableFuture> ``` | Arguments | Type | Description | @@ -76,18 +76,18 @@ fun replace( | `index` |
String
| Index | | `collection` |
String
| Collection | | `id` |
String
| Document ID | -| `document` |
ConcurrentHashMap
| New content of the document to update | +| `document` |
Map
| New content of the document to update | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| --- ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | | `_id` |
String
| ID of the document | | `_version` |
Int
| Version of the document in the persistent data storage | diff --git a/doc/1/controllers/document/replace/snippets/replace-java.java b/doc/1/controllers/document/replace/snippets/replace-java.java index 68c90c11..d193de10 100644 --- a/doc/1/controllers/document/replace/snippets/replace-java.java +++ b/doc/1/controllers/document/replace/snippets/replace-java.java @@ -1,8 +1,8 @@ - ConcurrentHashMap document = new ConcurrentHashMap<>(); + Map document = new HashMap<>(); document.put("firstname", "John"); - ConcurrentHashMap result = kuzzle.getDocumentController().replace("nyc-open-data", "yellow-taxi", "some-id", document) + Map result = kuzzle.getDocumentController().replace("nyc-open-data", "yellow-taxi", "some-id", document) .get(); /* diff --git a/doc/1/controllers/document/replace/snippets/replace-kotlin.kt b/doc/1/controllers/document/replace/snippets/replace-kotlin.kt index 6f09f572..d640a411 100644 --- a/doc/1/controllers/document/replace/snippets/replace-kotlin.kt +++ b/doc/1/controllers/document/replace/snippets/replace-kotlin.kt @@ -1,9 +1,9 @@ -val document: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document: Map = + Map().apply { put("firstname", "John") } -val result: ConcurrentHashMap = +val result: Map = kuzzle .documentController .replace("nyc-open-data", "yellow-taxi", "some-id", document) diff --git a/doc/1/controllers/document/search/index.md b/doc/1/controllers/document/search/index.md index f0c7acb4..30ed0a8a 100644 --- a/doc/1/controllers/document/search/index.md +++ b/doc/1/controllers/document/search/index.md @@ -39,25 +39,25 @@ You can restrict the scroll session maximum duration under the `services.storage public CompletableFuture search( String index, String collection, - ConcurrentHashMap searchQuery) throws NotConnectedException, InternalException + Map searchQuery) throws NotConnectedException, InternalException public CompletableFuture search( String index, String collection, - ConcurrentHashMap searchQuery, + Map searchQuery, String scroll) throws NotConnectedException, InternalException public CompletableFuture search( String index, String collection, - ConcurrentHashMap searchQuery, + Map searchQuery, String scroll, Integer size) throws NotConnectedException, InternalException public CompletableFuture search( String index, String collection, - ConcurrentHashMap searchQuery + Map searchQuery Integer size, Integer from) throws NotConnectedException, InternalException @@ -67,7 +67,7 @@ throws NotConnectedException, InternalException | ------------------ | -------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `searchQuery` |
ConcurrentHashMap
| Search query | +| `searchQuery` |
Map
| Search query | | `from` |
Integer

(`0`) | Offset of the first document to fetch | | `size` |
Integer

(`10`) | Maximum number of documents to retrieve per page | | `scroll` |
String

(`""`) | When set, gets a forward-only cursor having its ttl set to the given value (ie `1s`; cf [elasticsearch time limits](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/common-options.html#time-units)) | @@ -99,7 +99,7 @@ Returns a [SearchResult](/sdk/jvm/1/core-classes/search-result) object. fun search( index: String, collection: String, - searchQuery: ConcurrentHashMap, + searchQuery: Map, scroll: String? = null, size: Int? = null, from: Int = 0): CompletableFuture @@ -109,7 +109,7 @@ Returns a [SearchResult](/sdk/jvm/1/core-classes/search-result) object. | ------------------ | -------------------------------------------- | --------------------------------- | | `index` |
String
| Index | | `collection` |
String
| Collection | -| `searchQuery` |
ConcurrentHashMap
| Search query | +| `searchQuery` |
Map
| Search query | | `from` |
Int

(`0`) | Offset of the first document to fetch | | `size` |
Int

(`10`) | Maximum number of documents to retrieve per page | | `scroll` |
String

(`""`) | When set, gets a forward-only cursor having its ttl set to the given value (ie `1s`; cf [elasticsearch time limits](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/common-options.html#time-units)) | diff --git a/doc/1/controllers/document/search/snippets/search-java.java b/doc/1/controllers/document/search/snippets/search-java.java index d438e48c..75470a1d 100644 --- a/doc/1/controllers/document/search/snippets/search-java.java +++ b/doc/1/controllers/document/search/snippets/search-java.java @@ -1,6 +1,6 @@ - ConcurrentHashMap searchQuery = new ConcurrentHashMap<>(); - ConcurrentHashMap query = new ConcurrentHashMap<>(); - ConcurrentHashMap match = new ConcurrentHashMap<>(); + Map searchQuery = new HashMap<>(); + Map query = new HashMap<>(); + Map match = new HashMap<>(); match.put("category", "suv"); query.put("match", match); searchQuery.put("query", query); diff --git a/doc/1/controllers/document/search/snippets/search-kotlin.kt b/doc/1/controllers/document/search/snippets/search-kotlin.kt index 55b05a9b..5b36464c 100644 --- a/doc/1/controllers/document/search/snippets/search-kotlin.kt +++ b/doc/1/controllers/document/search/snippets/search-kotlin.kt @@ -1,14 +1,14 @@ -val match: ConcurrentHashMap = - ConcurrentHashMap().apply { +val match: Map = + Map().apply { put("category", "suv") } -val query: ConcurrentHashMap = - ConcurrentHashMap().apply { +val query: Map = + Map().apply { put("match", match) } -val searchQuery: ConcurrentHashMap = - ConcurrentHashMap().apply { +val searchQuery: Map = + Map().apply { put("query", query) } val results = kuzzle diff --git a/doc/1/controllers/document/update-by-query/index.md b/doc/1/controllers/document/update-by-query/index.md index 21aeddfc..47fa5805 100644 --- a/doc/1/controllers/document/update-by-query/index.md +++ b/doc/1/controllers/document/update-by-query/index.md @@ -20,17 +20,17 @@ An empty or null query will match all documents in the collection. ```java - public CompletableFuture>> updateByQuery( + public CompletableFuture>> updateByQuery( String index, String collection, - ConcurrentHashMap searchQuery, - ConcurrentHashMap changes) throws NotConnectedException, InternalException + Map searchQuery, + Map changes) throws NotConnectedException, InternalException - public CompletableFuture>> updateByQuery( + public CompletableFuture>> updateByQuery( String index, String collection, - ConcurrentHashMap searchQuery, - ConcurrentHashMap changes, + Map searchQuery, + Map changes, UpdateOptions options) throws NotConnectedException, InternalException ``` @@ -38,8 +38,8 @@ An empty or null query will match all documents in the collection. | ------------------ | -------------------------------------------- | --------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `searchQuery` |
ConcurrentHashMap
| Query to match | -| `changes` |
ConcurrentHashMap
| Partial changes to apply to the documents | +| `searchQuery` |
Map
| Query to match | +| `changes` |
Map
| Partial changes to apply to the documents | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| | `source` |
Boolean
| If true, returns the updated document inside the response | @@ -47,12 +47,12 @@ An empty or null query will match all documents in the collection. ## Returns -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each updated document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Updated document (if `source` option set to true) | +| `_source` |
Map
| Updated document (if `source` option set to true) | | `_id` |
String
| ID of the udated document | | `_version` |
Integer
| Version of the document in the persistent data storage | | `status` |
Integer
| HTTP status code | @@ -61,7 +61,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Integer
| HTTP error status | | `reason` |
String
| Human readable reason | @@ -76,19 +76,19 @@ Each errored document is an object of the `errors` array with the following prop fun updateByQuery( index: String, collection: String, - searchQuery: ConcurrentHashMap, - changes: ConcurrentHashMap, + searchQuery: Map, + changes: Map, waitForRefresh: Boolean? = null, retryOnConflict: Int? = null, - source: Boolean? = null): CompletableFuture>> + source: Boolean? = null): CompletableFuture>> ``` | Argument | Type | Description | | ------------------ | -------------------------------------------- | --------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `searchQuery` |
ConcurrentHashMap
| Query to match | -| `changes` |
ConcurrentHashMap
| Partial changes to apply to the documents | +| `searchQuery` |
Map
| Query to match | +| `changes` |
Map
| Partial changes to apply to the documents | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| | `source` |
Boolean
| If true, returns the updated document inside the response | @@ -96,12 +96,12 @@ fun updateByQuery( ## Returns -A `ConcurrentHashMap>` which has a `successes` and `errors` `ArrayList`: +A `Map>` which has a `successes` and `errors` `ArrayList`: Each updated document is an object of the `successes` array with the following properties: | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `_source` |
ConcurrentHashMap
| Updated document (if `source` option set to true) | +| `_source` |
Map
| Updated document (if `source` option set to true) | | `_id` |
String
| ID of the udated document | | `_version` |
Int
| Version of the document in the persistent data storage | | `status` |
Int
| HTTP status code | @@ -110,7 +110,7 @@ Each errored document is an object of the `errors` array with the following prop | Property | Type | Description | |------------- |--------------------------------------------- |--------------------------------- | -| `document` |
ConcurrentHashMap
| Document that causes the error | +| `document` |
Map
| Document that causes the error | | `status` |
Int
| HTTP error status | | `reason` |
String
| Human readable reason | diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-java.java b/doc/1/controllers/document/update-by-query/snippets/update-by-query-java.java index e8939278..5c5c1e06 100644 --- a/doc/1/controllers/document/update-by-query/snippets/update-by-query-java.java +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-java.java @@ -1,12 +1,12 @@ - ConcurrentHashMap searchQuery = new ConcurrentHashMap<>(); - ConcurrentHashMap match = new ConcurrentHashMap<>(); + Map searchQuery = new HashMap<>(); + Map match = new HashMap<>(); match.put("capacity", 4); searchQuery.put("match", match); - ConcurrentHashMap changes = new ConcurrentHashMap<>(); + Map changes = new HashMap<>(); changes.put("capacity", 42); - ConcurrentHashMap> result = kuzzle + Map> result = kuzzle .getDocumentController() .updateByQuery("nyc-open-data", "yellow-taxi", searchQuery, changes) .get(); diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt b/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt index 8b8884f8..194173e2 100644 --- a/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt @@ -1,20 +1,20 @@ -val match: ConcurrentHashMap = - ConcurrentHashMap().apply { +val match: Map = + Map().apply { put("capacity", 4) } -val searchQuery: ConcurrentHashMap = - ConcurrentHashMap().apply { +val searchQuery: Map = + Map().apply { put("match", match) } -val changes: ConcurrentHashMap = - ConcurrentHashMap().apply { +val changes: Map = + Map().apply { put("capacity", 42) } -val result: ConcurrentHashMap> = +val result: Map> = kuzzle .documentController .updateByQuery("nyc-open-data", "yellow-taxi", searchQuery, changes) diff --git a/doc/1/controllers/document/update/index.md b/doc/1/controllers/document/update/index.md index d0cfa994..acc75781 100644 --- a/doc/1/controllers/document/update/index.md +++ b/doc/1/controllers/document/update/index.md @@ -17,38 +17,38 @@ Updates a document. ## Arguments ```java -public CompletableFuture> update( +public CompletableFuture> update( String index, String collection, String id, - ConcurrentHashMap document, + Map document, Boolean waitForRefresh, Integer retryOnConflict, Boolean source) throws NotConnectedException, InternalException -public CompletableFuture> update( +public CompletableFuture> update( String index, String collection, String id, - ConcurrentHashMap document, + Map document, Boolean waitForRefresh, Integer retryOnConflict) throws NotConnectedException, InternalException -public CompletableFuture> update( +public CompletableFuture> update( String index, String collection, String id, - ConcurrentHashMap document, + Map document, Boolean waitForRefresh) throws NotConnectedException, InternalException -public CompletableFuture> update( +public CompletableFuture> update( String index, String collection, String id, - ConcurrentHashMap document) + Map document) throws NotConnectedException, InternalException ``` @@ -57,7 +57,7 @@ throws NotConnectedException, InternalException | `index` |
String
| Index | | `collection` |
String
| Collection | | `id ` |
String
| Document ID | -| `document` |
ConcurrentHashMap
| Partial document content | +| `document` |
Map
| Partial document content | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| | `retryOnConflict` |
Integer
| The number of times the database layer should retry in case of version conflict | | `source` |
Boolean
| If true, returns the updated document inside the response | @@ -66,11 +66,11 @@ throws NotConnectedException, InternalException ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------------------------------------- | -| `_source` |
ConcurrentHashMap
| Updated document (If source option set to true) | +| `_source` |
Map
| Updated document (If source option set to true) | | `_id` |
String
| ID of the updated document | | `_version` |
Integer
| Version of the document in the persistent data storage | @@ -88,10 +88,10 @@ A `ConcurrentHashMap` which has the following properties: index: String, collection: String, id: String?, - document: ConcurrentHashMap?, + document: Map?, waitForRefresh: Boolean? = null, retryOnConflict: Int? = null, - source: Boolean? = null): CompletableFuture> + source: Boolean? = null): CompletableFuture> ``` | Arguments | Type | Description | @@ -99,7 +99,7 @@ A `ConcurrentHashMap` which has the following properties: | `index` |
String
| Index | | `collection` |
String
| Collection | | `id ` |
String
| Document ID | -| `document` |
ConcurrentHashMap
| Partial document content | +| `document` |
Map
| Partial document content | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| | `retryOnConflict` |
Int
| The number of times the database layer should retry in case of version conflict | | `source` |
Boolean
| If true, returns the updated document inside the response | @@ -108,11 +108,11 @@ A `ConcurrentHashMap` which has the following properties: ## Return -A `ConcurrentHashMap` which has the following properties: +A `Map` which has the following properties: | Property | Type | Description | |------------- |----------------------------- |--------------------------------------------------------------- | -| `_source` |
ConcurrentHashMap
| Updated document (If source option set to true) | +| `_source` |
Map
| Updated document (If source option set to true) | | `_id` |
String
| ID of the updated document | | `_version` |
Int
| Version of the document in the persistent data storage | diff --git a/doc/1/controllers/document/update/snippets/update-java.java b/doc/1/controllers/document/update/snippets/update-java.java index ead423c8..4570e138 100644 --- a/doc/1/controllers/document/update/snippets/update-java.java +++ b/doc/1/controllers/document/update/snippets/update-java.java @@ -1,7 +1,7 @@ - ConcurrentHashMap content = new ConcurrentHashMap<>(); + Map content = new HashMap<>(); content.put("name", "Johny"); - ConcurrentHashMap result = + Map result = kuzzle.getDocumentController().update("nyc-open-data", "yellow-taxi", "some-id", content) .get(); diff --git a/doc/1/controllers/document/update/snippets/update-kotlin.kt b/doc/1/controllers/document/update/snippets/update-kotlin.kt index a959c53c..8f1466b1 100644 --- a/doc/1/controllers/document/update/snippets/update-kotlin.kt +++ b/doc/1/controllers/document/update/snippets/update-kotlin.kt @@ -1,9 +1,9 @@ -val document: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document: Map = + Map().apply { put("name", "Johny") } -val result: ConcurrentHashMap = +val result: Map = kuzzle .documentController .update("nyc-open-data", "yellow-taxi", "some-id", document) diff --git a/doc/1/controllers/document/validate/index.md b/doc/1/controllers/document/validate/index.md index 979a8b0e..cb5436d5 100644 --- a/doc/1/controllers/document/validate/index.md +++ b/doc/1/controllers/document/validate/index.md @@ -22,7 +22,7 @@ This request does **not** store or publish the document. public CompletableFuture validate( String index, String collection, - ConcurrentHashMap document) + Map document) throws NotConnectedException, InternalException ``` @@ -30,7 +30,7 @@ throws NotConnectedException, InternalException | ------------ | -------------------------------------------- | -------------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `document` |
ConcurrentHashMap
| Document to validate | +| `document` |
Map
| Document to validate | ## Returns @@ -47,14 +47,14 @@ Returns a boolean value set to true if the document is valid and false otherwise fun validate( index: String, collection: String, - document: ConcurrentHashMap): CompletableFuture + document: Map): CompletableFuture ``` | Argument | Type | Description | | ------------ | -------------------------------------------- | -------------------- | | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `document` |
ConcurrentHashMap
| Document to validate | +| `document` |
Map
| Document to validate | ## Returns diff --git a/doc/1/controllers/document/validate/snippets/validate-java.java b/doc/1/controllers/document/validate/snippets/validate-java.java index aaad866e..629c5d2a 100644 --- a/doc/1/controllers/document/validate/snippets/validate-java.java +++ b/doc/1/controllers/document/validate/snippets/validate-java.java @@ -1,4 +1,4 @@ - ConcurrentHashMap document = new ConcurrentHashMap<>(); + Map document = new HashMap<>(); document.put("key", "value"); Boolean result = kuzzle diff --git a/doc/1/controllers/document/validate/snippets/validate-kotlin.kt b/doc/1/controllers/document/validate/snippets/validate-kotlin.kt index 4ef6c398..8247dc0c 100644 --- a/doc/1/controllers/document/validate/snippets/validate-kotlin.kt +++ b/doc/1/controllers/document/validate/snippets/validate-kotlin.kt @@ -1,5 +1,5 @@ -val document: ConcurrentHashMap = - ConcurrentHashMap().apply { +val document: Map = + Map().apply { put("key", "value") } diff --git a/doc/1/controllers/realtime/count/snippets/count-java.java b/doc/1/controllers/realtime/count/snippets/count-java.java index 39072b5a..81d76cdb 100644 --- a/doc/1/controllers/realtime/count/snippets/count-java.java +++ b/doc/1/controllers/realtime/count/snippets/count-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap filters = new ConcurrentHashMap<>(); +Map filters = new HashMap<>(); filters.put("exists", "name"); final String roomId = kuzzle.getRealtimeController().subscribe( diff --git a/doc/1/controllers/realtime/count/snippets/count-kotlin.kt b/doc/1/controllers/realtime/count/snippets/count-kotlin.kt index 69452580..b173a6dd 100644 --- a/doc/1/controllers/realtime/count/snippets/count-kotlin.kt +++ b/doc/1/controllers/realtime/count/snippets/count-kotlin.kt @@ -1,4 +1,4 @@ -val filters: ConcurrentHashMap = ConcurrentHashMap().apply { +val filters: Map = Map().apply { put("exists", "name") } diff --git a/doc/1/controllers/realtime/publish/index.md b/doc/1/controllers/realtime/publish/index.md index a1f2035c..7979606a 100644 --- a/doc/1/controllers/realtime/publish/index.md +++ b/doc/1/controllers/realtime/publish/index.md @@ -22,7 +22,7 @@ The index and collection are indicative and serve only to distinguish the rooms. public CompletableFuture publish( String index, String collection, - ConcurrentHashMap message) + Map message) throws NotConnectedException, InternalException ``` @@ -30,7 +30,7 @@ public CompletableFuture publish( |--------------|--------------------|-------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `message` |
ConcurrentHashMap
| ConcurrentHashMap representing a JSON payload | +| `message` |
Map
| Map representing a JSON payload | ## Usage @@ -42,14 +42,14 @@ public CompletableFuture publish( ## Arguments ```kotlin -fun publish(index: String, collection: String, message: ConcurrentHashMap): CompletableFuture +fun publish(index: String, collection: String, message: Map): CompletableFuture ``` | Argument | Type | Description | |--------------|--------------------|-------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `message` |
ConcurrentHashMap
| ConcurrentHashMap representing a JSON payload | +| `message` |
Map
| Map representing a JSON payload | ## Usage diff --git a/doc/1/controllers/realtime/publish/snippets/publish-java.java b/doc/1/controllers/realtime/publish/snippets/publish-java.java index db209db1..d3a55293 100644 --- a/doc/1/controllers/realtime/publish/snippets/publish-java.java +++ b/doc/1/controllers/realtime/publish/snippets/publish-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap document = new ConcurrentHashMap<>(); +Map document = new HashMap<>(); document.put("name", "nina-vkote"); kuzzle.getRealtimeController().publish("my-index", "my-collection", document); \ No newline at end of file diff --git a/doc/1/controllers/realtime/publish/snippets/publish-kotlin.kt b/doc/1/controllers/realtime/publish/snippets/publish-kotlin.kt index 4413f294..5ca5f0a0 100644 --- a/doc/1/controllers/realtime/publish/snippets/publish-kotlin.kt +++ b/doc/1/controllers/realtime/publish/snippets/publish-kotlin.kt @@ -1,4 +1,4 @@ -val document: ConcurrentHashMap = ConcurrentHashMap().apply { +val document: Map = Map().apply { put("name", "nina-vkote") } diff --git a/doc/1/controllers/realtime/subscribe/index.md b/doc/1/controllers/realtime/subscribe/index.md index 48e4ff93..1ac8deb4 100644 --- a/doc/1/controllers/realtime/subscribe/index.md +++ b/doc/1/controllers/realtime/subscribe/index.md @@ -18,18 +18,18 @@ Subscribes by providing a set of filters: messages, document changes and, option public CompletableFuture subscribe( String index, String collection, - ConcurrentHashMap filters, + Map filters, String scope, String users, boolean subscribeToSelf, - ConcurrentHashMap volatiles, + Map volatiles, NotificationHandler handler, ) throws NotConnectedException, InternalException public CompletableFuture subscribe( String index, String collection, - ConcurrentHashMap filters, + Map filters, String scope, String users, boolean subscribeToSelf, @@ -39,7 +39,7 @@ public CompletableFuture subscribe( public CompletableFuture subscribe( String index, String collection, - ConcurrentHashMap filters, + Map filters, String scope, String users, NotificationHandler handler, @@ -48,7 +48,7 @@ public CompletableFuture subscribe( public CompletableFuture subscribe( String index, String collection, - ConcurrentHashMap filters, + Map filters, String scope, NotificationHandler handler, ) throws NotConnectedException, InternalException @@ -56,7 +56,7 @@ public CompletableFuture subscribe( public CompletableFuture subscribe( String index, String collection, - ConcurrentHashMap filters, + Map filters, NotificationHandler handler, ) throws NotConnectedException, InternalException ``` @@ -65,12 +65,12 @@ public CompletableFuture subscribe( |--------------|-----------------------------------------|----------------------------------------------------------------------------------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `filters` |
ConcurrentHashMap
| ConcurrentHashMap representing a set of filters following [Koncorde syntax](/core/2/api/koncorde-filters-syntax) | +| `filters` |
Map
| Map representing a set of filters following [Koncorde syntax](/core/2/api/koncorde-filters-syntax) | | `handler` |
NotificationHandler
| Handler function to handle notifications | | `scope` |
String

(`all`) | Subscribes to document entering or leaving the scope
Possible values: all, in, out, none | | `users` |
String

(`none`) | Subscribes to users entering or leaving the room
Possible values: all, in, out, none | | `subscribeToSelf` |
boolean

(`true`) | Subscribes to notifications fired by our own queries | -| `volatile` |
ConcurrentHashMap

(`{}`) | ConcurrentHashMap representing subscription information, used in user join/leave notifications | +| `volatile` |
Map

(`{}`) | Map representing subscription information, used in user join/leave notifications | ### handler @@ -100,11 +100,11 @@ Subscription to document notifications with scope option_ fun subscribe( index: String?, collection: String?, - filters: ConcurrentHashMap, + filters: Map, scope: String = "all", users: String = "all", subscribeToSelf: Boolean = true, - volatiles: ConcurrentHashMap = ConcurrentHashMap(), + volatiles: Map = Map(), handler: (Response) -> Unit): CompletableFuture ``` @@ -112,12 +112,12 @@ fun subscribe( |--------------|-----------------------------------------|----------------------------------------------------------------------------------------------------------------| | `index` |
String
| Index name | | `collection` |
String
| Collection name | -| `filters` |
ConcurrentHashMap
| ConcurrentHashMap representing a set of filters following [Koncorde syntax](/core/2/api/koncorde-filters-syntax) | +| `filters` |
Map
| Map representing a set of filters following [Koncorde syntax](/core/2/api/koncorde-filters-syntax) | | `handler` |
NotificationHandler
| Handler function to handle notifications | | `scope` |
String

(`all`) | Subscribes to document entering or leaving the scope
Possible values: all, in, out, none | | `users` |
String

(`none`) | Subscribes to users entering or leaving the room
Possible values: all, in, out, none | | `subscribeToSelf` |
boolean

(`true`) | Subscribes to notifications fired by our own queries | -| `volatile` |
ConcurrentHashMap

(`{}`) | ConcurrentHashMap representing subscription information, used in user join/leave notifications | +| `volatile` |
Map

(`{}`) | Map representing subscription information, used in user join/leave notifications | ### handler diff --git a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-java.java b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-java.java index a3c7400a..9bf7aa9e 100644 --- a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-java.java +++ b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap filters = new ConcurrentHashMap<>(); +Map filters = new HashMap<>(); filters.put("exists", "name"); -ConcurrentHashMap document = new ConcurrentHashMap<>(); +Map document = new HashMap<>(); document.put("name", "nina-vkote"); final String roomId = kuzzle.getRealtimeController().subscribe( @@ -16,7 +16,7 @@ } }).get(); -ConcurrentHashMap query = new ConcurrentHashMap<>(); +Map query = new HashMap<>(); query.put("controller", "document"); query.put("action", "create"); query.put("index", "nyc-open-data"); diff --git a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-kotlin.kt b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-kotlin.kt index 69fe4427..a7ddf1b6 100644 --- a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-kotlin.kt +++ b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-kotlin.kt @@ -1,4 +1,4 @@ -val filters: ConcurrentHashMap = ConcurrentHashMap().apply { +val filters: Map = Map().apply { put("exists", "name") } @@ -13,10 +13,10 @@ val roomId: String = kuzzle.realtimeController.subscribe( } }.get() -val document: ConcurrentHashMap = ConcurrentHashMap().apply { +val document: Map = Map().apply { put("name", "nina-vkote") } -val query: ConcurrentHashMap = ConcurrentHashMap().apply { +val query: Map = Map().apply { put("controller", "document"); put("action", "create"); put("index", "nyc-open-data"); diff --git a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-java.java b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-java.java index f41dc4c5..78a77d21 100644 --- a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-java.java +++ b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-java.java @@ -1,6 +1,6 @@ -ConcurrentHashMap filters = new ConcurrentHashMap<>(); -ConcurrentHashMap range = new ConcurrentHashMap<>(); -ConcurrentHashMap age = new ConcurrentHashMap<>(); +Map filters = new HashMap<>(); +Map range = new HashMap<>(); +Map age = new HashMap<>(); age.put("lte", 20); range.put("age", age); @@ -20,9 +20,9 @@ } }).get(); -ConcurrentHashMap document = new ConcurrentHashMap<>(); +Map document = new HashMap<>(); document.put("age", 19); -ConcurrentHashMap query = new ConcurrentHashMap<>(); +Map query = new HashMap<>(); query.put("controller", "document"); query.put("action", "create"); query.put("index", "nyc-open-data"); diff --git a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt index b4ef93a3..832b8d44 100644 --- a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt +++ b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt @@ -1,6 +1,6 @@ -val filters: ConcurrentHashMap = ConcurrentHashMap().apply { - put("range", ConcurrentHashMap().apply { - put("age", ConcurrentHashMap().apply { +val filters: Map = Map().apply { + put("range", Map().apply { + put("age", Map().apply { put("lte", 20) }) }) @@ -17,10 +17,10 @@ val roomId: String = kuzzle.realtimeController.subscribe( } }.get() -val document: ConcurrentHashMap = ConcurrentHashMap().apply { +val document: Map = Map().apply { put("age", 19) } -val query: ConcurrentHashMap = ConcurrentHashMap().apply { +val query: Map = Map().apply { put("controller", "document"); put("action", "create"); put("index", "nyc-open-data"); diff --git a/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-java.java b/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-java.java index bccc0814..91ee7de0 100644 --- a/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-java.java +++ b/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-java.java @@ -1,7 +1,7 @@ -ConcurrentHashMap filters = new ConcurrentHashMap<>(); +Map filters = new HashMap<>(); filters.put("exists", "name"); -ConcurrentHashMap document = new ConcurrentHashMap<>(); +Map document = new HashMap<>(); document.put("name", "nina-vkote"); final String roomId = kuzzle.getRealtimeController().subscribe( diff --git a/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-kotlin.kt b/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-kotlin.kt index e0668665..13db81b0 100644 --- a/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-kotlin.kt +++ b/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-kotlin.kt @@ -1,4 +1,4 @@ -val filters: ConcurrentHashMap = ConcurrentHashMap().apply { +val filters: Map = Map().apply { put("exists", "name") } @@ -13,7 +13,7 @@ val roomId: String = kuzzle.realtimeController.subscribe( } }.get() -val document: ConcurrentHashMap = ConcurrentHashMap().apply { +val document: Map = Map().apply { put("name", "nina-vkote") } diff --git a/doc/1/controllers/server/get-all-stats/index.md b/doc/1/controllers/server/get-all-stats/index.md index c599a5c6..549a446c 100644 --- a/doc/1/controllers/server/get-all-stats/index.md +++ b/doc/1/controllers/server/get-all-stats/index.md @@ -21,12 +21,12 @@ These statistics include: ::: tab Java ```java -CompletableFuture> getAllStats() +CompletableFuture> getAllStats() ``` ## Return -Returns a `ConcurrentHashMap` containing all stored internal statistic snapshots. +Returns a `Map` containing all stored internal statistic snapshots. ## Usage @@ -35,12 +35,12 @@ Returns a `ConcurrentHashMap` containing all stored internal sta ::: tab Kotlin ```kotlin -fun getAllStats(): CompletableFuture> +fun getAllStats(): CompletableFuture> ``` ## Return -Returns a `ConcurrentHashMap` containing all stored internal statistic snapshots. +Returns a `Map` containing all stored internal statistic snapshots. ## Usage diff --git a/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-java.java b/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-java.java index 6c506703..2367fbe4 100644 --- a/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-java.java +++ b/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap result = kuzzle +Map result = kuzzle .getServerController() .getAllStats() .get(); \ No newline at end of file diff --git a/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.kt b/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.kt index 89096976..f08b0195 100644 --- a/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.kt +++ b/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.kt @@ -1,4 +1,4 @@ -val result: ConcurrentHashMap = kuzzle +val result: Map = kuzzle .serverController .getAllStats() .get() \ No newline at end of file diff --git a/doc/1/controllers/server/get-config/index.md b/doc/1/controllers/server/get-config/index.md index dd7f57dd..ad306937 100644 --- a/doc/1/controllers/server/get-config/index.md +++ b/doc/1/controllers/server/get-config/index.md @@ -17,12 +17,12 @@ This route should only be accessible to administrators, as it might return sensi ::: tab Java ```java -CompletableFuture> getConfig() +CompletableFuture> getConfig() ``` ## Return -Returns a `ConcurrentHashMap` containing server configuration. +Returns a `Map` containing server configuration. ## Usage @@ -31,12 +31,12 @@ Returns a `ConcurrentHashMap` containing server configuration. ::: tab Kotlin ```kotlin -fun getConfig(): CompletableFuture> +fun getConfig(): CompletableFuture> ``` ## Return -Returns a `ConcurrentHashMap` containing server configuration. +Returns a `Map` containing server configuration. ## Usage diff --git a/doc/1/controllers/server/get-config/snippets/get-config-java.java b/doc/1/controllers/server/get-config/snippets/get-config-java.java index 35ec4f1e..d0b90208 100644 --- a/doc/1/controllers/server/get-config/snippets/get-config-java.java +++ b/doc/1/controllers/server/get-config/snippets/get-config-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap result = kuzzle +Map result = kuzzle .getServerController() .getConfig() .get(); \ No newline at end of file diff --git a/doc/1/controllers/server/get-config/snippets/get-config-kotlin.kt b/doc/1/controllers/server/get-config/snippets/get-config-kotlin.kt index 5000aa6f..955c6434 100644 --- a/doc/1/controllers/server/get-config/snippets/get-config-kotlin.kt +++ b/doc/1/controllers/server/get-config/snippets/get-config-kotlin.kt @@ -1,4 +1,4 @@ -val result: ConcurrentHashMap = kuzzle +val result: Map = kuzzle .serverController .getConfig() .get() \ No newline at end of file diff --git a/doc/1/controllers/server/get-last-stats/index.md b/doc/1/controllers/server/get-last-stats/index.md index 42227a83..02b8a33c 100644 --- a/doc/1/controllers/server/get-last-stats/index.md +++ b/doc/1/controllers/server/get-last-stats/index.md @@ -22,12 +22,12 @@ These statistics include: ::: tab Java ```java -CompletableFuture> getLastStats() +CompletableFuture> getLastStats() ``` ## Return -Returns an `ConcurrentHashMap` containing the most recent statistics snapshot. +Returns an `Map` containing the most recent statistics snapshot. ## Usage @@ -36,12 +36,12 @@ Returns an `ConcurrentHashMap` containing the most recent statis ::: tab Kotlin ```kotlin -fun getConfig(): CompletableFuture> +fun getConfig(): CompletableFuture> ``` ## Return -Returns an `ConcurrentHashMap` containing the most recent statistics snapshot. +Returns an `Map` containing the most recent statistics snapshot. ## Usage diff --git a/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-java.java b/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-java.java index 09b56788..d9697fdb 100644 --- a/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-java.java +++ b/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap result = kuzzle +Map result = kuzzle .getServerController() .getLastStats() .get(); \ No newline at end of file diff --git a/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.kt b/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.kt index be0a5ec3..deb49c10 100644 --- a/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.kt +++ b/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.kt @@ -1,4 +1,4 @@ -val result: ConcurrentHashMap = kuzzle +val result: Map = kuzzle .serverController .getLastStats() .get() \ No newline at end of file diff --git a/doc/1/controllers/server/get-stats/index.md b/doc/1/controllers/server/get-stats/index.md index 9f3e50d9..974e4238 100644 --- a/doc/1/controllers/server/get-stats/index.md +++ b/doc/1/controllers/server/get-stats/index.md @@ -21,7 +21,7 @@ These statistics include: ::: tab Java ```java -CompletableFuture> getStats( +CompletableFuture> getStats( Date startTime, Date stopTime) ``` @@ -34,7 +34,7 @@ CompletableFuture> getStats( ## Return -Returns a `ConcurrentHashMap` containing statistics snapshots within the provided range. +Returns a `Map` containing statistics snapshots within the provided range. ## Usage @@ -43,7 +43,7 @@ Returns a `ConcurrentHashMap` containing statistics snapshots wi ::: tab Kotlin ```kotlin -fun getStats(startTime: Date, stopTime: Date): CompletableFuture> +fun getStats(startTime: Date, stopTime: Date): CompletableFuture> ```
@@ -55,7 +55,7 @@ fun getStats(startTime: Date, stopTime: Date): CompletableFuture` containing statistics snapshots within the provided range. +Returns a `Map` containing statistics snapshots within the provided range. ## Usage diff --git a/doc/1/controllers/server/get-stats/snippets/get-stats-java.java b/doc/1/controllers/server/get-stats/snippets/get-stats-java.java index 3b93f7da..b49d075e 100644 --- a/doc/1/controllers/server/get-stats/snippets/get-stats-java.java +++ b/doc/1/controllers/server/get-stats/snippets/get-stats-java.java @@ -1,7 +1,7 @@ Date startTime = new Date(1234567890); Date stopTime = new Date(1541426610); -ConcurrentHashMap result = kuzzle +Map result = kuzzle .getServerController() .getStats(startTime, stopTime) .get(); \ No newline at end of file diff --git a/doc/1/controllers/server/get-stats/snippets/get-stats-kotlin.kt b/doc/1/controllers/server/get-stats/snippets/get-stats-kotlin.kt index d1f60521..fd504297 100644 --- a/doc/1/controllers/server/get-stats/snippets/get-stats-kotlin.kt +++ b/doc/1/controllers/server/get-stats/snippets/get-stats-kotlin.kt @@ -1,7 +1,7 @@ val startTime = Date(1234567890000); val stopTime = Date(1541426610000); -val result: ConcurrentHashMap = kuzzle +val result: Map = kuzzle .serverController .getStats(startTime, stopTime) .get() \ No newline at end of file diff --git a/doc/1/controllers/server/info/index.md b/doc/1/controllers/server/info/index.md index b1441165..09cf3cbe 100644 --- a/doc/1/controllers/server/info/index.md +++ b/doc/1/controllers/server/info/index.md @@ -13,7 +13,7 @@ Returns information about Kuzzle: available API (base + extended), plugins, exte ::: tab Java ```java -CompletableFuture> info() +CompletableFuture> info() ``` ## Return @@ -27,12 +27,12 @@ Returns a `Map` containing server information. ::: tab Kotlin ```kotlin -fun info(): CompletableFuture> +fun info(): CompletableFuture> ``` ## Return -Returns a `ConcurrentHashMap` containing server information. +Returns a `Map` containing server information. ## Usage diff --git a/doc/1/controllers/server/info/snippets/info-java.java b/doc/1/controllers/server/info/snippets/info-java.java index 2f92e99c..286f7312 100644 --- a/doc/1/controllers/server/info/snippets/info-java.java +++ b/doc/1/controllers/server/info/snippets/info-java.java @@ -1,4 +1,4 @@ -ConcurrentHashMap result = kuzzle +Map result = kuzzle .getServerController() .info() .get(); diff --git a/doc/1/controllers/server/info/snippets/info-kotlin.kt b/doc/1/controllers/server/info/snippets/info-kotlin.kt index 0c040467..aa109d1d 100644 --- a/doc/1/controllers/server/info/snippets/info-kotlin.kt +++ b/doc/1/controllers/server/info/snippets/info-kotlin.kt @@ -1,4 +1,4 @@ -val result: ConcurrentHashMap = kuzzle +val result: Map = kuzzle .serverController .info() .get() \ No newline at end of file diff --git a/doc/1/core-classes/kuzzle/query/index.md b/doc/1/core-classes/kuzzle/query/index.md index 27e3a08b..bd1a3d91 100644 --- a/doc/1/core-classes/kuzzle/query/index.md +++ b/doc/1/core-classes/kuzzle/query/index.md @@ -20,7 +20,7 @@ This is a low-level method, exposed to allow advanced SDK users to bypass high-l ```java public CompletableFuture query( - ConcurrentHashMap query) + Map query) throws InternalException, NotConnectedException ``` @@ -28,7 +28,7 @@ public CompletableFuture query( | Argument | Type | Description | | --------- | ----------------- | ---------------------- | -| `query` |
ConcurrentHashMap
| API request | +| `query` |
Map
| API request | ### query @@ -39,11 +39,11 @@ The following properties are the most common. | ------------ | ----------------- | ---------------------------------------- | | `controller` |
String
| Controller name (mandatory) | | `action` |
String
| Action name (mandatory) | -| `body` |
ConcurrentHashMap
| Query body for this action | +| `body` |
Map
| Query body for this action | | `index` |
String
| Index name for this action | | `collection` |
String
| Collection name for this action | | `_id` |
String
| id for this action | -| `volatile` |
ConcurrentHashMap
| Additional information to send to Kuzzle | +| `volatile` |
Map
| Additional information to send to Kuzzle | ## Returns @@ -59,14 +59,14 @@ Returns a [Response](/sdk/jvm/1/core-classes/response) object which represents a ## Arguments ```kotlin -fun query(query: ConcurrentHashMap): CompletableFuture +fun query(query: Map): CompletableFuture ```
| Argument | Type | Description | | --------- | ----------------- | ---------------------- | -| `query` |
ConcurrentHashMap
| API request | +| `query` |
Map
| API request | ### query @@ -77,11 +77,11 @@ The following properties are the most common. | ------------ | ----------------- | ---------------------------------------- | | `controller` |
String
| Controller name (mandatory) | | `action` |
String
| Action name (mandatory) | -| `body` |
ConcurrentHashMap
| Query body for this action | +| `body` |
Map
| Query body for this action | | `index` |
String
| Index name for this action | | `collection` |
String
| Collection name for this action | | `_id` |
String
| id for this action | -| `volatile` |
ConcurrentHashMap
| Additional information to send to Kuzzle | +| `volatile` |
Map
| Additional information to send to Kuzzle | ## Returns diff --git a/doc/1/core-classes/kuzzle/query/snippets/query-java.java b/doc/1/core-classes/kuzzle/query/snippets/query-java.java index 76e76e85..13534bab 100644 --- a/doc/1/core-classes/kuzzle/query/snippets/query-java.java +++ b/doc/1/core-classes/kuzzle/query/snippets/query-java.java @@ -1,11 +1,11 @@ -ConcurrentHashMap query = new ConcurrentHashMap<>(); +Map query = new HashMap<>(); query.put("controller", "document"); query.put("action", "create"); query.put("index", "nyc-open-data"); query.put("collection", "yellow-taxi"); query.put("_id", "my-custom-document-id"); query.put("refresh", "wait_for"); -ConcurrentHashMap body = new ConcurrentHashMap<>(); +Map body = new HashMap<>(); body.put("trip_distance", 4.23); body.put("passenger_count", 2); query.put("body", body); diff --git a/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt b/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt index 83be6d8e..87782df8 100644 --- a/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt +++ b/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt @@ -1,11 +1,11 @@ -val query: ConcurrentHashMap = ConcurrentHashMap().apply { +val query: Map = Map().apply { put("controller", "document") put("action", "create") put("index", "nyc-open-data") put("collection", "yellow-taxi") put("_id", "my-custom-document-id") put("refresh", "wait_for") - put("body", ConcurrentHashMap().apply { + put("body", Map().apply { put("trip_distance", 4.23) put("passenger_count", 2) }) diff --git a/doc/1/core-classes/response/introduction/index.md b/doc/1/core-classes/response/introduction/index.md index 270c20dd..14a2d399 100644 --- a/doc/1/core-classes/response/introduction/index.md +++ b/doc/1/core-classes/response/introduction/index.md @@ -27,4 +27,4 @@ order: 0 | `state` |
String
| Document state (realtime only) | | `status` |
int
| Response status, following HTTP status codes | | `timestamp` |
Long
| Notification timestamp (UTC) | -| `volatile` |
ConcurrentHashMap
| Volatile data | +| `volatile` |
Map
| Volatile data | diff --git a/doc/1/core-classes/search-result/introduction/index.md b/doc/1/core-classes/search-result/introduction/index.md index b1d2e06b..86da8aa5 100644 --- a/doc/1/core-classes/search-result/introduction/index.md +++ b/doc/1/core-classes/search-result/introduction/index.md @@ -29,20 +29,20 @@ import io.kuzzle.sdk.coreClasses.SearchResult; | Property | Type | Description | | -------------- | ------------------------------------------------------- | ------------------ | -| `aggregations` |
ConcurrentHashMap
| Search aggregations (can be undefined) | -| `hits` |
ArrayList>
| Page results | +| `aggregations` |
Map
| Search aggregations (can be undefined) | +| `hits` |
ArrayList>
| Page results | | `total` |
Integer
| Total number of items that _can_ be retrieved | | `fetched` |
Integer
| Number of retrieved items so far | ### hits -Each element of the `hits` ArrayList is a `ConcurrentHashMap` containing the following properties: +Each element of the `hits` ArrayList is a `Map` containing the following properties: | Property | Type | Description | | --------- | ------------------ | ---------------------- | | `_id` |
String
| Document ID | | `_score` |
Integer
| [Relevance score](https://www.elastic.co/guide/en/elasticsearch/guide/current/relevance-intro.html) | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | ::: @@ -59,20 +59,20 @@ import io.kuzzle.sdk.coreClasses.SearchResult; | Property | Type | Description | | -------------- | ------------------------------------------------------- | ------------------ | -| `aggregations` |
ConcurrentHashMap
| Search aggregations (can be undefined) | -| `hits` |
ArrayList>
| Page results | +| `aggregations` |
Map
| Search aggregations (can be undefined) | +| `hits` |
ArrayList>
| Page results | | `total` |
Int
| Total number of items that _can_ be retrieved | | `fetched` |
Int
| Number of retrieved items so far | ### hits -Each element of the `hits` ArrayList is a `ConcurrentHashMap` containing the following properties: +Each element of the `hits` ArrayList is a `Map` containing the following properties: | Property | Type | Description | | --------- | ------------------ | ---------------------- | | `_id` |
String
| Document ID | | `_score` |
Int
| [Relevance score](https://www.elastic.co/guide/en/elasticsearch/guide/current/relevance-intro.html) | -| `_source` |
ConcurrentHashMap
| Document content | +| `_source` |
Map
| Document content | ::: :::: diff --git a/doc/1/core-classes/search-result/next/snippets/fromsize-java.java b/doc/1/core-classes/search-result/next/snippets/fromsize-java.java index ad29ead2..91814373 100644 --- a/doc/1/core-classes/search-result/next/snippets/fromsize-java.java +++ b/doc/1/core-classes/search-result/next/snippets/fromsize-java.java @@ -1,6 +1,6 @@ - ConcurrentHashMap searchQuery = new ConcurrentHashMap<>(); - ConcurrentHashMap query = new ConcurrentHashMap<>(); - ConcurrentHashMap match = new ConcurrentHashMap<>(); + Map searchQuery = new HashMap<>(); + Map query = new HashMap<>(); + Map match = new HashMap<>(); match.put("category", "suv"); query.put("match", match); searchQuery.put("query", query); @@ -11,7 +11,7 @@ searchQuery, 1, 5).get(); // Fetch the matched items by advancing through the result pages - ArrayList> matched = new ArrayList<>(); + ArrayList> matched = new ArrayList<>(); while (results != null) { matched.addAll(results.hits); diff --git a/doc/1/core-classes/search-result/next/snippets/fromsize-kotlin.kt b/doc/1/core-classes/search-result/next/snippets/fromsize-kotlin.kt index 9caa8782..4a0efdc4 100644 --- a/doc/1/core-classes/search-result/next/snippets/fromsize-kotlin.kt +++ b/doc/1/core-classes/search-result/next/snippets/fromsize-kotlin.kt @@ -1,15 +1,15 @@ -val match: ConcurrentHashMap = -ConcurrentHashMap().apply { +val match: Map = +Map().apply { put("category", "suv") } -val query: ConcurrentHashMap = -ConcurrentHashMap().apply { +val query: Map = +Map().apply { put("match", match) } -val searchQuery: ConcurrentHashMap = -ConcurrentHashMap().apply { +val searchQuery: Map = +Map().apply { put("query", query) } @@ -18,7 +18,7 @@ var result: SearchResult? = kuzzle .search("nyc-open-data", "yellow-taxi", searchQuery, 5, 1).get(); // Fetch the matched items by advancing through the result pages -val matched: ArrayList> = ArrayList>(); +val matched: ArrayList> = ArrayList>(); while (result != null) { matched.addAll(result.hits); result = result.next().get(); diff --git a/doc/1/core-classes/search-result/next/snippets/scroll-java.java b/doc/1/core-classes/search-result/next/snippets/scroll-java.java index 0b1f9c94..34a68734 100644 --- a/doc/1/core-classes/search-result/next/snippets/scroll-java.java +++ b/doc/1/core-classes/search-result/next/snippets/scroll-java.java @@ -1,6 +1,6 @@ - ConcurrentHashMap searchQuery = new ConcurrentHashMap<>(); - ConcurrentHashMap query = new ConcurrentHashMap<>(); - ConcurrentHashMap match = new ConcurrentHashMap<>(); + Map searchQuery = new HashMap<>(); + Map query = new HashMap<>(); + Map match = new HashMap<>(); match.put("category", "suv"); query.put("match", match); searchQuery.put("query", query); @@ -11,7 +11,7 @@ searchQuery, "1s", 10).get(); // Fetch the matched items by advancing through the result pages - ArrayList> matched = new ArrayList<>(); + ArrayList> matched = new ArrayList<>(); while (results != null) { matched.addAll(results.hits); diff --git a/doc/1/core-classes/search-result/next/snippets/scroll-kotlin.kt b/doc/1/core-classes/search-result/next/snippets/scroll-kotlin.kt index 693470c0..998fda65 100644 --- a/doc/1/core-classes/search-result/next/snippets/scroll-kotlin.kt +++ b/doc/1/core-classes/search-result/next/snippets/scroll-kotlin.kt @@ -1,14 +1,14 @@ -val match: ConcurrentHashMap = -ConcurrentHashMap().apply { +val match: Map = +Map().apply { put("category", "suv") } -val query: ConcurrentHashMap = -ConcurrentHashMap().apply { +val query: Map = +Map().apply { put("match", match) } -val searchQuery: ConcurrentHashMap = -ConcurrentHashMap().apply { +val searchQuery: Map = +Map().apply { put("query", query) } var result: SearchResult? = kuzzle @@ -16,7 +16,7 @@ var result: SearchResult? = kuzzle .search("nyc-open-data", "yellow-taxi", searchQuery, "1s", 10).get(); // Fetch the matched items by advancing through the result pages - val matched: ArrayList> = ArrayList>(); + val matched: ArrayList> = ArrayList>(); while (result != null) { matched.addAll(result.hits); diff --git a/doc/1/getting-started/java/index.md b/doc/1/getting-started/java/index.md index 6157cbfb..913f72a4 100644 --- a/doc/1/getting-started/java/index.md +++ b/doc/1/getting-started/java/index.md @@ -152,7 +152,7 @@ New created document notification: ``` -You should see the document content as a `ConcurrentHashMap`. +You should see the document content as a `Map`. Now, you know how to: diff --git a/doc/1/getting-started/java/snippets/document-java.java b/doc/1/getting-started/java/snippets/document-java.java index 1a38a946..242fe8ee 100644 --- a/doc/1/getting-started/java/snippets/document-java.java +++ b/doc/1/getting-started/java/snippets/document-java.java @@ -1,7 +1,7 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.concurrent.ConcurrentHashMap; +; public class SnippetTest { private static Kuzzle kuzzle; @@ -25,7 +25,7 @@ public static void main(String[] args) { } // New document content - ConcurrentHashMap content = new ConcurrentHashMap<>(); + Map content = new HashMap<>(); content.put("name", "John"); content.put("birthday", "1995-11-27"); content.put("license", "B"); diff --git a/doc/1/getting-started/java/snippets/firstconnection-java.java b/doc/1/getting-started/java/snippets/firstconnection-java.java index ccb7d3f5..14d7e09a 100644 --- a/doc/1/getting-started/java/snippets/firstconnection-java.java +++ b/doc/1/getting-started/java/snippets/firstconnection-java.java @@ -1,7 +1,7 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.concurrent.ConcurrentHashMap; +; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/doc/1/getting-started/java/snippets/realtime-java.java b/doc/1/getting-started/java/snippets/realtime-java.java index 49780688..8da1bf76 100644 --- a/doc/1/getting-started/java/snippets/realtime-java.java +++ b/doc/1/getting-started/java/snippets/realtime-java.java @@ -1,7 +1,7 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.concurrent.ConcurrentHashMap; +; public class SnippetTest { private static Kuzzle kuzzle; @@ -25,8 +25,8 @@ public static void main(String[] args) { } // Subscribes to notifications for drivers having a "B" driver license. - ConcurrentHashMap filters = new ConcurrentHashMap<>(); - ConcurrentHashMap equals = new ConcurrentHashMap<>(); + Map filters = new HashMap<>(); + Map equals = new HashMap<>(); equals.put("license", "B"); filters.put("equals", equals); @@ -34,7 +34,7 @@ public static void main(String[] args) { // Sends the subscription kuzzle.getRealtimeController() .subscribe("nyc-open-data", "yellow-taxi", filters, notification -> { - ConcurrentHashMap content = ((ConcurrentHashMap)(notification.getResult())); + Map content = ((Map)(notification.getResult())); System.out.println("New created document notification: " + content); /* { @@ -58,7 +58,7 @@ public static void main(String[] args) { // Writes a new document. This triggers a notification // sent to our subscription. - ConcurrentHashMap content = new ConcurrentHashMap<>(); + Map content = new HashMap<>(); content.put("name", "John"); content.put("birthday", "1995-11-27"); content.put("license", "B"); diff --git a/doc/1/getting-started/kotlin/index.md b/doc/1/getting-started/kotlin/index.md index 8c4f50ed..41355ba8 100644 --- a/doc/1/getting-started/kotlin/index.md +++ b/doc/1/getting-started/kotlin/index.md @@ -151,7 +151,7 @@ New created document notification: ``` -You should see the document content as a `ConcurrentHashMap`. +You should see the document content as a `Map`. Now, you know how to: diff --git a/doc/1/getting-started/kotlin/snippets/document-kotlin.kt b/doc/1/getting-started/kotlin/snippets/document-kotlin.kt index 7b377f27..14c347f4 100644 --- a/doc/1/getting-started/kotlin/snippets/document-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/document-kotlin.kt @@ -1,7 +1,7 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.concurrent.ConcurrentHashMap; +; fun main() { // Creates a WebSocket connection. @@ -18,7 +18,7 @@ fun main() { try { // New document content - val content: ConcurrentHashMap = ConcurrentHashMap().apply { + val content: Map = Map().apply { put("name", "John") put("birthday", "1995-11-27") put("license", "B") diff --git a/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt b/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt index 8e3fc1af..f133b52a 100644 --- a/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt @@ -1,7 +1,7 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.concurrent.ConcurrentHashMap; +; fun main() { // Creates a WebSocket connection. diff --git a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt index 5484cce4..4bb062ab 100644 --- a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt @@ -1,7 +1,7 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.concurrent.ConcurrentHashMap; +; fun main() { // Creates a WebSocket connection. @@ -18,10 +18,10 @@ fun main() { try { // Subscribes to notifications for drivers having a "B" driver license. - val equals: ConcurrentHashMap = ConcurrentHashMap().apply { + val equals: Map = Map().apply { put("license", "B") } - val filters: ConcurrentHashMap = ConcurrentHashMap().apply { + val filters: Map = Map().apply { put("equals", equals) } @@ -29,7 +29,7 @@ fun main() { kuzzle .realtimeController .subscribe("nyc-open-data", "yellow-taxi", filters) { notification -> - val content: ConcurrentHashMap = notification.result as ConcurrentHashMap + val content: Map = notification.result as Map println("New created document notification: " + content) /* { @@ -50,7 +50,7 @@ fun main() { // Writes a new document. This triggers a notification // sent to our subscription. - val content: ConcurrentHashMap = ConcurrentHashMap().apply { + val content: Map = Map().apply { put("name", "John") put("birthday", "1995-11-27") put("license", "B") diff --git a/src/main/kotlin/io/kuzzle/sdk/Kuzzle.kt b/src/main/kotlin/io/kuzzle/sdk/Kuzzle.kt index 82a61cdd..67f2a2b4 100644 --- a/src/main/kotlin/io/kuzzle/sdk/Kuzzle.kt +++ b/src/main/kotlin/io/kuzzle/sdk/Kuzzle.kt @@ -17,7 +17,6 @@ import io.kuzzle.sdk.protocol.AbstractProtocol import io.kuzzle.sdk.protocol.ProtocolState import java.util.* import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap import kotlin.collections.HashMap class Kuzzle { @@ -55,7 +54,7 @@ class Kuzzle { private fun onMessageReceived(message: String?) { val response = Response().apply { - fromMap(JsonSerializer.deserialize(message) as ConcurrentHashMap) + fromMap(JsonSerializer.deserialize(message) as Map) } if (queries.size == 0 || (queries.size != 0 && (response.room == null || queries[response.room!!] == null))) { @@ -94,7 +93,7 @@ class Kuzzle { protocol.disconnect() } - fun query(query: ConcurrentHashMap): CompletableFuture { + fun query(query: Map): CompletableFuture { if (protocol.state == ProtocolState.CLOSE) { throw NotConnectedException() } @@ -115,7 +114,7 @@ class Kuzzle { } queries[requestId] = futureRes - query["requestId"] = requestId + queryMap["requestId"] = requestId if (!queryMap.containsKey("volatile") || queryMap.isNull("volatile")) { queryMap["volatile"] = KuzzleMap() @@ -127,7 +126,7 @@ class Kuzzle { queryMap.getMap("volatile")!!["sdkName"] = sdkName - protocol.send(query) + protocol.send(queryMap) return futureRes } diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/AuthController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/AuthController.kt index 8377979f..5d9ca35a 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/AuthController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/AuthController.kt @@ -5,12 +5,12 @@ import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import io.kuzzle.sdk.coreClasses.responses.Response import java.util.* import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap + class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { fun checkToken( - token: String): CompletableFuture> { + token: String): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "auth") put("action", "checkToken") @@ -20,12 +20,12 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } fun createMyCredentials( strategy: String, - credentials: ConcurrentHashMap): CompletableFuture> { + credentials: Map): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "auth") put("action", "createMyCredentials") @@ -34,7 +34,7 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } fun credentialsExist(strategy: String): CompletableFuture { @@ -57,7 +57,7 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle.query(query).thenRunAsync {} } - fun getCurrentUser(): CompletableFuture> { + fun getCurrentUser(): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "auth") put("action", "getCurrentUser") @@ -65,12 +65,12 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - response.result as ConcurrentHashMap + response.result as Map } } fun getMyCredentials( - strategy: String): CompletableFuture> { + strategy: String): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "auth") put("action", "getMyCredentials") @@ -79,7 +79,7 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - response.result as ConcurrentHashMap + response.result as Map } } @@ -92,7 +92,7 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { .query(query) .thenApplyAsync { response -> KuzzleMap - .from(response.result as ConcurrentHashMap) + .from(response.result as Map) .getArrayList("hits") as ArrayList } } @@ -110,8 +110,8 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { @JvmOverloads fun login( strategy: String, - credentials: ConcurrentHashMap?, - expiresIn: String? = null): CompletableFuture> { + credentials: Map?, + expiresIn: String? = null): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "auth") put("action", "login") @@ -123,14 +123,14 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle.query(query).thenApplyAsync { response -> val map: KuzzleMap = KuzzleMap - .from(response.result as ConcurrentHashMap) + .from(response.result as Map) kuzzle.authenticationToken = map.getString("jwt") if (map.getString("_id") != null) { kuzzle.protocol.trigger("loginAttempt", "true") } else { kuzzle.protocol.trigger("loginAttempt", "false") } - map as ConcurrentHashMap + map as Map } } @@ -144,7 +144,7 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { @JvmOverloads fun refreshToken( - expiresIn: String? = null): CompletableFuture> { + expiresIn: String? = null): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "auth") put("action", "refreshToken") @@ -152,15 +152,15 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle.query(query).thenApplyAsync { response -> val map: KuzzleMap = KuzzleMap - .from(response.result as ConcurrentHashMap) + .from(response.result as Map) kuzzle.authenticationToken = map.getString("jwt") - map as ConcurrentHashMap + map as Map } } fun updateMyCredentials( strategy: String, - credentials: ConcurrentHashMap): CompletableFuture> { + credentials: Map): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "auth") put("action", "updateMyCredentials") @@ -170,12 +170,12 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - response.result as ConcurrentHashMap + response.result as Map } } fun updateSelf( - content: ConcurrentHashMap): CompletableFuture> { + content: Map): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "auth") put("action", "updateSelf") @@ -184,12 +184,12 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - response.result as ConcurrentHashMap + response.result as Map } } fun validateMyCredentials(strategy: String, - credentials: ConcurrentHashMap): CompletableFuture { + credentials: Map): CompletableFuture { val query = KuzzleMap().apply { put("controller", "auth") put("action", "validateMyCredentials") diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/BulkController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/BulkController.kt index d0fe9828..06cd5e9e 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/BulkController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/BulkController.kt @@ -5,7 +5,7 @@ import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import io.kuzzle.sdk.coreClasses.responses.Response import java.util.* import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap + import com.google.gson.internal.LazilyParsedNumber class BulkController(kuzzle: Kuzzle) : BaseController(kuzzle) { @@ -14,54 +14,54 @@ class BulkController(kuzzle: Kuzzle) : BaseController(kuzzle) { fun deleteByQuery( index: String, collection: String, - searchQuery: ConcurrentHashMap, + searchQuery: Map, waitForRefresh: Boolean? = null): CompletableFuture { val query = KuzzleMap().apply { put("index", index) put("collection", collection) put("controller", "bulk") put("action", "deleteByQuery") - put("body", ConcurrentHashMap().apply { + put("body", HashMap().apply { put("query", searchQuery) }) put("waitForRefresh", waitForRefresh) } return kuzzle .query(query) - .thenApplyAsync { response -> (response.result as ConcurrentHashMap)["deleted"] as Int} + .thenApplyAsync { response -> (response.result as Map)["deleted"] as Int} } fun importData( index: String, collection: String, - bulkData: ArrayList>): CompletableFuture> { + bulkData: ArrayList>): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) put("controller", "bulk") put("action", "import") - put("body", ConcurrentHashMap().apply { + put("body", HashMap().apply { put("bulkData", bulkData) }) } return kuzzle .query(query) - .thenApplyAsync { response -> (response.result as ConcurrentHashMap) } + .thenApplyAsync { response -> (response.result as Map) } } @JvmOverloads fun mWrite( index: String, collection: String, - documents: ArrayList>, + documents: ArrayList>, notify: Boolean? = null, - waitForRefresh: Boolean? = null): CompletableFuture> { + waitForRefresh: Boolean? = null): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) put("controller", "bulk") put("action", "mWrite") - put("body", ConcurrentHashMap().apply { + put("body", HashMap().apply { put("documents", documents) }) put("waitForRefresh", waitForRefresh) @@ -69,17 +69,17 @@ class BulkController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> (response.result as ConcurrentHashMap) } + .thenApplyAsync { response -> (response.result as Map) } } @JvmOverloads fun write( index: String, collection: String, - content: ConcurrentHashMap, + content: Map, id: String? = null, notify: Boolean? = null, - waitForRefresh: Boolean? = null): CompletableFuture> { + waitForRefresh: Boolean? = null): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -92,6 +92,6 @@ class BulkController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> (response.result as ConcurrentHashMap) } + .thenApplyAsync { response -> (response.result as Map) } } } \ No newline at end of file diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/CollectionController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/CollectionController.kt index aab8a549..ac380b1e 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/CollectionController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/CollectionController.kt @@ -3,9 +3,8 @@ package io.kuzzle.sdk.controllers import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import io.kuzzle.sdk.coreClasses.SearchResult -import java.util.* import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap + class CollectionController(kuzzle: Kuzzle) : BaseController(kuzzle) { @@ -13,7 +12,7 @@ class CollectionController(kuzzle: Kuzzle) : BaseController(kuzzle) { fun create( index: String, collection: String, - definition: ConcurrentHashMap? = null + definition: Map? = null ): CompletableFuture { return kuzzle .query(KuzzleMap().apply { @@ -71,7 +70,7 @@ class CollectionController(kuzzle: Kuzzle) : BaseController(kuzzle) { fun getMapping( index: String, collection: String - ): CompletableFuture> { + ): CompletableFuture> { return kuzzle .query(KuzzleMap().apply { put("controller", "collection") @@ -79,13 +78,13 @@ class CollectionController(kuzzle: Kuzzle) : BaseController(kuzzle) { put("index", index) put("collection", collection) }) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } fun getSpecifications( index: String, collection: String - ): CompletableFuture> { + ): CompletableFuture> { return kuzzle .query(KuzzleMap().apply { put("controller", "collection") @@ -93,17 +92,17 @@ fun getSpecifications( put("index", index) put("collection", collection) }) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } - fun list(index: String): CompletableFuture> { + fun list(index: String): CompletableFuture> { return kuzzle .query(KuzzleMap().apply { put("controller", "collection") put("action", "list") put("index", index) }) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } fun refresh( @@ -122,7 +121,7 @@ fun getSpecifications( @JvmOverloads fun searchSpecifications( - searchQuery: ConcurrentHashMap, + searchQuery: Map, scroll: String? = null, from: Int = 0, size: Int? = null @@ -157,7 +156,7 @@ fun getSpecifications( fun update( index: String, collection: String, - definition: ConcurrentHashMap + definition: Map ): CompletableFuture { return kuzzle .query(KuzzleMap().apply { @@ -173,8 +172,8 @@ fun getSpecifications( fun updateSpecifications( index: String, collection: String, - definition: ConcurrentHashMap - ): CompletableFuture> { + definition: Map + ): CompletableFuture> { return kuzzle .query(KuzzleMap().apply { put("controller", "collection") @@ -183,14 +182,14 @@ fun getSpecifications( put("collection", collection) put("body", definition) }) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } fun validateSpecifications( index: String, collection: String, - specifications: ConcurrentHashMap? - ): CompletableFuture> { + specifications: Map? + ): CompletableFuture> { return kuzzle .query(KuzzleMap().apply { put("controller", "collection") @@ -199,6 +198,6 @@ fun getSpecifications( put("collection", collection) put("body", specifications) }) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } } \ No newline at end of file diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/DocumentController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/DocumentController.kt index ac4484bd..e6048ab6 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/DocumentController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/DocumentController.kt @@ -4,9 +4,7 @@ import com.google.gson.internal.LazilyParsedNumber import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.coreClasses.SearchResult import io.kuzzle.sdk.coreClasses.maps.KuzzleMap -import java.util.* import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { @@ -14,7 +12,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { fun count( index: String, collection: String, - searchQuery: ConcurrentHashMap = ConcurrentHashMap()): CompletableFuture { + searchQuery: Map = mapOf()): CompletableFuture { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -24,16 +22,16 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> ((response.result as ConcurrentHashMap)["count"] as LazilyParsedNumber).toInt() } + .thenApplyAsync { response -> ((response.result as Map)["count"] as LazilyParsedNumber).toInt() } } @JvmOverloads fun create( index: String, collection: String, - document: ConcurrentHashMap, + document: Map, id: String? = null, - waitForRefresh: Boolean? = null): CompletableFuture> { + waitForRefresh: Boolean? = null): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -45,7 +43,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } @JvmOverloads @@ -53,8 +51,8 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { index: String, collection: String, id: String, - document: ConcurrentHashMap, - waitForRefresh: Boolean? = null): CompletableFuture> { + document: Map, + waitForRefresh: Boolean? = null): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -66,7 +64,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } @JvmOverloads @@ -74,7 +72,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { index: String, collection: String, id: String?, - waitForRefresh: Boolean? = null): CompletableFuture> { + waitForRefresh: Boolean? = null): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -86,14 +84,14 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } @JvmOverloads fun deleteByQuery( index: String, collection: String, - searchQuery: ConcurrentHashMap, + searchQuery: Map, waitForRefresh: Boolean? = null): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) @@ -105,7 +103,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> (response.result as ConcurrentHashMap)["ids"] as ArrayList } + .thenApplyAsync { response -> (response.result as Map)["ids"] as ArrayList } } fun exists( @@ -127,7 +125,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { fun get( index: String, collection: String, - id: String): CompletableFuture> { + id: String): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -137,15 +135,15 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } @JvmOverloads fun mCreate( index: String, collection: String, - documents: ArrayList>, - waitForRefresh: Boolean? = null): CompletableFuture>> { + documents: ArrayList>, + waitForRefresh: Boolean? = null): CompletableFuture>> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -157,15 +155,15 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap> } + .thenApplyAsync { response -> response.result as Map> } } @JvmOverloads fun mCreateOrReplace( index: String, collection: String, - documents: ArrayList>, - waitForRefresh: Boolean? = null): CompletableFuture>> { + documents: ArrayList>, + waitForRefresh: Boolean? = null): CompletableFuture>> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -176,7 +174,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap> } + .thenApplyAsync { response -> response.result as Map> } } @JvmOverloads @@ -184,7 +182,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { index: String, collection: String, ids: ArrayList, - waitForRefresh: Boolean? = null): CompletableFuture>> { + waitForRefresh: Boolean? = null): CompletableFuture>> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -196,13 +194,13 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap> } + .thenApplyAsync { response -> response.result as Map> } } fun mGet( index: String, collection: String, - ids: ArrayList): CompletableFuture>> { + ids: ArrayList): CompletableFuture>> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -213,15 +211,15 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap> } + .thenApplyAsync { response -> response.result as Map> } } @JvmOverloads fun mReplace( index: String, collection: String, - documents: ArrayList>, - waitForRefresh: Boolean? = null): CompletableFuture?>> { + documents: ArrayList>, + waitForRefresh: Boolean? = null): CompletableFuture?>> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -232,16 +230,16 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap?> } + .thenApplyAsync { response -> response.result as Map?> } } @JvmOverloads fun mUpdate( index: String, collection: String, - documents: ArrayList?>, + documents: ArrayList?>, waitForRefresh: Boolean? = null, - retryOnConflict: Int? = null): CompletableFuture?>> { + retryOnConflict: Int? = null): CompletableFuture?>> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -253,7 +251,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap?> } + .thenApplyAsync { response -> response.result as Map?> } } @JvmOverloads @@ -261,8 +259,8 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { index: String, collection: String, id: String?, - document: ConcurrentHashMap, - waitForRefresh: Boolean? = null): CompletableFuture> { + document: Map, + waitForRefresh: Boolean? = null): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -275,14 +273,14 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } @JvmOverloads fun search( index: String, collection: String, - searchQuery: ConcurrentHashMap, + searchQuery: Map, scroll: String? = null, size: Int? = null, from: Int = 0): CompletableFuture { @@ -308,7 +306,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { fun search( index: String, collection: String, - searchQuery: ConcurrentHashMap, + searchQuery: Map, size: Int? = null, from: Int = 0): CompletableFuture { @@ -320,10 +318,10 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { index: String, collection: String, id: String?, - document: ConcurrentHashMap, + document: Map, waitForRefresh: Boolean? = null, retryOnConflict: Int? = null, - source: Boolean? = null): CompletableFuture> { + source: Boolean? = null): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -337,18 +335,18 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap } + .thenApplyAsync { response -> response.result as Map } } @JvmOverloads fun updateByQuery( index: String, collection: String, - searchQuery: ConcurrentHashMap, - changes: ConcurrentHashMap, + searchQuery: Map, + changes: Map, waitForRefresh: Boolean? = null, retryOnConflict: Int? = null, - source: Boolean? = null): CompletableFuture>> { + source: Boolean? = null): CompletableFuture>> { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -365,13 +363,13 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) - .thenApplyAsync { response -> response.result as ConcurrentHashMap> } + .thenApplyAsync { response -> response.result as Map> } } fun validate( index: String, collection: String, - document: ConcurrentHashMap): CompletableFuture { + document: Map): CompletableFuture { val query = KuzzleMap().apply { put("index", index) put("collection", collection) @@ -381,6 +379,6 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> (response.result as ConcurrentHashMap<*, *>)["valid"] as Boolean } + .thenApplyAsync { response -> (response.result as Map<*, *>)["valid"] as Boolean } } } \ No newline at end of file diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/RealtimeController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/RealtimeController.kt index 6612a29e..65e459f6 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/RealtimeController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/RealtimeController.kt @@ -6,26 +6,25 @@ import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import io.kuzzle.sdk.coreClasses.responses.Response import io.kuzzle.sdk.handlers.NotificationHandler import io.kuzzle.sdk.protocol.ProtocolState -import java.util.* import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap + import java.util.function.Consumer class RealtimeController(kuzzle: Kuzzle) : BaseController(kuzzle) { private inner class Subscription( val index: String, val collection: String, - val filter: ConcurrentHashMap, + val filter: Map, val handler: (Response) -> Unit, val scope: String, val users: String, val subscribeToSelf: Boolean, - val volatile: ConcurrentHashMap) + val volatile: Map) init { kuzzle.protocol.addListener("unhandledResponse") { val response = Response().apply { - fromMap(JsonSerializer.deserialize(it) as ConcurrentHashMap) + fromMap(JsonSerializer.deserialize(it) as Map) } if (response.error != null && response.error!!.id.equals("security.token.expired")) { @@ -65,7 +64,7 @@ class RealtimeController(kuzzle: Kuzzle) : BaseController(kuzzle) { .thenApplyAsync { response -> (response.result as KuzzleMap?)!!.getNumber("count")?.toInt() } } - fun publish(index: String, collection: String, message: ConcurrentHashMap): CompletableFuture { + fun publish(index: String, collection: String, message: Map): CompletableFuture { return kuzzle .query(KuzzleMap().apply { put("controller", "realtime") @@ -98,11 +97,11 @@ class RealtimeController(kuzzle: Kuzzle) : BaseController(kuzzle) { fun subscribe( index: String?, collection: String?, - filters: ConcurrentHashMap, + filters: Map, scope: String = "all", users: String = "all", subscribeToSelf: Boolean = true, - volatiles: ConcurrentHashMap = ConcurrentHashMap(), + volatiles: Map = HashMap(), handler: (Response) -> Unit): CompletableFuture { val query: KuzzleMap = KuzzleMap().apply { put("controller", "realtime") @@ -115,7 +114,7 @@ class RealtimeController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - val channel = (response.result as ConcurrentHashMap<*, *>)["channel"].toString() + val channel = (response.result as Map<*, *>)["channel"].toString() val subscription = Subscription( index!!, collection!!, @@ -134,7 +133,7 @@ class RealtimeController(kuzzle: Kuzzle) : BaseController(kuzzle) { currentSubscriptions[channel]!!.add(subscription) subscriptionsCache[channel]!!.add(subscription) } - (response.result as ConcurrentHashMap<*, *>)["roomId"].toString() + (response.result as Map<*, *>)["roomId"].toString() } } @@ -145,11 +144,11 @@ class RealtimeController(kuzzle: Kuzzle) : BaseController(kuzzle) { fun subscribe( index: String?, collection: String?, - filters: ConcurrentHashMap, + filters: Map, scope: String = "all", users: String = "all", subscribeToSelf: Boolean = true, - volatiles: ConcurrentHashMap = ConcurrentHashMap(), + volatiles: Map = HashMap(), handler: NotificationHandler): CompletableFuture { return subscribe( index, @@ -183,6 +182,6 @@ class RealtimeController(kuzzle: Kuzzle) : BaseController(kuzzle) { } } - private val currentSubscriptions = ConcurrentHashMap>() - private val subscriptionsCache = ConcurrentHashMap>() + private val currentSubscriptions = HashMap>() + private val subscriptionsCache = HashMap>() } diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/ServerController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/ServerController.kt index 29f48da7..2db1e867 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/ServerController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/ServerController.kt @@ -4,7 +4,7 @@ import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import java.util.Date import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap + class ServerController(kuzzle: Kuzzle) : BaseController(kuzzle) { @@ -18,12 +18,12 @@ class ServerController(kuzzle: Kuzzle) : BaseController(kuzzle) { .query(query) .thenApplyAsync { response -> KuzzleMap - .from(response.result as ConcurrentHashMap) + .from(response.result as Map) .getBoolean("exists") } } - fun getAllStats(): CompletableFuture> { + fun getAllStats(): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "server") put("action", "getAllStats") @@ -31,11 +31,11 @@ class ServerController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - response.result as ConcurrentHashMap + response.result as Map } } - fun getConfig(): CompletableFuture> { + fun getConfig(): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "server") put("action", "getConfig") @@ -43,11 +43,11 @@ class ServerController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - response.result as ConcurrentHashMap + response.result as Map } } - fun getLastStats(): CompletableFuture> { + fun getLastStats(): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "server") put("action", "getLastStats") @@ -55,11 +55,11 @@ class ServerController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - response.result as ConcurrentHashMap + response.result as Map } } - fun getStats(startTime: Date, stopTime: Date): CompletableFuture> { + fun getStats(startTime: Date, stopTime: Date): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "server") put("action", "getStats") @@ -69,11 +69,11 @@ class ServerController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - response.result as ConcurrentHashMap + response.result as Map } } - fun info(): CompletableFuture> { + fun info(): CompletableFuture> { val query = KuzzleMap().apply { put("controller", "server") put("action", "info") @@ -81,7 +81,7 @@ class ServerController(kuzzle: Kuzzle) : BaseController(kuzzle) { return kuzzle .query(query) .thenApplyAsync { response -> - response.result as ConcurrentHashMap + response.result as Map } } @@ -93,7 +93,7 @@ class ServerController(kuzzle: Kuzzle) : BaseController(kuzzle) { put("action", "now") }) .thenApplyAsync { response -> - val date = ((response.result as ConcurrentHashMap)["now"]).toString().toLong() + val date = ((response.result as Map)["now"]).toString().toLong() Date(date) } } diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/SearchResult.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/SearchResult.kt index 1b263076..684611c2 100644 --- a/src/main/kotlin/io/kuzzle/sdk/coreClasses/SearchResult.kt +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/SearchResult.kt @@ -2,23 +2,23 @@ package io.kuzzle.sdk.coreClasses import com.google.gson.internal.LazilyParsedNumber import io.kuzzle.sdk.Kuzzle +import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import io.kuzzle.sdk.coreClasses.responses.Response -import java.util.* import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap + import java.util.function.Function class SearchResult { private var scroll: String? = null private var from: Int = 0 private var size: Int? = null - private var request: ConcurrentHashMap? = null + private var request: Map? = null private val scrollAction = "scroll" private var kuzzle: Kuzzle? = null - var aggregations: ConcurrentHashMap? = null + var aggregations: Map? = null @JvmField - public var hits: ArrayList> = ArrayList>() + public var hits: ArrayList> = ArrayList>() @JvmField public var total: Int = 0 @JvmField @@ -28,48 +28,48 @@ class SearchResult { @JvmOverloads constructor( kuzzle: Kuzzle?, - request: ConcurrentHashMap?, + request: KuzzleMap, scroll: String? = null, from: Int = 0, size: Int? = null, response: Response, previouslyFetched: Int? = null) { - val _response: ConcurrentHashMap = response.toMap() + val _response: Map = response.toMap() this.kuzzle = kuzzle this.scroll = scroll this.from = from this.size = size this.request = request - this.aggregations = (_response["result"] as ConcurrentHashMap<*, *>)["aggregations"] as ConcurrentHashMap? - this.hits = (_response["result"] as ConcurrentHashMap<*, *>)["hits"] as ArrayList> - this.total = ((_response["result"] as ConcurrentHashMap<*, *>)["total"] as LazilyParsedNumber?)!!.toInt() + this.aggregations = (_response["result"] as Map<*, *>)["aggregations"] as Map? + this.hits = (_response["result"] as Map<*, *>)["hits"] as ArrayList> + this.total = ((_response["result"] as Map<*, *>)["total"] as LazilyParsedNumber?)!!.toInt() this.fetched = hits!!.size if (previouslyFetched != null) { this.fetched += previouslyFetched } - scrollId = (_response["result"] as ConcurrentHashMap<*, *>)["scrollId"] as String? + scrollId = (_response["result"] as Map<*, *>)["scrollId"] as String? } - private fun getScrollRequest(): ConcurrentHashMap? { - val obj = ConcurrentHashMap() + private fun getScrollRequest(): Map? { + val obj = HashMap() obj["controller"] = request!!["controller"]!! obj["action"] = scrollAction obj["scrollId"] = scrollId!! return obj } - private fun getSearchAfterRequest(): ConcurrentHashMap? { + private fun getSearchAfterRequest(): Map? { val nextRequest = request val lastItem = hits!![hits!!.size] val searchAfter = ArrayList() - val sort = (request!!["body"] as ConcurrentHashMap<*, *>)["sort"] as ArrayList? - (request!!["body"] as ConcurrentHashMap)["search_after"] = searchAfter + val sort = (request!!["body"] as Map<*, *>)["sort"] as ArrayList? + (request!!["body"] as HashMap)["search_after"] = searchAfter for (value in sort!!) { - var key: String = (value as? String)?.toString() ?: (value as ConcurrentHashMap<*, *>)["First"].toString() + var key: String = (value as? String)?.toString() ?: (value as Map<*, *>)["First"].toString() if (key == "_uid") { searchAfter.add(request!!["collection"].toString() + "#" + lastItem["_id"].toString()) } else { - val _source = lastItem["_source"] as ConcurrentHashMap<*, *>? + val _source = lastItem["_source"] as Map<*, *>? searchAfter.add(_source!![key]) } } @@ -78,11 +78,11 @@ class SearchResult { operator fun next(): CompletableFuture { if (fetched >= total) return CompletableFuture.completedFuture(null) - var nextRequest: ConcurrentHashMap? = null + var nextRequest: Map? = null if (scrollId != null) { nextRequest = getScrollRequest() } else if (size != null - && (request!!["body"] as ConcurrentHashMap<*, *>)["sort"] != null) { + && (request!!["body"] as Map<*, *>)["sort"] != null) { nextRequest = getSearchAfterRequest() } else if (size != null) { if (from != null && from >= total) { @@ -94,9 +94,9 @@ class SearchResult { if (nextRequest == null) { return CompletableFuture.completedFuture(null) } - val request: ConcurrentHashMap = nextRequest + val request: Map = nextRequest return kuzzle!!.query(nextRequest) .thenApplyAsync( - Function { response: Response -> SearchResult(kuzzle, request, scroll, from, size, response, fetched) }) + Function { response: Response -> SearchResult(kuzzle, KuzzleMap.from(request), scroll, from, size, response, fetched) }) } } \ No newline at end of file diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/exceptions/KuzzleExceptionCode.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/exceptions/KuzzleExceptionCode.kt index 02e6b4fc..9547848b 100644 --- a/src/main/kotlin/io/kuzzle/sdk/coreClasses/exceptions/KuzzleExceptionCode.kt +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/exceptions/KuzzleExceptionCode.kt @@ -3,7 +3,7 @@ package io.kuzzle.sdk.coreClasses.exceptions enum class KuzzleExceptionCode { MISSING_REQUESTID(0, "Missing field requestId"), MISSING_QUERY(400, "You must provide a query"), NOT_CONNECTED(500, "Not connected."), CONNECTION_LOST(500, "Connection lost"), WRONG_VOLATILE_TYPE( 400, - "Volatile data must be a ConcurrentHashMap"); + "Volatile data must be a Map"); val code: Int val message: String? diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/json/ConcurrentHashMapTypeAdapter.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/json/ConcurrentHashMapTypeAdapter.kt index 598b0348..1b017f34 100644 --- a/src/main/kotlin/io/kuzzle/sdk/coreClasses/json/ConcurrentHashMapTypeAdapter.kt +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/json/ConcurrentHashMapTypeAdapter.kt @@ -9,11 +9,11 @@ import com.google.gson.stream.JsonWriter import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import java.io.IOException import java.util.* -import java.util.concurrent.ConcurrentHashMap -class ConcurrentHashMapTypeAdapter : TypeAdapter?>() { + +class MapTypeAdapter : TypeAdapter?>() { @Throws(IOException::class) - override fun write(out: JsonWriter, map: ConcurrentHashMap?) { + override fun write(out: JsonWriter, map: Map?) { if (map == null) { out.nullValue() } else { @@ -29,7 +29,7 @@ class ConcurrentHashMapTypeAdapter : TypeAdapter? { + override fun read(`in`: JsonReader): Map? { val peek = `in`.peek() if (peek == JsonToken.NULL) { `in`.nextNull() @@ -69,9 +69,9 @@ class ConcurrentHashMapTypeAdapter : TypeAdapter) { + } else if (value is Map<*, *>) { out.beginObject() - val iterator: Iterator> = (value as ConcurrentHashMap) + val iterator: Iterator> = (value as Map) .entries .iterator() while (iterator.hasNext()) { diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/json/JsonSerializer.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/json/JsonSerializer.kt index 246eb865..56452780 100644 --- a/src/main/kotlin/io/kuzzle/sdk/coreClasses/json/JsonSerializer.kt +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/json/JsonSerializer.kt @@ -2,16 +2,16 @@ package io.kuzzle.sdk.coreClasses.json import com.google.gson.Gson import com.google.gson.GsonBuilder -import java.util.concurrent.ConcurrentHashMap + object JsonSerializer { private var gson: Gson? = null - fun deserialize(rawJson: String?): ConcurrentHashMap<*, *> { - return gson!!.fromJson(rawJson, ConcurrentHashMap::class.java) + fun deserialize(rawJson: String?): Map<*, *> { + return gson!!.fromJson(rawJson, Map::class.java) } - fun serialize(map: ConcurrentHashMap?): String { - return gson!!.toJson(map, ConcurrentHashMap::class.java) + fun serialize(map: Map?): String { + return gson!!.toJson(map, Map::class.java) } init { @@ -19,8 +19,8 @@ object JsonSerializer { .disableHtmlEscaping() .disableInnerClassSerialization() .serializeNulls() - .registerTypeAdapter(ConcurrentHashMap::class.java, - ConcurrentHashMapTypeAdapter()) + .registerTypeAdapter(Map::class.java, + MapTypeAdapter()) .create() } } \ No newline at end of file diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/maps/KuzzleMap.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/maps/KuzzleMap.kt index eb903e58..39284cc2 100644 --- a/src/main/kotlin/io/kuzzle/sdk/coreClasses/maps/KuzzleMap.kt +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/maps/KuzzleMap.kt @@ -1,27 +1,24 @@ package io.kuzzle.sdk.coreClasses.maps -import java.util.* -import java.util.concurrent.ConcurrentHashMap - /** - * CustomMap is a Class that extends ConcurrentHashMap to be ThreadSafe and that - * has the purpose of giving a wrapper on top of ConcurrentHashMap to easily + * KuzzleMap is a Class that extends Map to be ThreadSafe and that + * has the purpose of giving a wrapper on top of Map to easily * manipulate them. */ -class KuzzleMap : ConcurrentHashMap { +class KuzzleMap : HashMap { /** * Create a new instance of CustomMap */ constructor() : super() {} /** - * Create a new instance of CustomMap from a ConcurrentHashMap, + * Create a new instance of CustomMap from a Map, * Object>. * * @param map - * ConcurrentHashMap, Object> representing JSON. + * Map, Object> representing JSON. */ - constructor(map: ConcurrentHashMap) : super() { + constructor(map: Map) : super() { val it = map.entries.iterator() while (it.hasNext()) { val entry = it.next() @@ -99,14 +96,14 @@ class KuzzleMap : ConcurrentHashMap { } /** - * Check whether the key value is a ConcurrentHashMap or not. + * Check whether the key value is a Map or not. * * @param key * a String representing the key. - * @return true if the key is a ConcurrentHashMap. + * @return true if the key is a Map. */ fun isMap(key: String): Boolean { - return super.get(key) is ConcurrentHashMap<*, *> + return super.get(key) is Map<*, *> } /** @@ -155,14 +152,14 @@ class KuzzleMap : ConcurrentHashMap { /** * Return the specified key value or null if the value is not a - * ConcurrentHashMap. + * Map. * * @param key * a String representing the key. - * @return The ConcurrentHashMap at the key or null + * @return The Map at the key or null */ fun getMap(key: String): KuzzleMap? { - return if (isMap(key)) from(super.get(key) as ConcurrentHashMap) else null + return if (isMap(key)) from(super.get(key) as Map) else null } /** @@ -215,14 +212,14 @@ class KuzzleMap : ConcurrentHashMap { /** * Return the specified key value or the def value if the value is nul or not - * a ConcurrentHashMap. + * a Map. * * @param key * a String representing the key. - * @return The ConcurrentHashMap at the key or def value + * @return The Map at the key or def value */ - fun optMap(key: String, def: ConcurrentHashMap): KuzzleMap { - return if (isMap(key)) from(super.get(key) as ConcurrentHashMap) else from(def) + fun optMap(key: String, def: Map): KuzzleMap { + return if (isMap(key)) from(super.get(key) as Map) else from(def) } companion object { @@ -232,16 +229,14 @@ class KuzzleMap : ConcurrentHashMap { private const val serialVersionUID = -3027862451021177820L /** - * Convert à ConcurrentHashMap, Object> to a CustomMap + * Convert à Map, Object> to a CustomMap * * @param map - * ConcurrentHashMap, Object> representing JSON. + * Map, Object> representing JSON. * @return a CustomMap instance */ - fun from(map: ConcurrentHashMap): KuzzleMap { - return if (map is KuzzleMap) { - map - } else KuzzleMap(map) + fun from(map: Map): KuzzleMap { + return KuzzleMap(map) } } } \ No newline at end of file diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/maps/Serializable.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/maps/Serializable.kt index a1215912..a98975bc 100644 --- a/src/main/kotlin/io/kuzzle/sdk/coreClasses/maps/Serializable.kt +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/maps/Serializable.kt @@ -1,11 +1,11 @@ package io.kuzzle.sdk.coreClasses.maps -import java.util.concurrent.ConcurrentHashMap + interface Serializable { @Throws(Exception::class) - fun fromMap(map: ConcurrentHashMap?) + fun fromMap(map: Map?) @Throws(Exception::class) - fun toMap(): ConcurrentHashMap? + fun toMap(): Map? } \ No newline at end of file diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/responses/ErrorResponse.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/responses/ErrorResponse.kt index 22519743..b856d41b 100644 --- a/src/main/kotlin/io/kuzzle/sdk/coreClasses/responses/ErrorResponse.kt +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/responses/ErrorResponse.kt @@ -2,7 +2,7 @@ package io.kuzzle.sdk.coreClasses.responses import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import io.kuzzle.sdk.coreClasses.maps.Serializable -import java.util.concurrent.ConcurrentHashMap + class ErrorResponse : Serializable { /** @@ -25,7 +25,7 @@ class ErrorResponse : Serializable { */ var stack: String? = null - override fun fromMap(map: ConcurrentHashMap?) { + override fun fromMap(map: Map?) { if (map == null) return val kuzzleMap: KuzzleMap? = KuzzleMap?.from(map) status = kuzzleMap?.optNumber("status", 0)!!.toInt() @@ -34,8 +34,8 @@ class ErrorResponse : Serializable { id = kuzzleMap?.getString("id") } - override fun toMap(): ConcurrentHashMap { - val map: ConcurrentHashMap = KuzzleMap() + override fun toMap(): Map { + val map = KuzzleMap() map["status"] = status map["message"] = message!! map["stack"] = stack!! diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/responses/Response.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/responses/Response.kt index 684bb5cf..79bce7ec 100644 --- a/src/main/kotlin/io/kuzzle/sdk/coreClasses/responses/Response.kt +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/responses/Response.kt @@ -3,10 +3,10 @@ package io.kuzzle.sdk.coreClasses.responses import io.kuzzle.sdk.coreClasses.exceptions.KuzzleExceptionCode import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import io.kuzzle.sdk.coreClasses.maps.Serializable -import java.util.concurrent.ConcurrentHashMap + class Response : Serializable { - var mapResponse: ConcurrentHashMap? = null + var mapResponse: Map? = null private set var room: String? = null @@ -54,7 +54,7 @@ class Response : Serializable { /** * Volatile data. */ - var Volatile: ConcurrentHashMap? = null + var Volatile: Map? = null // The following properties are specific to real-time notifications /** * Network protocol at the origin of the real-time notification. @@ -81,7 +81,7 @@ class Response : Serializable { */ var type: String? = null - override fun fromMap(map: ConcurrentHashMap?) { + override fun fromMap(map: Map?) { if (map == null) return mapResponse = map @@ -103,7 +103,7 @@ class Response : Serializable { action = kuzzleMap.getString("action") index = kuzzleMap.getString("index") collection = kuzzleMap.getString("collection") - Volatile = kuzzleMap.optMap("volatile", ConcurrentHashMap()) + Volatile = kuzzleMap.optMap("volatile", HashMap()) protocol = kuzzleMap.getString("protocol") scope = kuzzleMap.getString("scope") state = kuzzleMap.getString("state") @@ -114,8 +114,8 @@ class Response : Serializable { type = kuzzleMap.getString("type") } - override fun toMap(): ConcurrentHashMap { - val map = ConcurrentHashMap() + override fun toMap(): Map { + val map = HashMap() room?.let { map.put("room", it) } result?.let { map.put("result", it) } diff --git a/src/main/kotlin/io/kuzzle/sdk/protocol/AbstractProtocol.kt b/src/main/kotlin/io/kuzzle/sdk/protocol/AbstractProtocol.kt index e5b82fc6..60fcb4f3 100644 --- a/src/main/kotlin/io/kuzzle/sdk/protocol/AbstractProtocol.kt +++ b/src/main/kotlin/io/kuzzle/sdk/protocol/AbstractProtocol.kt @@ -1,11 +1,11 @@ package io.kuzzle.sdk.protocol import io.kuzzle.sdk.events.EventManager -import java.util.concurrent.ConcurrentHashMap + abstract class AbstractProtocol: EventManager() { abstract var state: ProtocolState abstract fun connect() abstract fun disconnect() - abstract fun send(payload: ConcurrentHashMap) + abstract fun send(payload: Map) } diff --git a/src/main/kotlin/io/kuzzle/sdk/protocol/WebSocket.kt b/src/main/kotlin/io/kuzzle/sdk/protocol/WebSocket.kt index 5007c139..bc56abe6 100644 --- a/src/main/kotlin/io/kuzzle/sdk/protocol/WebSocket.kt +++ b/src/main/kotlin/io/kuzzle/sdk/protocol/WebSocket.kt @@ -20,7 +20,7 @@ import java.io.IOException import java.net.ConnectException import java.net.SocketException import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap + import java.util.concurrent.ConcurrentLinkedQueue import kotlin.concurrent.thread @@ -153,7 +153,7 @@ open class WebSocket : AbstractProtocol { } } - override fun send(payload: ConcurrentHashMap) { + override fun send(payload: Map) { queue.add(JsonSerializer.serialize(payload)) } } \ No newline at end of file diff --git a/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt b/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt index 57e88c9a..5ae49765 100644 --- a/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt +++ b/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt @@ -14,7 +14,7 @@ import io.kuzzle.sdk.protocol.WebSocket import org.junit.Assert.* import org.junit.Before import org.junit.Test -import java.util.concurrent.ConcurrentHashMap + class WebSocketTests { inner class MockedSocket(host: String) : WebSocket(host) { @@ -69,7 +69,7 @@ class WebSocketTests { @KtorExperimentalAPI @Test fun sendTest() { - val query = ConcurrentHashMap().apply { + val query = Map().apply { put("controller", "server") put("action", "now") } From dac4f491dc44eb820ea70c76c792bb82fb3119a0 Mon Sep 17 00:00:00 2001 From: jenow Date: Wed, 3 Feb 2021 19:05:51 +0100 Subject: [PATCH 02/13] remove lonely semicolon --- .ci/doc/templates/catch.tpl.java | 1 - .ci/doc/templates/default.tpl.java | 1 - .ci/doc/templates/print-result-array.tpl.java | 2 -- .ci/doc/templates/print-result-arraylist.tpl.java | 2 -- .ci/doc/templates/print-result.tpl.java | 2 -- .ci/doc/templates/print-search-result.tpl.java | 1 - doc/1/getting-started/java/snippets/document-java.java | 2 -- doc/1/getting-started/java/snippets/firstconnection-java.java | 2 -- doc/1/getting-started/java/snippets/realtime-java.java | 2 -- doc/1/getting-started/kotlin/snippets/document-kotlin.kt | 2 -- doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt | 2 -- doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt | 2 -- 12 files changed, 21 deletions(-) diff --git a/.ci/doc/templates/catch.tpl.java b/.ci/doc/templates/catch.tpl.java index f6ae68f6..2a6cb7be 100644 --- a/.ci/doc/templates/catch.tpl.java +++ b/.ci/doc/templates/catch.tpl.java @@ -1,7 +1,6 @@ import io.kuzzle.sdk.Kuzzle; import java.util.ArrayList; import io.kuzzle.sdk.protocol.WebSocket; -; import io.kuzzle.sdk.coreClasses.responses.Response; public class SnippetTest { diff --git a/.ci/doc/templates/default.tpl.java b/.ci/doc/templates/default.tpl.java index 76821f81..97777527 100644 --- a/.ci/doc/templates/default.tpl.java +++ b/.ci/doc/templates/default.tpl.java @@ -1,7 +1,6 @@ import io.kuzzle.sdk.Kuzzle; import java.util.ArrayList; import io.kuzzle.sdk.protocol.WebSocket; -; import io.kuzzle.sdk.coreClasses.responses.Response; import io.kuzzle.sdk.coreClasses.SearchResult; diff --git a/.ci/doc/templates/print-result-array.tpl.java b/.ci/doc/templates/print-result-array.tpl.java index 266fd411..802db51c 100644 --- a/.ci/doc/templates/print-result-array.tpl.java +++ b/.ci/doc/templates/print-result-array.tpl.java @@ -1,8 +1,6 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; - -; import java.util.ArrayList; public class SnippetTest { diff --git a/.ci/doc/templates/print-result-arraylist.tpl.java b/.ci/doc/templates/print-result-arraylist.tpl.java index 5b00f925..02a15d71 100644 --- a/.ci/doc/templates/print-result-arraylist.tpl.java +++ b/.ci/doc/templates/print-result-arraylist.tpl.java @@ -1,8 +1,6 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; - -; import java.util.ArrayList; public class SnippetTest { diff --git a/.ci/doc/templates/print-result.tpl.java b/.ci/doc/templates/print-result.tpl.java index 2bf5c8ed..d6baba7c 100644 --- a/.ci/doc/templates/print-result.tpl.java +++ b/.ci/doc/templates/print-result.tpl.java @@ -2,8 +2,6 @@ import io.kuzzle.sdk.protocol.WebSocket; import java.util.Date; import io.kuzzle.sdk.coreClasses.responses.Response; - -; import java.util.ArrayList; public class SnippetTest { diff --git a/.ci/doc/templates/print-search-result.tpl.java b/.ci/doc/templates/print-search-result.tpl.java index 1fde9d3d..2edbace7 100644 --- a/.ci/doc/templates/print-search-result.tpl.java +++ b/.ci/doc/templates/print-search-result.tpl.java @@ -1,7 +1,6 @@ import io.kuzzle.sdk.Kuzzle; import java.util.ArrayList; import io.kuzzle.sdk.protocol.WebSocket; -; import io.kuzzle.sdk.coreClasses.responses.Response; import io.kuzzle.sdk.coreClasses.SearchResult; diff --git a/doc/1/getting-started/java/snippets/document-java.java b/doc/1/getting-started/java/snippets/document-java.java index 242fe8ee..ccb98965 100644 --- a/doc/1/getting-started/java/snippets/document-java.java +++ b/doc/1/getting-started/java/snippets/document-java.java @@ -1,8 +1,6 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -; - public class SnippetTest { private static Kuzzle kuzzle; diff --git a/doc/1/getting-started/java/snippets/firstconnection-java.java b/doc/1/getting-started/java/snippets/firstconnection-java.java index 14d7e09a..fe79392a 100644 --- a/doc/1/getting-started/java/snippets/firstconnection-java.java +++ b/doc/1/getting-started/java/snippets/firstconnection-java.java @@ -1,8 +1,6 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -; - public class SnippetTest { private static Kuzzle kuzzle; diff --git a/doc/1/getting-started/java/snippets/realtime-java.java b/doc/1/getting-started/java/snippets/realtime-java.java index 8da1bf76..8d80dd4f 100644 --- a/doc/1/getting-started/java/snippets/realtime-java.java +++ b/doc/1/getting-started/java/snippets/realtime-java.java @@ -1,8 +1,6 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -; - public class SnippetTest { private static Kuzzle kuzzle; diff --git a/doc/1/getting-started/kotlin/snippets/document-kotlin.kt b/doc/1/getting-started/kotlin/snippets/document-kotlin.kt index 14c347f4..6e3c8a77 100644 --- a/doc/1/getting-started/kotlin/snippets/document-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/document-kotlin.kt @@ -1,8 +1,6 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -; - fun main() { // Creates a WebSocket connection. // Replace "kuzzle" with diff --git a/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt b/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt index f133b52a..a81e3f85 100644 --- a/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt @@ -1,8 +1,6 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -; - fun main() { // Creates a WebSocket connection. // Replace "kuzzle" with diff --git a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt index 4bb062ab..d08b9566 100644 --- a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt @@ -1,8 +1,6 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; -; - fun main() { // Creates a WebSocket connection. // Replace "kuzzle" with From 6d6c5588f30f3146f6ffb594ae3777b0f7ace7a9 Mon Sep 17 00:00:00 2001 From: jenow Date: Wed, 3 Feb 2021 19:30:15 +0100 Subject: [PATCH 03/13] fix unit test --- src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt b/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt index 5ae49765..99d62d91 100644 --- a/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt +++ b/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt @@ -69,7 +69,7 @@ class WebSocketTests { @KtorExperimentalAPI @Test fun sendTest() { - val query = Map().apply { + val query = HashMap().apply { put("controller", "server") put("action", "now") } From eddf45c7e7c455ca599a8a047d03833b043f38aa Mon Sep 17 00:00:00 2001 From: jenow Date: Wed, 3 Feb 2021 19:40:20 +0100 Subject: [PATCH 04/13] add java.util import to java doc tests --- .ci/doc/templates/catch.tpl.java | 1 + .ci/doc/templates/default.tpl.java | 2 +- .ci/doc/templates/print-result-array.tpl.java | 2 +- .ci/doc/templates/print-result-arraylist.tpl.java | 2 +- .ci/doc/templates/print-result.tpl.java | 3 +-- .ci/doc/templates/print-search-result.tpl.java | 2 +- .ci/doc/templates/without-connect.tpl.java | 1 + .ci/doc/templates/without-ctor.tpl.java | 1 + 8 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.ci/doc/templates/catch.tpl.java b/.ci/doc/templates/catch.tpl.java index 2a6cb7be..6353d08d 100644 --- a/.ci/doc/templates/catch.tpl.java +++ b/.ci/doc/templates/catch.tpl.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; +import java.util.*; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/.ci/doc/templates/default.tpl.java b/.ci/doc/templates/default.tpl.java index 97777527..383a675e 100644 --- a/.ci/doc/templates/default.tpl.java +++ b/.ci/doc/templates/default.tpl.java @@ -1,8 +1,8 @@ import io.kuzzle.sdk.Kuzzle; -import java.util.ArrayList; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; import io.kuzzle.sdk.coreClasses.SearchResult; +import java.util.*; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/.ci/doc/templates/print-result-array.tpl.java b/.ci/doc/templates/print-result-array.tpl.java index 802db51c..936bc1a6 100644 --- a/.ci/doc/templates/print-result-array.tpl.java +++ b/.ci/doc/templates/print-result-array.tpl.java @@ -1,7 +1,7 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; -import java.util.ArrayList; +import java.util.*; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/.ci/doc/templates/print-result-arraylist.tpl.java b/.ci/doc/templates/print-result-arraylist.tpl.java index 02a15d71..398b17d5 100644 --- a/.ci/doc/templates/print-result-arraylist.tpl.java +++ b/.ci/doc/templates/print-result-arraylist.tpl.java @@ -1,7 +1,7 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; -import java.util.ArrayList; +import java.util.*; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/.ci/doc/templates/print-result.tpl.java b/.ci/doc/templates/print-result.tpl.java index d6baba7c..385504f2 100644 --- a/.ci/doc/templates/print-result.tpl.java +++ b/.ci/doc/templates/print-result.tpl.java @@ -1,8 +1,7 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; -import java.util.Date; import io.kuzzle.sdk.coreClasses.responses.Response; -import java.util.ArrayList; +import java.util.*; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/.ci/doc/templates/print-search-result.tpl.java b/.ci/doc/templates/print-search-result.tpl.java index 2edbace7..0f301169 100644 --- a/.ci/doc/templates/print-search-result.tpl.java +++ b/.ci/doc/templates/print-search-result.tpl.java @@ -1,5 +1,5 @@ import io.kuzzle.sdk.Kuzzle; -import java.util.ArrayList; +import java.util.*; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; import io.kuzzle.sdk.coreClasses.SearchResult; diff --git a/.ci/doc/templates/without-connect.tpl.java b/.ci/doc/templates/without-connect.tpl.java index c01bc7ce..6e6dadd1 100644 --- a/.ci/doc/templates/without-connect.tpl.java +++ b/.ci/doc/templates/without-connect.tpl.java @@ -1,5 +1,6 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; +import java.util.*; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/.ci/doc/templates/without-ctor.tpl.java b/.ci/doc/templates/without-ctor.tpl.java index fd35ba7e..8ae03372 100644 --- a/.ci/doc/templates/without-ctor.tpl.java +++ b/.ci/doc/templates/without-ctor.tpl.java @@ -1,5 +1,6 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; +import java.util.*; public class SnippetTest { public static void main(String[] argv) { From 5f76ac5e79eee86140ec5fda6f62cb5ae2f88af4 Mon Sep 17 00:00:00 2001 From: jenow Date: Wed, 3 Feb 2021 20:01:26 +0100 Subject: [PATCH 05/13] use HashMap in documentation --- .../check-token/snippets/check-token-kotlin.kt | 2 +- .../snippets/create-my-credentials-kotlin.kt | 4 ++-- .../snippets/credentials-exist-kotlin.kt | 2 +- .../snippets/delete-my-credentials-kotlin.kt | 2 +- .../snippets/get-current-user-kotlin.kt | 2 +- .../snippets/get-my-credentials-kotlin.kt | 2 +- .../snippets/get-my-rights-kotlin.kt | 2 +- .../snippets/get-strategies-kotlin.kt | 2 +- .../auth/login/snippets/login-kotlin.kt | 2 +- .../auth/logout/snippets/logout-kotlin.kt | 2 +- .../snippets/refresh-token-kotlin.kt | 2 +- .../snippets/update-my-credentials-kotlin.kt | 2 +- .../update-self/snippets/update-self-kotlin.kt | 4 ++-- .../snippets/validate-my-credentials-kotlin.kt | 2 +- .../snippets/delete-by-query-kotlin.kt | 6 +++--- .../import-data/snippets/import-data-kotlin.kt | 18 +++++++++--------- .../bulk/m-write/snippets/mwrite-kotlin.kt | 2 +- .../bulk/write/snippets/write-kotlin.kt | 4 ++-- .../snippets/search-specifications-kotlin.kt | 6 +++--- .../snippets/update-specifications-kotlin.kt | 6 +++--- .../update/snippets/update-kotlin.kt | 8 ++++---- .../document/count/snippets/count-kotlin.kt | 4 ++-- .../snippets/create-or-replace-kotlin.kt | 2 +- .../document/create/snippets/create-kotlin.kt | 2 +- .../snippets/delete-by-query-kotlin.kt | 6 +++--- .../snippets/m-create-or-replace-kotlin.kt | 8 ++++---- .../m-create/snippets/m-create-kotlin.kt | 8 ++++---- .../m-replace/snippets/m-replace-kotlin.kt | 8 ++++---- .../m-update/snippets/m-update-kotlin.kt | 8 ++++---- .../replace/snippets/replace-kotlin.kt | 2 +- .../document/search/snippets/search-kotlin.kt | 6 +++--- .../snippets/update-by-query-kotlin.kt | 6 +++--- .../document/update/snippets/update-kotlin.kt | 2 +- .../validate/snippets/validate-kotlin.kt | 2 +- doc/1/controllers/realtime/subscribe/index.md | 2 +- .../next/snippets/fromsize-kotlin.kt | 6 +++--- .../next/snippets/scroll-kotlin.kt | 6 +++--- .../kotlin/snippets/document-kotlin.kt | 2 +- .../kotlin/snippets/realtime-kotlin.kt | 4 ++-- 39 files changed, 83 insertions(+), 83 deletions(-) diff --git a/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt b/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt index 459b5e11..5af8fbe6 100644 --- a/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt +++ b/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt @@ -1,4 +1,4 @@ -val response = kuzzle.authController.login("local", Map().apply { +val response = kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-kotlin.kt b/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-kotlin.kt index 7a0d7a9d..e6710ae4 100644 --- a/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-kotlin.kt @@ -1,9 +1,9 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() -kuzzle.authController.createMyCredentials("other", Map().apply { +kuzzle.authController.createMyCredentials("other", HashMap().apply { put("username", "foo2") put("password", "bar2") }).get() diff --git a/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-kotlin.kt b/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-kotlin.kt index a20879c9..b5d95c42 100644 --- a/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-kotlin.kt +++ b/doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-kotlin.kt b/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-kotlin.kt index 3e36cf17..c7bd0728 100644 --- a/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/get-current-user/snippets/get-current-user-kotlin.kt b/doc/1/controllers/auth/get-current-user/snippets/get-current-user-kotlin.kt index b8b8eaf8..f413425e 100644 --- a/doc/1/controllers/auth/get-current-user/snippets/get-current-user-kotlin.kt +++ b/doc/1/controllers/auth/get-current-user/snippets/get-current-user-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-kotlin.kt b/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-kotlin.kt index d3abcaee..4add2ee1 100644 --- a/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-kotlin.kt b/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-kotlin.kt index fd7adc31..0fad3d6a 100644 --- a/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-kotlin.kt +++ b/doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/get-strategies/snippets/get-strategies-kotlin.kt b/doc/1/controllers/auth/get-strategies/snippets/get-strategies-kotlin.kt index d9bded55..77faea88 100644 --- a/doc/1/controllers/auth/get-strategies/snippets/get-strategies-kotlin.kt +++ b/doc/1/controllers/auth/get-strategies/snippets/get-strategies-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/login/snippets/login-kotlin.kt b/doc/1/controllers/auth/login/snippets/login-kotlin.kt index 4d094b6d..8e7afc83 100644 --- a/doc/1/controllers/auth/login/snippets/login-kotlin.kt +++ b/doc/1/controllers/auth/login/snippets/login-kotlin.kt @@ -1,5 +1,5 @@ val result: Map = - kuzzle.authController.login("local", Map().apply { + kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() \ No newline at end of file diff --git a/doc/1/controllers/auth/logout/snippets/logout-kotlin.kt b/doc/1/controllers/auth/logout/snippets/logout-kotlin.kt index f5d6b8d2..2af26c91 100644 --- a/doc/1/controllers/auth/logout/snippets/logout-kotlin.kt +++ b/doc/1/controllers/auth/logout/snippets/logout-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/refresh-token/snippets/refresh-token-kotlin.kt b/doc/1/controllers/auth/refresh-token/snippets/refresh-token-kotlin.kt index 2a153783..beeeba57 100644 --- a/doc/1/controllers/auth/refresh-token/snippets/refresh-token-kotlin.kt +++ b/doc/1/controllers/auth/refresh-token/snippets/refresh-token-kotlin.kt @@ -1,4 +1,4 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() diff --git a/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-kotlin.kt b/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-kotlin.kt index 2f5435b3..45aa3b54 100644 --- a/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/update-my-credentials/snippets/update-my-credentials-kotlin.kt @@ -1,4 +1,4 @@ -val credentials = Map().apply { +val credentials = HashMap().apply { put("username", "foo") put("password", "bar") } diff --git a/doc/1/controllers/auth/update-self/snippets/update-self-kotlin.kt b/doc/1/controllers/auth/update-self/snippets/update-self-kotlin.kt index adf3a0ed..3938ba3a 100644 --- a/doc/1/controllers/auth/update-self/snippets/update-self-kotlin.kt +++ b/doc/1/controllers/auth/update-self/snippets/update-self-kotlin.kt @@ -1,9 +1,9 @@ -kuzzle.authController.login("local", Map().apply { +kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") }).get() val result: Map = - kuzzle.authController.updateSelf(Map().apply { + kuzzle.authController.updateSelf(HashMap().apply { put("age", 42) }).get(); diff --git a/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-kotlin.kt b/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-kotlin.kt index 36262b80..3082eb9e 100644 --- a/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-kotlin.kt +++ b/doc/1/controllers/auth/validate-my-credentials/snippets/validate-my-credentials-kotlin.kt @@ -1,4 +1,4 @@ -val credentials = Map().apply { +val credentials = HashMap().apply { put("username", "foo") put("password", "bar") } diff --git a/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-kotlin.kt b/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-kotlin.kt index 9808c725..3768bee9 100644 --- a/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-kotlin.kt +++ b/doc/1/controllers/bulk/delete-by-query/snippets/delete-by-query-kotlin.kt @@ -1,6 +1,6 @@ -val searchQuery: Map = Map().apply { - put("query", Map().apply { - put("term", Map().apply { +val searchQuery: Map = HashMap().apply { + put("query", HashMap().apply { + put("term", HashMap().apply { put("capacity", 7) }) }) diff --git a/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt b/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt index 947cf1aa..191fcf11 100644 --- a/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt +++ b/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt @@ -1,32 +1,32 @@ val bulkData: ArrayList> = ArrayList>().apply { - add(Map().apply { + add(HashMap().apply { put("index", Map()); }); - add(Map().apply { + add(HashMap().apply { put("a", "document"); put("with", "any"); put("number", "of fields"); }); - add(Map().apply { + add(HashMap().apply { put("create", - Map().apply { + HashMap().apply { put("_id", "uniq-id-1"); } ); }); - add(Map().apply { + add(HashMap().apply { put("another", "document"); }); - add(Map().apply { + add(HashMap().apply { put("create", - Map().apply { + HashMap().apply { put("_id", "uniq-id-2"); } ); }); - add(Map().apply { + add(HashMap().apply { put("and", - Map().apply { + HashMap().apply { put("another", "one"); } ); diff --git a/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt b/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt index 4ee6b54c..f52d86c5 100644 --- a/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt +++ b/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt @@ -1,5 +1,5 @@ val documents: ArrayList> = ArrayList>().apply { - add(Map().apply { + add(HashMap().apply { put("_id", "foo") put("body", Map()) }) diff --git a/doc/1/controllers/bulk/write/snippets/write-kotlin.kt b/doc/1/controllers/bulk/write/snippets/write-kotlin.kt index 95798480..a1de1d27 100644 --- a/doc/1/controllers/bulk/write/snippets/write-kotlin.kt +++ b/doc/1/controllers/bulk/write/snippets/write-kotlin.kt @@ -1,5 +1,5 @@ -val content: Map = Map().apply { - put("_kuzzle_info", Map().apply { +val content: Map = HashMap().apply { + put("_kuzzle_info", HashMap().apply { put("author", "") put("createdAd", "1481816934209") }); diff --git a/doc/1/controllers/collection/search-specifications/snippets/search-specifications-kotlin.kt b/doc/1/controllers/collection/search-specifications/snippets/search-specifications-kotlin.kt index a480c403..e652f7a6 100644 --- a/doc/1/controllers/collection/search-specifications/snippets/search-specifications-kotlin.kt +++ b/doc/1/controllers/collection/search-specifications/snippets/search-specifications-kotlin.kt @@ -1,10 +1,10 @@ -val args: Map = Map() +val args: Map = HashMap() val filters: Map = -Map().apply { +HashMap().apply { put("match_all", args) } val searchQuery: Map = -Map().apply { +HashMap().apply { put("query", filters) } diff --git a/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt b/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt index 7cc973cf..d01a9471 100644 --- a/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt +++ b/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt @@ -1,15 +1,15 @@ val license: Map = -Map().apply { +HashMap().apply { put("mandatory", true); put("type", "string"); }; val fields: Map = -Map().apply { +HashMap().apply { put("license", license); }; val specifications: Map = -Map().apply{ +HashMap().apply{ put("strict", false); put("fields", fields); }; diff --git a/doc/1/controllers/collection/update/snippets/update-kotlin.kt b/doc/1/controllers/collection/update/snippets/update-kotlin.kt index 3ed51abb..3ff321ef 100644 --- a/doc/1/controllers/collection/update/snippets/update-kotlin.kt +++ b/doc/1/controllers/collection/update/snippets/update-kotlin.kt @@ -1,20 +1,20 @@ val plate: Map = -Map().apply{ +HashMap().apply{ put("type", "keyword") } val _meta: Map = -Map().apply{ +HashMap().apply{ put("area", "Panipokhari") } val properties: Map = -Map().apply{ +HashMap().apply{ put("plate", plate) } val definition: Map = -Map().apply{ +HashMap().apply{ put("dynamic", false) put("_meta", _meta) put("properties", properties) diff --git a/doc/1/controllers/document/count/snippets/count-kotlin.kt b/doc/1/controllers/document/count/snippets/count-kotlin.kt index 8ef5e608..1901f0e4 100644 --- a/doc/1/controllers/document/count/snippets/count-kotlin.kt +++ b/doc/1/controllers/document/count/snippets/count-kotlin.kt @@ -1,6 +1,6 @@ val searchQuery : Map = - Map().apply { - put("match", Map().apply { + HashMap().apply { + put("match", HashMap().apply { put("Hello", "Clarisse") }) } diff --git a/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt b/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt index 99cd8ff6..9a62d847 100644 --- a/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt +++ b/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt @@ -1,4 +1,4 @@ -val document: Map = Map().apply { +val document: Map = HashMap().apply { put("firstname", "John") } diff --git a/doc/1/controllers/document/create/snippets/create-kotlin.kt b/doc/1/controllers/document/create/snippets/create-kotlin.kt index cd7ae51f..de6bb50a 100644 --- a/doc/1/controllers/document/create/snippets/create-kotlin.kt +++ b/doc/1/controllers/document/create/snippets/create-kotlin.kt @@ -1,4 +1,4 @@ -val document: Map = Map().apply { +val document: Map = HashMap().apply { put("firstname", "John") } diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt index 795972f5..c5249ef7 100644 --- a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt @@ -1,6 +1,6 @@ -val searchQuery: Map = Map().apply { - put("query", Map().apply { - put("match", Map().apply { +val searchQuery: Map = HashMap().apply { + put("query", HashMap().apply { + put("match", HashMap().apply { put("capacity", 4) }) }) diff --git a/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-kotlin.kt b/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-kotlin.kt index ad354610..cef64cc1 100644 --- a/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-kotlin.kt +++ b/doc/1/controllers/document/m-create-or-replace/snippets/m-create-or-replace-kotlin.kt @@ -1,15 +1,15 @@ val document1: Map = - Map().apply { + HashMap().apply { put("_id", "some-id") - put("body", Map().apply { + put("body", HashMap().apply { put("Agent", "Smith") }) } val document2: Map = - Map().apply { + HashMap().apply { put("_id", "some-id2") - put("body", Map().apply { + put("body", HashMap().apply { put("Gordon", "Freeman") }) } diff --git a/doc/1/controllers/document/m-create/snippets/m-create-kotlin.kt b/doc/1/controllers/document/m-create/snippets/m-create-kotlin.kt index ad354610..cef64cc1 100644 --- a/doc/1/controllers/document/m-create/snippets/m-create-kotlin.kt +++ b/doc/1/controllers/document/m-create/snippets/m-create-kotlin.kt @@ -1,15 +1,15 @@ val document1: Map = - Map().apply { + HashMap().apply { put("_id", "some-id") - put("body", Map().apply { + put("body", HashMap().apply { put("Agent", "Smith") }) } val document2: Map = - Map().apply { + HashMap().apply { put("_id", "some-id2") - put("body", Map().apply { + put("body", HashMap().apply { put("Gordon", "Freeman") }) } diff --git a/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt b/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt index b9aea0f7..c2df6eb4 100644 --- a/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt +++ b/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt @@ -1,15 +1,15 @@ val document1: Map = - Map().apply { + HashMap().apply { put("_id", "some-id") - put("body", Map().apply { + put("body", HashMap().apply { put("name", "Smith") }) } val document2: Map = - Map().apply { + HashMap().apply { put("_id", "some-id2") - put("body", Map().apply { + put("body", HashMap().apply { put("name", "Freeman") }) } diff --git a/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt b/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt index d1052c23..cbb8f918 100644 --- a/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt +++ b/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt @@ -1,15 +1,15 @@ val document1: Map = - Map().apply { + HashMap().apply { put("_id", "some-id") - put("body", Map().apply { + put("body", HashMap().apply { put("name", "Smith") }) } val document2: Map = - Map().apply { + HashMap().apply { put("_id", "some-id2") - put("body", Map().apply { + put("body", HashMap().apply { put("name", "Freeman") }) } diff --git a/doc/1/controllers/document/replace/snippets/replace-kotlin.kt b/doc/1/controllers/document/replace/snippets/replace-kotlin.kt index d640a411..5ec2b5e0 100644 --- a/doc/1/controllers/document/replace/snippets/replace-kotlin.kt +++ b/doc/1/controllers/document/replace/snippets/replace-kotlin.kt @@ -1,5 +1,5 @@ val document: Map = - Map().apply { + HashMap().apply { put("firstname", "John") } diff --git a/doc/1/controllers/document/search/snippets/search-kotlin.kt b/doc/1/controllers/document/search/snippets/search-kotlin.kt index 5b36464c..083cfc1e 100644 --- a/doc/1/controllers/document/search/snippets/search-kotlin.kt +++ b/doc/1/controllers/document/search/snippets/search-kotlin.kt @@ -1,14 +1,14 @@ val match: Map = - Map().apply { + HashMap().apply { put("category", "suv") } val query: Map = - Map().apply { + HashMap().apply { put("match", match) } val searchQuery: Map = - Map().apply { + HashMap().apply { put("query", query) } val results = kuzzle diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt b/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt index 194173e2..d93157f6 100644 --- a/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt @@ -1,15 +1,15 @@ val match: Map = - Map().apply { + HashMap().apply { put("capacity", 4) } val searchQuery: Map = - Map().apply { + HashMap().apply { put("match", match) } val changes: Map = - Map().apply { + HashMap().apply { put("capacity", 42) } diff --git a/doc/1/controllers/document/update/snippets/update-kotlin.kt b/doc/1/controllers/document/update/snippets/update-kotlin.kt index 8f1466b1..b05d9f0e 100644 --- a/doc/1/controllers/document/update/snippets/update-kotlin.kt +++ b/doc/1/controllers/document/update/snippets/update-kotlin.kt @@ -1,5 +1,5 @@ val document: Map = - Map().apply { + HashMap().apply { put("name", "Johny") } diff --git a/doc/1/controllers/document/validate/snippets/validate-kotlin.kt b/doc/1/controllers/document/validate/snippets/validate-kotlin.kt index 8247dc0c..412e1826 100644 --- a/doc/1/controllers/document/validate/snippets/validate-kotlin.kt +++ b/doc/1/controllers/document/validate/snippets/validate-kotlin.kt @@ -1,5 +1,5 @@ val document: Map = - Map().apply { + HashMap().apply { put("key", "value") } diff --git a/doc/1/controllers/realtime/subscribe/index.md b/doc/1/controllers/realtime/subscribe/index.md index 1ac8deb4..5cb4c0bd 100644 --- a/doc/1/controllers/realtime/subscribe/index.md +++ b/doc/1/controllers/realtime/subscribe/index.md @@ -104,7 +104,7 @@ fun subscribe( scope: String = "all", users: String = "all", subscribeToSelf: Boolean = true, - volatiles: Map = Map(), + volatiles: Map = HashMap(), handler: (Response) -> Unit): CompletableFuture ``` diff --git a/doc/1/core-classes/search-result/next/snippets/fromsize-kotlin.kt b/doc/1/core-classes/search-result/next/snippets/fromsize-kotlin.kt index 4a0efdc4..747683e2 100644 --- a/doc/1/core-classes/search-result/next/snippets/fromsize-kotlin.kt +++ b/doc/1/core-classes/search-result/next/snippets/fromsize-kotlin.kt @@ -1,15 +1,15 @@ val match: Map = -Map().apply { +HashMap().apply { put("category", "suv") } val query: Map = -Map().apply { +HashMap().apply { put("match", match) } val searchQuery: Map = -Map().apply { +HashMap().apply { put("query", query) } diff --git a/doc/1/core-classes/search-result/next/snippets/scroll-kotlin.kt b/doc/1/core-classes/search-result/next/snippets/scroll-kotlin.kt index 998fda65..6c421b16 100644 --- a/doc/1/core-classes/search-result/next/snippets/scroll-kotlin.kt +++ b/doc/1/core-classes/search-result/next/snippets/scroll-kotlin.kt @@ -1,14 +1,14 @@ val match: Map = -Map().apply { +HashMap().apply { put("category", "suv") } val query: Map = -Map().apply { +HashMap().apply { put("match", match) } val searchQuery: Map = -Map().apply { +HashMap().apply { put("query", query) } var result: SearchResult? = kuzzle diff --git a/doc/1/getting-started/kotlin/snippets/document-kotlin.kt b/doc/1/getting-started/kotlin/snippets/document-kotlin.kt index 6e3c8a77..52af7870 100644 --- a/doc/1/getting-started/kotlin/snippets/document-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/document-kotlin.kt @@ -16,7 +16,7 @@ fun main() { try { // New document content - val content: Map = Map().apply { + val content: Map = HashMap().apply { put("name", "John") put("birthday", "1995-11-27") put("license", "B") diff --git a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt index d08b9566..4cb63f1a 100644 --- a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt @@ -16,7 +16,7 @@ fun main() { try { // Subscribes to notifications for drivers having a "B" driver license. - val equals: Map = Map().apply { + val equals: Map = HashMap().apply { put("license", "B") } val filters: Map = Map().apply { @@ -48,7 +48,7 @@ fun main() { // Writes a new document. This triggers a notification // sent to our subscription. - val content: Map = Map().apply { + val content: Map = HashMap().apply { put("name", "John") put("birthday", "1995-11-27") put("license", "B") From c59b9bf50bb6378b60701aefae22ba3648bf8463 Mon Sep 17 00:00:00 2001 From: jenow Date: Thu, 4 Feb 2021 09:50:53 +0100 Subject: [PATCH 06/13] fix test --- .../controllers/bulk/import-data/snippets/import-data-kotlin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt b/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt index 191fcf11..536cb97d 100644 --- a/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt +++ b/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt @@ -1,6 +1,6 @@ val bulkData: ArrayList> = ArrayList>().apply { add(HashMap().apply { - put("index", Map()); + put("index", HashMap()); }); add(HashMap().apply { put("a", "document"); From 7e6cd7f8c59bc9797f44bb065a0e29c2c7f90fea Mon Sep 17 00:00:00 2001 From: jenow Date: Thu, 4 Feb 2021 13:02:05 +0100 Subject: [PATCH 07/13] fix test --- doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt | 2 +- doc/1/controllers/document/count/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt b/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt index f52d86c5..430a3663 100644 --- a/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt +++ b/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt @@ -1,7 +1,7 @@ val documents: ArrayList> = ArrayList>().apply { add(HashMap().apply { put("_id", "foo") - put("body", Map()) + put("body", HashMap()) }) }; diff --git a/doc/1/controllers/document/count/index.md b/doc/1/controllers/document/count/index.md index acc1dd16..f5bc5b91 100644 --- a/doc/1/controllers/document/count/index.md +++ b/doc/1/controllers/document/count/index.md @@ -56,7 +56,7 @@ Returns an Integer. fun count( index: String, collection: String, - searchQuery: Map = Map()): CompletableFuture + searchQuery: Map = HashMap()): CompletableFuture ``` | Argument | Type | Description | From 47fac51fe46a6a55ebfcb75566351c735702e180 Mon Sep 17 00:00:00 2001 From: jenow Date: Thu, 4 Feb 2021 14:21:04 +0100 Subject: [PATCH 08/13] fix test --- .../collection/create/snippets/create-kotlin.kt | 8 ++++---- .../snippets/validate-specifications-kotlin.kt | 6 +++--- doc/1/controllers/realtime/count/snippets/count-kotlin.kt | 2 +- .../realtime/publish/snippets/publish-kotlin.kt | 2 +- .../subscribe/snippets/document-notifications-kotlin.kt | 6 +++--- .../snippets/document-notifications-leave-scope-kotlin.kt | 6 +++--- .../realtime/unsubscribe/snippets/unsubscribe-kotlin.kt | 4 ++-- doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt | 2 +- doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/doc/1/controllers/collection/create/snippets/create-kotlin.kt b/doc/1/controllers/collection/create/snippets/create-kotlin.kt index 603b23d1..c754625d 100644 --- a/doc/1/controllers/collection/create/snippets/create-kotlin.kt +++ b/doc/1/controllers/collection/create/snippets/create-kotlin.kt @@ -1,13 +1,13 @@ -val type: Map = Map().apply { +val type: Map = HashMap().apply { put("type", "keyword") } -val license: Map = Map().apply { +val license: Map = HashMap().apply { put("license", type) } -val mappings: Map = Map().apply { +val mappings: Map = HashMap().apply { put("properties", license) } -val definition: Map = Map().apply { +val definition: Map = HashMap().apply { put("mappings", mappings) } kuzzle.collectionController.create( diff --git a/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt b/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt index 841abd68..8d55b1ee 100644 --- a/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt +++ b/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt @@ -1,11 +1,11 @@ -val license: Map = Map().apply { +val license: Map = HashMap().apply { put("type", "symbol") put("mandatory", true) } -val fields: Map = Map().apply { +val fields: Map = HashMap().apply { put("license", license) } -val specifications: Map = Map().apply { +val specifications: Map = HashMap().apply { put("strict", false) put("fields", fields) } diff --git a/doc/1/controllers/realtime/count/snippets/count-kotlin.kt b/doc/1/controllers/realtime/count/snippets/count-kotlin.kt index b173a6dd..97691ba8 100644 --- a/doc/1/controllers/realtime/count/snippets/count-kotlin.kt +++ b/doc/1/controllers/realtime/count/snippets/count-kotlin.kt @@ -1,4 +1,4 @@ -val filters: Map = Map().apply { +val filters: Map = HashMap().apply { put("exists", "name") } diff --git a/doc/1/controllers/realtime/publish/snippets/publish-kotlin.kt b/doc/1/controllers/realtime/publish/snippets/publish-kotlin.kt index 5ca5f0a0..593b2855 100644 --- a/doc/1/controllers/realtime/publish/snippets/publish-kotlin.kt +++ b/doc/1/controllers/realtime/publish/snippets/publish-kotlin.kt @@ -1,4 +1,4 @@ -val document: Map = Map().apply { +val document: Map = HashMap().apply { put("name", "nina-vkote") } diff --git a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-kotlin.kt b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-kotlin.kt index a7ddf1b6..48fc3886 100644 --- a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-kotlin.kt +++ b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-kotlin.kt @@ -1,4 +1,4 @@ -val filters: Map = Map().apply { +val filters: Map = HashMap().apply { put("exists", "name") } @@ -13,10 +13,10 @@ val roomId: String = kuzzle.realtimeController.subscribe( } }.get() -val document: Map = Map().apply { +val document: Map = HashMap().apply { put("name", "nina-vkote") } -val query: Map = Map().apply { +val query: Map = HashMap().apply { put("controller", "document"); put("action", "create"); put("index", "nyc-open-data"); diff --git a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt index 832b8d44..1920b411 100644 --- a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt +++ b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt @@ -1,4 +1,4 @@ -val filters: Map = Map().apply { +val filters: Map = HashMap().apply { put("range", Map().apply { put("age", Map().apply { put("lte", 20) @@ -17,10 +17,10 @@ val roomId: String = kuzzle.realtimeController.subscribe( } }.get() -val document: Map = Map().apply { +val document: Map = HashMap().apply { put("age", 19) } -val query: Map = Map().apply { +val query: Map = HashMap().apply { put("controller", "document"); put("action", "create"); put("index", "nyc-open-data"); diff --git a/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-kotlin.kt b/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-kotlin.kt index 13db81b0..71cbf1f3 100644 --- a/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-kotlin.kt +++ b/doc/1/controllers/realtime/unsubscribe/snippets/unsubscribe-kotlin.kt @@ -1,4 +1,4 @@ -val filters: Map = Map().apply { +val filters: Map = HashMap().apply { put("exists", "name") } @@ -13,7 +13,7 @@ val roomId: String = kuzzle.realtimeController.subscribe( } }.get() -val document: Map = Map().apply { +val document: Map = HashMap().apply { put("name", "nina-vkote") } diff --git a/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt b/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt index 87782df8..f05bc348 100644 --- a/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt +++ b/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt @@ -1,4 +1,4 @@ -val query: Map = Map().apply { +val query: Map = HashMap().apply { put("controller", "document") put("action", "create") put("index", "nyc-open-data") diff --git a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt index 4cb63f1a..c3cdc569 100644 --- a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt @@ -19,7 +19,7 @@ fun main() { val equals: Map = HashMap().apply { put("license", "B") } - val filters: Map = Map().apply { + val filters: Map = HashMap().apply { put("equals", equals) } From d79d781bdee7f8c9a9fda01dcd5b053507d7a80e Mon Sep 17 00:00:00 2001 From: jenow Date: Thu, 4 Feb 2021 14:54:56 +0100 Subject: [PATCH 09/13] fix test --- .../snippets/document-notifications-leave-scope-kotlin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt index 1920b411..009d0cbb 100644 --- a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt +++ b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt @@ -1,6 +1,6 @@ val filters: Map = HashMap().apply { - put("range", Map().apply { - put("age", Map().apply { + put("range",= HashMap<{ + put("age",= HashMap<{ put("lte", 20) }) }) From fc872cce00459ea4155560ae313988fd052b10f8 Mon Sep 17 00:00:00 2001 From: jenow Date: Thu, 4 Feb 2021 15:16:10 +0100 Subject: [PATCH 10/13] fix test --- .../snippets/document-notifications-leave-scope-kotlin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt index 009d0cbb..7db0eeae 100644 --- a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt +++ b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt @@ -1,6 +1,6 @@ val filters: Map = HashMap().apply { - put("range",= HashMap<{ - put("age",= HashMap<{ + put("range", HashMap().apply{ + put("age", HashMap().apply{ put("lte", 20) }) }) From dfd18237079bb5b35b0911cb1c4cb486613b3e4f Mon Sep 17 00:00:00 2001 From: jenow Date: Thu, 4 Feb 2021 16:28:53 +0100 Subject: [PATCH 11/13] fix test --- .../snippets/document-notifications-leave-scope-kotlin.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt index 7db0eeae..1db41241 100644 --- a/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt +++ b/doc/1/controllers/realtime/subscribe/snippets/document-notifications-leave-scope-kotlin.kt @@ -1,6 +1,6 @@ val filters: Map = HashMap().apply { - put("range", HashMap().apply{ - put("age", HashMap().apply{ + put("range", HashMap().apply { + put("age", HashMap().apply { put("lte", 20) }) }) @@ -17,10 +17,10 @@ val roomId: String = kuzzle.realtimeController.subscribe( } }.get() -val document: Map = HashMap().apply { +val document = HashMap().apply { put("age", 19) } -val query: Map = HashMap().apply { +val query = HashMap().apply { put("controller", "document"); put("action", "create"); put("index", "nyc-open-data"); From 990257aadcc19f47b44fdf34cb85f7b244493afb Mon Sep 17 00:00:00 2001 From: jenow Date: Thu, 4 Feb 2021 16:55:09 +0100 Subject: [PATCH 12/13] fix test --- doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt b/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt index f05bc348..7fe42c8c 100644 --- a/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt +++ b/doc/1/core-classes/kuzzle/query/snippets/query-kotlin.kt @@ -5,7 +5,7 @@ val query: Map = HashMap().apply { put("collection", "yellow-taxi") put("_id", "my-custom-document-id") put("refresh", "wait_for") - put("body", Map().apply { + put("body", HashMap().apply { put("trip_distance", 4.23) put("passenger_count", 2) }) From f7270f4240405c614157e1608b0616c1ac1b432d Mon Sep 17 00:00:00 2001 From: jenow Date: Thu, 4 Feb 2021 18:13:16 +0100 Subject: [PATCH 13/13] fix test --- doc/1/getting-started/java/snippets/document-java.java | 1 + doc/1/getting-started/java/snippets/firstconnection-java.java | 1 + doc/1/getting-started/java/snippets/realtime-java.java | 1 + 3 files changed, 3 insertions(+) diff --git a/doc/1/getting-started/java/snippets/document-java.java b/doc/1/getting-started/java/snippets/document-java.java index ccb98965..c69a12d3 100644 --- a/doc/1/getting-started/java/snippets/document-java.java +++ b/doc/1/getting-started/java/snippets/document-java.java @@ -1,5 +1,6 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; +import java.util.*; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/doc/1/getting-started/java/snippets/firstconnection-java.java b/doc/1/getting-started/java/snippets/firstconnection-java.java index fe79392a..4eb47c83 100644 --- a/doc/1/getting-started/java/snippets/firstconnection-java.java +++ b/doc/1/getting-started/java/snippets/firstconnection-java.java @@ -1,5 +1,6 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; +import java.util.*; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/doc/1/getting-started/java/snippets/realtime-java.java b/doc/1/getting-started/java/snippets/realtime-java.java index 8d80dd4f..275e3ad7 100644 --- a/doc/1/getting-started/java/snippets/realtime-java.java +++ b/doc/1/getting-started/java/snippets/realtime-java.java @@ -1,5 +1,6 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; +import java.util.*; public class SnippetTest { private static Kuzzle kuzzle;