51Degrees Pipeline for Python

fiftyone_pipeline_cloudrequestengine.cloudengine.CloudEngine Class Reference

Detailed Description

This is a template for all 51Degrees cloud engines.

It requires the 51Degrees cloudRequestEngine to be placed in a pipeline before it. It takes that raw JSON response and parses it to extract the device part. It also uses this data to generate a list of properties and an evidence key filter

Inheritance diagram for fiftyone_pipeline_cloudrequestengine.cloudengine.CloudEngine:

[legend]

Collaboration diagram for fiftyone_pipeline_cloudrequestengine.cloudengine.CloudEngine:

[legend]

Public Member Functions

 __init__ (self)
 on_registration (self, pipeline)
 Callback called when an engine is added to a pipeline In this case sets up the properties list for the element from data in the CloudRequestEngine.
 pipeline_element_not_found (self, element, flowdata)
 Custom error when an element cannot be found in the pipeline.
 process_internal (self, flowdata)
 Process function of a cloud engine.

Public Member Functions inherited from fiftyone_pipeline_engines.engine.Engine

 __init__ (self, data_file=None)
 Constructor for an engine.
 set_cache (self, cache)
 Add a cache to an engine @type cashe: Cache.
 set_restricted_properties (self, properties_list)
 Add a subset of properties.
 in_cache (self, flowdata)
 A method to check if a flowdata's evidence is in the cache.
 refresh (self, identifier)
 process (self, flowdata)
 Engine's core process function.
 close (self)
 Stop the checks and updates of the engine's data file, whose timers would otherwise keep the engine alive.
 register_data_file (self, data_file)
 Register a data_file of the DataFile class with the engine @type data_file: DataFile.

Public Member Functions inherited from fiftyone_pipeline_core.flowelement.FlowElement

 __init__ (self)
 List of Pipelines the FlowElement has been added to.
 get_evidence_key_filter (self)
 Filter FlowData evidence using the FlowElement's EvidenceKeyFilter.
 filter_evidence (self, flowdata)
 Filter FlowData evidence using the FlowElement's EvidenceKeyFilter.
 filter_evidence_key (self, key)
 Filter FlowData.evidence using the flowElement's EvidenceKeyFilter with the property key of evidence of interest.
 get_properties (self)
 Get the FlowElement.properties of a FlowElement.

Additional Inherited Members

Public Attributes inherited from fiftyone_pipeline_engines.engine.Engine

 data_file = data_file
 cache = cache
 restricted_properties = properties_list

Public Attributes inherited from fiftyone_pipeline_core.flowelement.FlowElement

list pipelines = []
dict properties = {}
str datakey = ""
bool exclude_from_messages = False

Protected Member Functions inherited from fiftyone_pipeline_core.flowelement.FlowElement

 _log (self, level, message)

Constructor & Destructor Documentation

◆ __init__()

fiftyone_pipeline_cloudrequestengine.cloudengine.CloudEngine.__init__ ( self)

Member Function Documentation

◆ on_registration()

fiftyone_pipeline_cloudrequestengine.cloudengine.CloudEngine.on_registration ( self,
pipeline )

Callback called when an engine is added to a pipeline In this case sets up the properties list for the element from data in the CloudRequestEngine.

@type pipeline: Pipeline

Parameters
pipeline

Reimplemented from fiftyone_pipeline_engines.engine.Engine.

◆ pipeline_element_not_found()

fiftyone_pipeline_cloudrequestengine.cloudengine.CloudEngine.pipeline_element_not_found ( self,
element,
flowdata )

Custom error when an element cannot be found in the pipeline.

@type element: string

Parameters
elementname of flowelement @type flowdata: flowdata
elementflowdata being processsed @rtype: Exception
Returns
: Returns exception

◆ process_internal()

fiftyone_pipeline_cloudrequestengine.cloudengine.CloudEngine.process_internal ( self,
flowdata )

Process function of a cloud engine.

This organises and parses data returned from the Cloud Request Engine and adds it to the FlowData

@type flowdata: FlowData

Parameters
flowdataFlowData to process

Reimplemented from fiftyone_pipeline_core.flowelement.FlowElement.

Reimplemented in fiftyone_pipeline_examples.cloud.engines.WeightedCloudEngine.