olp-cpp-sdk  1.22.0
Public Types | Public Member Functions | List of all members
olp::dataservice::write::StreamLayerClient Class Reference

Publishes data to a stream layer. More...

#include <StreamLayerClient.h>

Public Types

using FlushResponse = std::vector< PublishDataResponse >
 An alias for the flush response.
 
using FlushCallback = std::function< void(FlushResponse response)>
 An alias for the flush callback.
 

Public Member Functions

 StreamLayerClient (client::HRN catalog, StreamLayerClientSettings client_settings, client::OlpClientSettings settings)
 Creates the StreamLayerClient insatnce. More...
 
void CancelPendingRequests ()
 Cancels all the ongoing publish operations that this client started. More...
 
olp::client::CancellableFuture< PublishDataResponsePublishData (model::PublishDataRequest request)
 Publishes data to the stream layer. More...
 
olp::client::CancellationToken PublishData (model::PublishDataRequest request, PublishDataCallback callback)
 Publishes data to the stream layer. More...
 
boost::optional< std::string > Queue (model::PublishDataRequest request)
 Enqueues PublishDataRequest that is sent over the wire. More...
 
olp::client::CancellableFuture< FlushResponseFlush (model::FlushRequest request)
 Flushes PublishDataRequests that are queued via the Queue API. More...
 
olp::client::CancellationToken Flush (model::FlushRequest request, FlushCallback callback)
 Flushes PublishDataRequests that are queued via the Queue API. More...
 
olp::client::CancellableFuture< PublishSdiiResponsePublishSdii (model::PublishSdiiRequest request)
 Sends a list of SDII messages to a stream layer. More...
 
olp::client::CancellationToken PublishSdii (model::PublishSdiiRequest request, PublishSdiiCallback callback)
 Sends a list of SDII messages to a stream layer. More...
 

Detailed Description

Publishes data to a stream layer.

Constructor & Destructor Documentation

◆ StreamLayerClient()

olp::dataservice::write::StreamLayerClient::StreamLayerClient ( client::HRN  catalog,
StreamLayerClientSettings  client_settings,
client::OlpClientSettings  settings 
)

Creates the StreamLayerClient insatnce.

Parameters
catalogThe HRN of the catalog to which this client writes.
client_settingsThe StreamLayerClient settings used to control the behavior of the flush mechanism and other StreamLayerClient properties.
settingsThe client settings used to control the behavior of the client instance.

Member Function Documentation

◆ CancelPendingRequests()

void olp::dataservice::write::StreamLayerClient::CancelPendingRequests ( )

Cancels all the ongoing publish operations that this client started.

Returns instantly and does not wait for callbacks. Use this operation to cancel all the pending publish requests without destroying the actual client instance.

Note
This operation does not cancel publish requests queued by the Queue method.

◆ Flush() [1/2]

olp::client::CancellableFuture<FlushResponse> olp::dataservice::write::StreamLayerClient::Flush ( model::FlushRequest  request)

Flushes PublishDataRequests that are queued via the Queue API.

Parameters
requestThe FlushRequest object.
Returns
CancellableFuture that contains FlushResponse.

◆ Flush() [2/2]

olp::client::CancellationToken olp::dataservice::write::StreamLayerClient::Flush ( model::FlushRequest  request,
FlushCallback  callback 
)

Flushes PublishDataRequests that are queued via the Queue API.

Parameters
requestThe FlushRequest object.
callbackThe callback that is called when all the flush results (see FlushResponse) are available.
Returns
CancellationToken that can be used to cancel the ongoing request.

◆ PublishData() [1/2]

olp::client::CancellableFuture<PublishDataResponse> olp::dataservice::write::StreamLayerClient::PublishData ( model::PublishDataRequest  request)

Publishes data to the stream layer.

Note
The content-type for this request is set implicitly based on the layer metadata of the target layer.
Parameters
requestThe PublishDataRequest object.
Returns
CancellableFuture that contains PublishDataResponse.

◆ PublishData() [2/2]

olp::client::CancellationToken olp::dataservice::write::StreamLayerClient::PublishData ( model::PublishDataRequest  request,
PublishDataCallback  callback 
)

Publishes data to the stream layer.

Note
The content-type for this request is set implicitly based on the layer metadata of the target layer.
Parameters
requestThe PublishDataRequest object.
callbackPublishDataCallback that is called with PublishDataResponse when the operation completes.
Returns
CancellationToken that can be used to cancel the ongoing request.

◆ PublishSdii() [1/2]

olp::client::CancellableFuture<PublishSdiiResponse> olp::dataservice::write::StreamLayerClient::PublishSdii ( model::PublishSdiiRequest  request)

Sends a list of SDII messages to a stream layer.

SDII message data must be in the SDII Message List protobuf format. The maximum size is 20 MB. For more information, see the HERE platform Sensor Data Ingestion Interface documentation and schemas.

Parameters
requestThe PublishSdiiRequest object.
Returns
CancellableFuture that contains PublishSdiiResponse.

◆ PublishSdii() [2/2]

olp::client::CancellationToken olp::dataservice::write::StreamLayerClient::PublishSdii ( model::PublishSdiiRequest  request,
PublishSdiiCallback  callback 
)

Sends a list of SDII messages to a stream layer.

SDII message data must be in the SDII Message List protobuf format. The maximum size is 20 MB. For more information, see the HERE platform Sensor Data Ingestion Interface documentation and schemas.

Parameters
requestPublishSdiiRequest object.
callbackPublishSdiiCallback that is called with PublishSdiiResponse when the operation completes.
Returns
CancellationToken that can be used to cancel the ongoing request.

◆ Queue()

boost::optional<std::string> olp::dataservice::write::StreamLayerClient::Queue ( model::PublishDataRequest  request)

Enqueues PublishDataRequest that is sent over the wire.

Parameters
requestThe PublishDataRequest object.
Returns
An optional boost that is boost::none if the queue call is successful. Otherwise, it contains a string with error details.

The documentation for this class was generated from the following file: