Device detection services for 51Degrees Pipeline

fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder Class Reference

Detailed Description

Builder used to create pipelines with an on-premise device detection engine.

Inheritance diagram for fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder:

[legend]

Collaboration diagram for fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder:

[legend]

Public Member Functions

DeviceDetectionOnPremisePipelineBuilder setShareUsage (boolean enabled)
 Set share usage enabled/disabled.
DeviceDetectionOnPremisePipelineBuilder setAutoUpdate (boolean enabled)
 Enable/Disable auto update.
DeviceDetectionOnPremisePipelineBuilder setDataFileSystemWatcher (boolean enabled)
 The DataUpdateService has the ability to watch a file on disk and refresh the engine as soon as that file is updated.
DeviceDetectionOnPremisePipelineBuilder setDataUpdateService (DataUpdateService dataUpdateService)
 Automatic updates require a DataUpdateService.
DeviceDetectionOnPremisePipelineBuilder setDataUpdateOnStartup (boolean enabled)
 Enable/Disable update on startup.
DeviceDetectionOnPremisePipelineBuilder setUpdatePollingInterval (int pollingIntervalSeconds)
 Set the time between checks for a new data file made by the DataUpdateService in seconds.
DeviceDetectionOnPremisePipelineBuilder setUpdatePollingIntervalMillis (long pollingIntervalMillis)
 Set the time between checks for a new data file made by the DataUpdateService in milliseconds.
DeviceDetectionOnPremisePipelineBuilder setUpdateRandomisationMax (int randomisationMaxSeconds)
 A random element can be added to the DataUpdateService polling interval.
DeviceDetectionOnPremisePipelineBuilder setUpdateRandomisationMaxMillis (long randomisationMaxMillis)
 A random element can be added to the DataUpdateService polling interval.
DeviceDetectionOnPremisePipelineBuilder setDataUpdateLicenseKey (String key)
 Set the license key used when checking for new device detection data files.
DeviceDetectionOnPremisePipelineBuilder setPerformanceProfile (Constants.PerformanceProfiles profile)
 Set the performance profile for the device detection engine.
DeviceDetectionOnPremisePipelineBuilder setConcurrency (int concurrency)
 Set the expected number of concurrent operations using the engine.
DeviceDetectionOnPremisePipelineBuilder setDifference (int difference)
 Set the maximum difference to allow when processing HTTP headers.
DeviceDetectionOnPremisePipelineBuilder setAllowUnmatched (boolean allow)
 If set to false, a non-matching User-Agent will result in properties without set values.
DeviceDetectionOnPremisePipelineBuilder setDrift (int drift)
 Set the maximum drift to allow when matching hashes.
DeviceDetectionOnPremisePipelineBuilder setUsePerformanceGraph (boolean use)
 Set whether or not the performance optimized graph is used for processing.
DeviceDetectionOnPremisePipelineBuilder setUsePredictiveGraph (boolean use)
 Set whether or not the predictive optimized graph is used for processing.
DeviceDetectionOnPremisePipelineBuilder setProperty (String property)
 Add a property to the list of properties that the engine will populate in the response.
DeviceDetectionOnPremisePipelineBuilder setDataUpdateUrl (String url)
 Configure the engine to use the specified URL when looking for an updated data file.
DeviceDetectionOnPremisePipelineBuilder setDataUpdateVerifyMd5 (Boolean verify)
 Set a value indicating if the DataUpdateService should expect the response from the data update URL to contain a 'content-md5' HTTP header that can be used to verify the integrity of the content.
DeviceDetectionOnPremisePipelineBuilder setDataUpdateUrlFormatter (DataUpdateUrlFormatter formatter)
 Specify a DataUpdateUrlFormatter to be used by the DataUpdateService when building the complete URL to query for updated data.
Pipeline build () throws Exception
 Build and return a pipeline that can perform device detection.

Public Member Functions inherited from fiftyone::pipeline::engines::flowelements::PrePackagedPipelineBuilderBase< TBuilder >

 PrePackagedPipelineBuilderBase (ILoggerFactory loggerFactory)
TBuilder useLazyLoading ()
TBuilder useLazyLoading (long timeoutMillis)
TBuilder useResultsCache ()
TBuilder useResultsCache (int size)

Protected Attributes

boolean shareUsageEnabled = true

Member Function Documentation

◆ build()

Pipeline fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.build ( ) throws Exception

Build and return a pipeline that can perform device detection.

Returns
the built pipeline
Exceptions
Exceptionon error

◆ setAllowUnmatched()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setAllowUnmatched ( boolean allow)

If set to false, a non-matching User-Agent will result in properties without set values.

If set to true, a non-matching User-Agent will cause the 'default profiles' to be returned. This means that properties will always have values (i.e. no need to check .hasValue) but some may be inaccurate. By default, this is false.

Parameters
allowtrue if results with no matched hash nodes should be considered valid
Returns
this builder

◆ setAutoUpdate()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setAutoUpdate ( boolean enabled)

Enable/Disable auto update.

Defaults to enabled. If enabled, the auto update system will automatically download and apply new data files for device detection.

Parameters
enabledTrue to enable auto update. False to disable.
Returns
This builder instance.

◆ setConcurrency()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setConcurrency ( int concurrency)

Set the expected number of concurrent operations using the engine.

This sets the concurrency of the internal caches to avoid excessive locking.

Parameters
concurrencyexpected concurrent accesses
Returns
this builder

◆ setDataFileSystemWatcher()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setDataFileSystemWatcher ( boolean enabled)

