olp-cpp-sdk
1.22.0
|
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< PublishDataResponse > | PublishData (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< FlushResponse > | Flush (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< PublishSdiiResponse > | PublishSdii (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... | |
Publishes data to a stream layer.
olp::dataservice::write::StreamLayerClient::StreamLayerClient | ( | client::HRN | catalog, |
StreamLayerClientSettings | client_settings, | ||
client::OlpClientSettings | settings | ||
) |
Creates the StreamLayerClient
insatnce.
catalog | The HRN of the catalog to which this client writes. |
client_settings | The StreamLayerClient settings used to control the behavior of the flush mechanism and other StreamLayerClient properties. |
settings | The client settings used to control the behavior of the client instance. |
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.
Queue
method. olp::client::CancellableFuture<FlushResponse> olp::dataservice::write::StreamLayerClient::Flush | ( | model::FlushRequest | request | ) |
Flushes PublishDataRequests
that are queued via the Queue API.
request | The FlushRequest object. |
CancellableFuture
that contains FlushResponse
. olp::client::CancellationToken olp::dataservice::write::StreamLayerClient::Flush | ( | model::FlushRequest | request, |
FlushCallback | callback | ||
) |
Flushes PublishDataRequests
that are queued via the Queue API.
request | The FlushRequest object. |
callback | The callback that is called when all the flush results (see FlushResponse ) are available. |
CancellationToken
that can be used to cancel the ongoing request. olp::client::CancellableFuture<PublishDataResponse> olp::dataservice::write::StreamLayerClient::PublishData | ( | model::PublishDataRequest | request | ) |
Publishes data to the stream layer.
request | The PublishDataRequest object. |
CancellableFuture
that contains PublishDataResponse
. olp::client::CancellationToken olp::dataservice::write::StreamLayerClient::PublishData | ( | model::PublishDataRequest | request, |
PublishDataCallback | callback | ||
) |
Publishes data to the stream layer.
request | The PublishDataRequest object. |
callback | PublishDataCallback that is called with PublishDataResponse when the operation completes. |
CancellationToken
that can be used to cancel the ongoing request. 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.
request | The PublishSdiiRequest object. |
CancellableFuture
that contains PublishSdiiResponse
. 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.
request | PublishSdiiRequest object. |
callback | PublishSdiiCallback that is called with PublishSdiiResponse when the operation completes. |
CancellationToken
that can be used to cancel the ongoing request. boost::optional<std::string> olp::dataservice::write::StreamLayerClient::Queue | ( | model::PublishDataRequest | request | ) |
Enqueues PublishDataRequest
that is sent over the wire.
request | The PublishDataRequest object. |
boost::none
if the queue call is successful. Otherwise, it contains a string with error details.