Documentation

CloudDataSource extends AbstractDataSource
in package
Uses UtilsProvider

Load templates from cloud API, but not every time when consumer should be invalidated. In case of e.g. recalculations of middlewares, load the `before_middleware` value from database instead of API fetch.

Table of Contents

Constants

OPTION_NAME_LATEST_RESPONSE_RELEASE_INFO_PREFIX  = RCB_OPT_PREFIX . '-cloud-data-source-release-info-'
PER_PAGE  = 100
RETRY_IN_SECONDS_WHEN_ASYNC_RESPONSE  = 3
RETRY_IN_SECONDS_WHEN_DOWNLOAD_FAILED  = 60 * 5
VARIABLE_NAME_FAILED_DOWNLOAD_RETRY_IN  = 'CloudDataSource.failedDownloadRetryIn'

Properties

$consumer  : mixed
$data  : mixed
$latestResponseMetadata  : mixed

Methods

__construct()  : mixed
C'tor.
allowAsyncCacheCalculation()  : mixed
Allow async cache calculation in cloud backend only when we already have templates.
clearData()  : mixed
Clear all available data.
getConsumer()  : mixed
Getter.
getData()  : mixed
Getter.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
retrieve()  : array<string|int, AbstractTemplate>
Retrieve all templates from data source (e.g. request to service cloud).
setData()  : mixed
Set data which could be reused by middlewares.
shouldFetchFromApi()  : mixed
Check if this data source should read from database or external cloud API.
getApiLanguage()  : mixed
Get the language which is requested by the cloud API.
getLicense()  : mixed
Get current license.
getStorageHelper()  : StorageHelper
Getter.
loadFromApi()  : mixed
Load all templates from service cloud.
loadFromDatabase()  : mixed
Load `before_middleware` from database instead of API request.

Constants

OPTION_NAME_LATEST_RESPONSE_RELEASE_INFO_PREFIX

public mixed OPTION_NAME_LATEST_RESPONSE_RELEASE_INFO_PREFIX = RCB_OPT_PREFIX . '-cloud-data-source-release-info-'

RETRY_IN_SECONDS_WHEN_ASYNC_RESPONSE

public mixed RETRY_IN_SECONDS_WHEN_ASYNC_RESPONSE = 3

RETRY_IN_SECONDS_WHEN_DOWNLOAD_FAILED

public mixed RETRY_IN_SECONDS_WHEN_DOWNLOAD_FAILED = 60 * 5

VARIABLE_NAME_FAILED_DOWNLOAD_RETRY_IN

public mixed VARIABLE_NAME_FAILED_DOWNLOAD_RETRY_IN = 'CloudDataSource.failedDownloadRetryIn'

Properties

Methods

allowAsyncCacheCalculation()

Allow async cache calculation in cloud backend only when we already have templates.

public allowAsyncCacheCalculation() : mixed

This method returns true, when at least one cloud template is already in our database.

clearData()

Clear all available data.

public clearData() : mixed
Tags
codeCoverageIgnore

getData()

Getter.

public getData(string $key) : mixed
Parameters
$key : string
Tags
codeCoverageIgnore

getPluginConstantPrefix()

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

public getPluginConstantPrefix() : string
Tags
codeCoverageIgnore

It only returns a string with the constant prefix

Return values
string

setData()

Set data which could be reused by middlewares.

public setData(string $key, mixed $value) : mixed
Parameters
$key : string
$value : mixed
Tags
codeCoverageIgnore

shouldFetchFromApi()

Check if this data source should read from database or external cloud API.

public shouldFetchFromApi() : mixed

getApiLanguage()

Get the language which is requested by the cloud API.

protected getApiLanguage() : mixed

loadFromDatabase()

Load `before_middleware` from database instead of API request.

protected loadFromDatabase() : mixed

        
On this page

Search results