The DataUpdateService has the ability to watch a file on disk and refresh the engine as soon as that file is updated.

This setting enables/disables that feature.

Parameters
enabledTrue to enable file system watcher. False to disable.
Returns
This builder instance.

◆ setDataUpdateLicenseKey()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setDataUpdateLicenseKey ( String key)

Set the license key used when checking for new device detection data files.

Defaults to null.

Parameters
keyThe license key.
Returns
This builder instance.

◆ setDataUpdateOnStartup()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setDataUpdateOnStartup ( boolean enabled)

Enable/Disable update on startup.

Defaults to enabled. If enabled, the auto update system will be used to check for an update before the device detection engine is created. If an update is available, it will be downloaded and applied before the pipeline is built and returned for use so this may take some time.

Parameters
enabledTrue to enable update on startup. False to disable.
Returns
This builder instance.

◆ setDataUpdateService()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setDataUpdateService ( DataUpdateService dataUpdateService)

Automatic updates require a DataUpdateService.

Parameters
dataUpdateServicean instance of a dataUpdateService
Returns
This builder instance.

◆ setDataUpdateUrl()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setDataUpdateUrl ( String url)

Configure the engine to use the specified URL when looking for an updated data file.

Default is the 51Degrees update URL

Parameters
urlthe URL to check for a new data file
Returns
this builder

◆ setDataUpdateUrlFormatter()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setDataUpdateUrlFormatter ( DataUpdateUrlFormatter formatter)

Specify a DataUpdateUrlFormatter to be used by the DataUpdateService when building the complete URL to query for updated data.

Parameters
formatterthe formatter to use
Returns
this builder

◆ setDataUpdateVerifyMd5()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setDataUpdateVerifyMd5 ( Boolean verify)

Set a value indicating if the DataUpdateService should expect the response from the data update URL to contain a 'content-md5' HTTP header that can be used to verify the integrity of the content.

Default true

Parameters
verifytrue if the content should be verified with the Md5 hash. False otherwise
Returns
this builder

◆ setDifference()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setDifference ( int difference)

Set the maximum difference to allow when processing HTTP headers.

The meaning of difference depends on the Device Detection API being used. The difference is the difference in hash value between the hash that was found, and the hash that is being searched for. By default this is 0.

Parameters
differenceto allow
Returns
this builder

◆ setDrift()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setDrift ( int drift)

Set the maximum drift to allow when matching hashes.

If the drift is exceeded, the result is considered invalid and values will not be returned. By default this is 0.

Parameters
driftto set
Returns
this builder

◆ setPerformanceProfile()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setPerformanceProfile ( Constants.PerformanceProfiles profile)

Set the performance profile for the device detection engine.

Defaults to balanced.

Parameters
profileThe performance profile to use.
Returns
This builder instance.

◆ setProperty()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setProperty ( String property)

Add a property to the list of properties that the engine will populate in the response.

By default all properties will be populated.

Parameters
propertythe property that we want the engine to populate
Returns
this builder

◆ setShareUsage()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setShareUsage ( boolean enabled)

Set share usage enabled/disabled.

Defaults to enabled.

Parameters
enabledTrue to enable usage sharing. False to disable.
Returns
This builder instance.

◆ setUpdatePollingInterval()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setUpdatePollingInterval ( int pollingIntervalSeconds)

Set the time between checks for a new data file made by the DataUpdateService in seconds.

Default = 30 minutes.

Parameters
pollingIntervalSecondsThe number of seconds between checks.
Returns
This builder instance.

◆ setUpdatePollingIntervalMillis()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setUpdatePollingIntervalMillis ( long pollingIntervalMillis)

Set the time between checks for a new data file made by the DataUpdateService in milliseconds.

Parameters
pollingIntervalMillisThe number of milliseconds between checks.
Returns
This builder instance.

◆ setUpdateRandomisationMax()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setUpdateRandomisationMax ( int randomisationMaxSeconds)

A random element can be added to the DataUpdateService polling interval.

This option sets the maximum length of this random addition. Default = 10 minutes.

Parameters
randomisationMaxSecondsThe maximum time added to the data update polling interval in seconds.
Returns
This builder instance.

◆ setUpdateRandomisationMaxMillis()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setUpdateRandomisationMaxMillis ( long randomisationMaxMillis)

A random element can be added to the DataUpdateService polling interval.

This option sets the maximum length of this random addition. Default = 10 minutes.

Parameters
randomisationMaxMillisThe maximum time added to the data update polling interval in milliseconds.
Returns
This builder instance.

◆ setUsePerformanceGraph()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setUsePerformanceGraph ( boolean use)

Set whether or not the performance optimized graph is used for processing.

When processing evidence, the performance graph is optimised to find an answer as quick as possible. However, this can be at the expense of finding the best match for evidence which was not in the training data. If the predictive graph is also enabled, it will be used next if there was no match in the performance graph.

See also
Hash Algorithm
Parameters
usetrue if the performance graph should be used
Returns
this builder

◆ setUsePredictiveGraph()

DeviceDetectionOnPremisePipelineBuilder fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder.setUsePredictiveGraph ( boolean use)

Set whether or not the predictive optimized graph is used for processing.

When processing evidence, the predictive graph is optimised to find the best answer for evidence which was not in the training data. However, this is at the expense of processing time, as more possibilities are taken into consideration.

See also
Hash Algorithm
Parameters
usetrue if the predictive graph should be used
Returns
this builder