Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

SDK new architecture w/ WebSocket#40

Merged
Aschen merged 52 commits into
3-devfrom
KZL-1346/sdk-v3-websocket
Jan 8, 2020
Merged

SDK new architecture w/ WebSocket#40
Aschen merged 52 commits into
3-devfrom
KZL-1346/sdk-v3-websocket

Conversation

@Shiranuit
Copy link
Copy Markdown
Contributor

@Shiranuit Shiranuit commented Aug 26, 2019

⚠️ Depends on [#39]

What does this PR do ?

This PR adds the Kuzzle and WebSocket class plus :

  • AbstractProtocol class (Used to create new protocols)
  • EventListener class (Used to handle events)
  • Task class (Used to create a new CompletableFuture to handle response of queries)
  • Response class (Used as a structure)
  • KuzzleOptions and WebSocketOptions class

How should this be manually tested?

Run cd kuzzle-sdk-java && ./gradlew test

@Shiranuit Shiranuit self-assigned this Aug 26, 2019
@Shiranuit Shiranuit changed the base branch from master to sdk-java-cleanup August 26, 2019 15:17
@Shiranuit Shiranuit added wip and removed wip labels Aug 26, 2019
@Shiranuit Shiranuit changed the base branch from sdk-java-cleanup to 3-dev August 29, 2019 15:00
@Shiranuit Shiranuit added wip and removed wip labels Aug 29, 2019
ycombes added 2 commits September 11, 2019 10:14
(cherry picked from commit c6248f3)
(cherry picked from commit 51f8592)
@Shiranuit Shiranuit added the wip label Sep 13, 2019
}

Task<Response> task = requests.get(
notNull(response.requestId, ""));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kuzzle always set the requestId, I think that a payload that does not contain this property should be rejected in some way by the Response object.
(So you won't need the notNull method)

Shiranuit and others added 5 commits December 2, 2019 07:56
This PR adds the unit tests for Kuzzle and WebSocket.

Run cd kuzzle-sdk-java && ./gradlew test
…ket-unit-tests

Revert "SDK V3 WebSocket Unit Tests"
…-v3-websocket-unit-tests

Revert "Revert "SDK V3 WebSocket Unit Tests""
* @param <T> Object class.
* @return The object or the specified default value in case the object is null.
*/
public static <T> T notNull(T obj, T defaultValue) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpicking: I don't agree with this naming.
To me, notNull sounds more like an assertion that throws if the argument is null. I'd prefer something like default, which mimics the _.default() from lodash. This is surely because I come from the web/JS domain...

@@ -0,0 +1,8 @@
package io.kuzzle.sdk.CoreClasses.Maps;

public class Null {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤔
what is this for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nothing except the fact that we need an object that represent a null value without being null, because ConcurrentHashMap can't have null value associated to a key

@Shiranuit Shiranuit requested review from Aschen and xbill82 December 11, 2019 14:54
Copy link
Copy Markdown
Contributor

@scottinet scottinet left a comment

Choose a reason for hiding this comment

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

👍

@Aschen Aschen merged commit 41bc738 into 3-dev Jan 8, 2020
@Aschen Aschen deleted the KZL-1346/sdk-v3-websocket branch January 8, 2020 12:39
@jenow jenow mentioned this pull request May 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants