\r\n

51Degrees Pipeline PHP  4.4

51Degrees Pipeline for PHP

fiftyone\pipeline\cloudrequestengine\CloudRequestEngine Class Reference

Inheritance diagram for fiftyone\pipeline\cloudrequestengine\CloudRequestEngine:

[legend]

Collaboration diagram for fiftyone\pipeline\cloudrequestengine\CloudRequestEngine:

[legend]

Public Member Functions

 __construct (array $settings)
Settings should contain a resourceKey and optionally: 1) a cloudEndPoint to overwrite the default baseurl 2) a cloudRequestOrigin to use when sending requests to cloud. More...
 getEvidenceKeyFilter ()
Instance of EvidenceKeyFilter based on the evidence keys fetched from the cloud service by the private getEvidenceKeys() method.
 processInternal (FlowData $flowData)
Processing function for the CloudRequestEngine Makes a request to the cloud service with the supplied resource key and evidence and returns a JSON object that is then parsed by cloud engines placed later in the pipeline.
 getContent (FlowData $flowData)
Generate the Content to send in the POST request. More...
 addQueryData (array $queryData, array $allEvidence, array $evidence)
Add query data to the evidence. More...
 getSelectedEvidence (array $evidence, string $type)
Get evidence with specified prefix. More...
 keyHasPrefix (string $itemKey, string $prefix)
Check that the key of a KeyValuePair has the given prefix. More...

Public Member Functions inherited from fiftyone\pipeline\engines\Engine

 getDataSourceTier ()
Get the tier to which the current data source belongs. More...
 setCache (DataKeyedCache $cache)
Add a cache to an engine. More...
 setRestrictedProperties (array $propertiesList)
Add a subset of properties. More...
 inCache (FlowData $flowData)
A method to check if a flowData's evidence is in the cache. More...
 process (FlowData $flowData)
Engine's core process function. More...

Public Member Functions inherited from fiftyone\pipeline\core\FlowElement

 __construct ()
A default dummy constructor is needed for there are classes inheriting this class deeper than 1-level of inheritance and calling parent::__construct() in their explicit constructors. More...
 process (FlowData $flowData)
General wrapper function that calls a FlowElement's processInternal method.
 getEvidenceKeyFilter ()
Function for getting the FlowElement's EvidenceKeyFilter Used by the filterEvidence method.
 filterEvidence (FlowData $flowData)
Filter FlowData evidence using the FlowElement's EvidenceKeyFilter. More...
 filterEvidenceKey (string $key)
Filter FlowData evidence using the FlowElement's EvidenceKeyFilter.
 onRegistration (Pipeline $pipeline)
Callback called when an engine is added to a pipeline.
 processInternal (FlowData $flowData)
Process FlowData - this is process function is usually overridden by specific FlowElements to do their core work.
 getProperties ()
Get properties Usually overridden by specific FlowElements. More...
 updatePropertyList ()
Update a FlowElement's property list This is used by elements that are only aware of their properties at a later stage, such as cloud request based FlowElements or FlowElements that change their properties later based on new datafiles.

Data Fields

string  $dataKey = 'cloud'
string  $baseURL
string  $cloudRequestOrigin
array  $flowElementProperties = []
string  $resourceKey

Data Fields inherited from fiftyone\pipeline\engines\Engine

array  $restrictedProperties

Data Fields inherited from fiftyone\pipeline\core\FlowElement

string  $dataKey array  $properties = [] array  $pipelines = []

Constructor & Destructor Documentation

◆ __construct()

fiftyone\pipeline\cloudrequestengine\CloudRequestEngine::__construct ( array   $settings )

Settings should contain a resourceKey and optionally: 1) a cloudEndPoint to overwrite the default baseurl 2) a cloudRequestOrigin to use when sending requests to cloud.

Parameters
array{ - resourceKey?: string, cloudEndPoint?: string, cloudRequestOrigin?: string, httpClient?: \fiftyone\pipeline\cloudrequestengine\HttpClient } $settings

Member Function Documentation

◆ addQueryData()

fiftyone\pipeline\cloudrequestengine\CloudRequestEngine::addQueryData ( array   $queryData,
array   $allEvidence,
array   $evidence  
)

Add query data to the evidence.

Parameters
array<string,string> - $queryData The destination Array to add query data to
array<string,int|string> - $allEvidence All evidence in the flow data. This is used to report which evidence keys are conflicting
array<string,int|string> - $evidence Evidence to add to the query Data
Returns
array<string, int|string>

◆ getContent()

fiftyone\pipeline\cloudrequestengine\CloudRequestEngine::getContent ( FlowData   $flowData )

Generate the Content to send in the POST request.

The evidence keys e.g. 'query.' and 'header.' have an order of precedence. These are added to the evidence in reverse order, if there is conflict then the queryData value is overwritten.

'query.' evidence should take precedence over all other evidence. If there are evidence keys other than 'query.' that conflict then this is unexpected so a warning will be logged.

Returns
array<string, int|string>

◆ getSelectedEvidence()

fiftyone\pipeline\cloudrequestengine\CloudRequestEngine::getSelectedEvidence ( array   $evidence,
string   $type  
)

Get evidence with specified prefix.

Parameters
array<string,int|string> - $evidence All evidence in the flow data
string
$type - Required evidence key prefix
Returns
array<string, int|string>

◆ keyHasPrefix()

fiftyone\pipeline\cloudrequestengine\CloudRequestEngine::keyHasPrefix ( string   $itemKey,
string   $prefix  
)

Check that the key of a KeyValuePair has the given prefix.

Parameters
string
$itemKey - Key to check
string
$prefix - The prefix to check for
Returns
bool true if the key has the prefix
On This Page