astarte-platform / astarte-platform/astarte-device-sdk-java

[API]: Unify Send API

Open
#92 0 comments 0 reactions 0 assignees View on GitHub
API breaking
Dominant language
Java
Stars
3
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Currently each Astarte Device SDKs has a different name for the function that allows publishing data to an Astarte instance.

We want to unify the Send API across all SDKs to avoid confusion for the end user, who may use different SDKs for various use cases and could become disoriented.

All SDKs will implement the unified API for publishing data to an Astarte instance.

The API for publishing a property value already follows the `unified` API, we have to change only the datastream api:

Currently for both datastream interface (individual, object ) we use the `streamData` method, in the new API we moved to `send` :

```java
public interface AstarteAggregateDataStreamer {
void send(String path, Map payload)
throws AstarteTransportException, AstarteInvalidValueException,
AstarteInterfaceMappingNotFoundException;

void send(String path, Map payload, DateTime timestamp)
throws AstarteTransportException, AstarteInvalidValueException,
AstarteInterfaceMappingNotFoundException;
}

...

public interface AstarteDataStreamer {
void send(String path, Object payload)
throws AstarteTransportException, AstarteInvalidValueException,
AstarteInterfaceMappingNotFoundException;

void send(String path, Object payload, DateTime timestamp)
throws AstarteTransportException, AstarteInvalidValueException,
AstarteInterfaceMappingNotFoundException;
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Search the Java SDK for the existing streamData method and trace its datastream interfaces, implementations, callers, and tests. Rename the datastream publishing API to send with the overloads shown in the issue, update references, and verify that the SDK builds and its tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.