51Degrees Pipeline Node.js  4.1

51Degrees Pipeline for Node.js

ShareUsage Class Reference

Detailed Description

The ShareUsage element sends usage data to 51Degrees in zipped batches.

Inheritance diagram for ShareUsage:

[legend]

Collaboration diagram for ShareUsage:

[legend]

Public Member Functions

 constructor ({ interval=100, requestedPackageSize=10, cookie, queryWhitelist, headerBlacklist, sharePercentage=100 }={})
Constructor for ShareUsage engine. More...
 processInternal (flowData)
Internal process method which uses the ShareUsageTracker to determine whether to add usage data to a batch and adds it if necessary. More...
 addToShareUsage (key)
Internal method which adds to the share usage bundle (generating XML) More...
 sendShareUsage ()
Internal method to send the share usage bundle to the 51Degrees servers.

Public Member Functions inherited from Engine

 constructor ({ cache, restrictedProperties, dataFile }={})
Constructor for an Engine. More...
 inCache (flowData)
Checks cache and returns cached result if found. More...
 process (flowData)
An engine's process function checks cache for an item (calling inCache) If found it returns the cached object If not found it runs the standard processInternal function and adds it to the cache (if a cache is present) More...
 refresh ()
Callback which runs when an attached DataFile is updated Needs to be overriden by a specific engine to do anything. More...
 registerDataFile (dataFile)
Function to attach a DataFile to the engine and register it with a DataFileUpdateService if needed. More...

Public Member Functions inherited from FlowElement

 constructor ({ processInternal, dataKey, properties={}, evidenceKeyFilter }={})
Constructor for flowElement class. More...
 onRegistration (pipeline, flowElement)
Internal function to be called when a FlowElement is added to pipeline, runs through any registrationCallbacks on the FlowElement. More...
 ready ()
Function called to check if a FlowElement is ready Used when there are asynchronous initialisation steps. More...
 processInternal (flowData)
Internal process function for a particular flowElement called (via the flowElement.process() method) when flowData generated by a pipleline is processsed. More...
 process (flowData)
To allow actions to take place before and after a FlowElement's processInternal function runs, a process wrapper is run first. More...
 updateProperties ()
Call this function to update the properties meta database in all the pipelines this flowElement has been added to. More...
 getProperties ()
Get a flowElement's properties. More...

Member Function Documentation

◆ addToShareUsage()

ShareUsage::addToShareUsage (   key )
inline

Internal method which adds to the share usage bundle (generating XML)

Parameters
{object} - key key value store of current evidence in FlowData (filtered by the ShareUsageEvidenceKeyFilter)

◆ constructor()

ShareUsage::constructor (   { interval=100, requestedPackageSize=10, cookie, queryWhitelist, headerBlacklist, sharePercentage=100 } = {} )
inline

Constructor for ShareUsage engine.

Parameters
{object} - options settings object for shareusage
{number} - options.interval how often to send
{number} - options.requestedPackageSize how many items in one zipped packaged
{string} - options.cookie which cookie is used to track evidence
{Array} - options.queryWhitelist list of query string whitelist evidence to keep
{Array} - options.headerBlacklist list of header evidence to exclude
{number} - options.sharePercentage percentage of requests to share

◆ processInternal()

ShareUsage::processInternal (   flowData )
inline

Internal process method which uses the ShareUsageTracker to determine whether to add usage data to a batch and adds it if necessary.

Parameters
{FlowData} - flowData flowData to process