Skip to content

[API]: Unify Send API #92

@harlem88

Description

@harlem88

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 :

public interface AstarteAggregateDataStreamer {
  void send(String path, Map<String, Object> payload)
      throws AstarteTransportException, AstarteInvalidValueException,
          AstarteInterfaceMappingNotFoundException;

  void send(String path, Map<String, Object> 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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIThis issue or pull request is about API (e.g. unclear API, new API, API change, deprecation)breakingThis issue will most likely require breaking changes to the API.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions