olp-cpp-sdk  1.22.0
Public Member Functions | List of all members
olp::dataservice::read::CatalogClient Class Referencefinal

Provides a high-level interface to access data hosted on OLP using the Data API. More...

#include <CatalogClient.h>

Public Member Functions

 CatalogClient (client::HRN catalog, client::OlpClientSettings settings)
 Creates the CatalogClient instance. More...
 
 CatalogClient (const CatalogClient &other)=delete
 A copy constructor.
 
 CatalogClient (CatalogClient &&other) noexcept
 A default move constructor.
 
CatalogClientoperator= (const CatalogClient &other)=delete
 
CatalogClientoperator= (CatalogClient &&other) noexcept
 A copy assignment operator.
 
bool CancelPendingRequests ()
 Cancels the currently active requests. More...
 
client::CancellationToken GetCatalog (CatalogRequest request, CatalogResponseCallback callback)
 Gets the catalog configuration asynchronously. More...
 
client::CancellableFuture< CatalogResponseGetCatalog (CatalogRequest request)
 Gets the catalog configuration asynchronously. More...
 
client::CancellationToken GetLatestVersion (CatalogVersionRequest request, CatalogVersionCallback callback)
 Gets the catalog version asynchronously. More...
 
client::CancellableFuture< CatalogVersionResponseGetLatestVersion (CatalogVersionRequest request)
 Gets the catalog version asynchronously. More...
 
client::CancellationToken ListVersions (VersionsRequest request, VersionsResponseCallback callback)
 Gets the catalog versions list. More...
 
client::CancellableFuture< VersionsResponseListVersions (VersionsRequest request)
 Gets the catalog versions list. More...
 
client::CancellationToken GetCompatibleVersions (CompatibleVersionsRequest request, CompatibleVersionsCallback callback)
 Gets the list of the current catalog versions that are compatible with the dependencies provided by the request. More...
 
client::CancellableFuture< CompatibleVersionsResponseGetCompatibleVersions (CompatibleVersionsRequest request)
 Gets the list of the current catalog versions that are compatible with the dependencies provided by the request. More...
 

Detailed Description

Provides a high-level interface to access data hosted on OLP using the Data API.

The behavior of the CatalogClient object can be defined via OlpClientSettings.

You can overwrite the default implementation for the following items:

Constructor & Destructor Documentation

◆ CatalogClient()

olp::dataservice::read::CatalogClient::CatalogClient ( client::HRN  catalog,
client::OlpClientSettings  settings 
)

Creates the CatalogClient instance.

Parameters
catalogThe HERE Resource Name (HRN) of the OLP catalog.
settingsThe desired configuration of the CatalogClient instance.

Member Function Documentation

◆ CancelPendingRequests()

bool olp::dataservice::read::CatalogClient::CancelPendingRequests ( )

Cancels the currently active requests.

Returns
True on success.

◆ GetCatalog() [1/2]

client::CancellableFuture<CatalogResponse> olp::dataservice::read::CatalogClient::GetCatalog ( CatalogRequest  request)

Gets the catalog configuration asynchronously.

Parameters
requestThe CatalogRequest instance that contains a complete set of request parameters.
Returns
CancellableFuture that contains the CatalogResponse instance with the catalog configuration or an error. You can also use CancellableFuture to cancel this request.

◆ GetCatalog() [2/2]

client::CancellationToken olp::dataservice::read::CatalogClient::GetCatalog ( CatalogRequest  request,
CatalogResponseCallback  callback 
)

Gets the catalog configuration asynchronously.

Parameters
requestThe CatalogRequest instance that contains a complete set of request parameters.
callbackThe CatalogResponseCallback object that is invoked if the catalog configuration is available or an error is encountered.
Returns
A token that can be used to cancel this request.

◆ GetCompatibleVersions() [1/2]

client::CancellableFuture<CompatibleVersionsResponse> olp::dataservice::read::CatalogClient::GetCompatibleVersions ( CompatibleVersionsRequest  request)

Gets the list of the current catalog versions that are compatible with the dependencies provided by the request.

Note
This request is online only. It does not support multiple pages and returns only the first page.
Parameters
requestThe CompatibleVersionsRequest instance that contains a complete set of the request parameters.
Returns
CancellableFuture that contains the VersionsResponse instance with the list of versions or an error. You can also use CancellableFuture to cancel this request.

◆ GetCompatibleVersions() [2/2]

client::CancellationToken olp::dataservice::read::CatalogClient::GetCompatibleVersions ( CompatibleVersionsRequest  request,
CompatibleVersionsCallback  callback 
)

Gets the list of the current catalog versions that are compatible with the dependencies provided by the request.

Note
This request is online only. It does not support multiple pages and returns only the first page.
Parameters
requestThe CompatibleVersionsRequest instance that contains a complete set of the request parameters.
callbackThe CompatibleVersionsCallback object that is invoked if the compatible versions are available or an error occurred.
Returns
A token that can be used to cancel this request.

◆ GetLatestVersion() [1/2]

client::CancellableFuture<CatalogVersionResponse> olp::dataservice::read::CatalogClient::GetLatestVersion ( CatalogVersionRequest  request)

Gets the catalog version asynchronously.

Note
In case you call this API with FetchOptions::CacheOnly and a valid version in CatalogVersionRequest::WithStartVersion(), i.e. >= 0, then please make sure that the provided version is a existing catalog version as it will be written for later use to the cache as latest version in the following cases:
  • There is no latest version yet written to cache.
  • The latest version written to cache is less then the provided version.
Parameters
requestThe CatalogVersionRequest instance that contains a complete set of request parameters.
Returns
CancellableFuture that contains the CatalogVersionResponse instance with the catalog configuration or an error. You can also use CancellableFuture to cancel this request.

◆ GetLatestVersion() [2/2]

client::CancellationToken olp::dataservice::read::CatalogClient::GetLatestVersion ( CatalogVersionRequest  request,
CatalogVersionCallback  callback 
)

Gets the catalog version asynchronously.

Note
In case you call this API with FetchOptions::CacheOnly and a valid version in CatalogVersionRequest::WithStartVersion(), i.e. >= 0, then please make sure that the provided version is a existing catalog version as it will be written for later use to the cache as latest version in the following cases:
  • There is no latest version yet written to cache.
  • The latest version written to cache is less then the provided version.
Parameters
requestThe CatalogVersionRequest instance that contains a complete set of request parameters.
callbackThe CatalogVersionCallback object that is invoked if the catalog version is available or an error is encountered.
Returns
A token that can be used to cancel this request.

◆ ListVersions() [1/2]

client::CancellableFuture<VersionsResponse> olp::dataservice::read::CatalogClient::ListVersions ( VersionsRequest  request)

Gets the catalog versions list.

Note
Request of catalog versions list works only online.
Parameters
requestThe VersionsRequest instance that contains a complete set of request parameters.
Returns
CancellableFuturethat contains theVersionsResponse` instance with the list of versions or an error. You can also use CancellableFuture to cancel this request.

◆ ListVersions() [2/2]

client::CancellationToken olp::dataservice::read::CatalogClient::ListVersions ( VersionsRequest  request,
VersionsResponseCallback  callback 
)

Gets the catalog versions list.

Note
Request of catalog versions list works only online.
Parameters
requestThe VersionsRequest instance that contains a complete set of request parameters.
callbackThe VersionsResponseCallback object that is invoked if the list of versions is available or an error is encountered.
Returns
A token that can be used to cancel this request.

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