51Degrees Device Detection Java  4.1

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. More...
DeviceDetectionOnPremisePipelineBuilder  setAutoUpdate (boolean enabled)
Enable/Disable auto update. More...
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. More...
DeviceDetectionOnPremisePipelineBuilder  setDataUpdateOnStartup (boolean enabled)
Enable/Disable update on startup. More...
DeviceDetectionOnPremisePipelineBuilder  setUpdatePollingInterval (int pollingIntervalSeconds)
Set the time between checks for a new data file made by the DataUpdateService in seconds. More...
DeviceDetectionOnPremisePipelineBuilder  setUpdatePollingIntervalMillis (long pollingIntervalMillis)
Set the time between checks for a new data file made by the DataUpdateService in milliseconds. More...
DeviceDetectionOnPremisePipelineBuilder  setUpdateRandomisationMax (int randomisationMaxSeconds)
A random element can be added to the DataUpdateService polling interval. More...
DeviceDetectionOnPremisePipelineBuilder  setUpdateRandomisationMaxMillis (long randomisationMaxMillis)
A random element can be added to the DataUpdateService polling interval. More...
DeviceDetectionOnPremisePipelineBuilder  setDataUpdateLicenseKey (String key)
Set the license key used when checking for new device detection data files. More...
DeviceDetectionOnPremisePipelineBuilder  setPerformanceProfile (Constants.PerformanceProfiles profile)
Set the performance profile for the device detection engine. More...
DeviceDetectionOnPremisePipelineBuilder  setConcurrency (int concurrency)
Set the expected number of concurrent operations using the engine. More...
DeviceDetectionOnPremisePipelineBuilder  setDifference (int difference)
Set the maximum difference to allow when processing HTTP headers. More...
DeviceDetectionOnPremisePipelineBuilder  setAllowUnmatched (boolean allow)
If set to false, a non-matching User-Agent will result in properties without set values. More...
DeviceDetectionOnPremisePipelineBuilder  setDrift (int drift)
Set the maximum drift to allow when matching hashes. More...
DeviceDetectionOnPremisePipelineBuilder  setUsePerformanceGraph (boolean use)
Set whether or not the performance optimized graph is used for processing. More...
DeviceDetectionOnPremisePipelineBuilder  setUsePredictiveGraph (boolean use)
Set whether or not the predictive optimized graph is used for processing. More...
DeviceDetectionOnPremisePipelineBuilder  setProperty (String property)
Add a property to the list of properties that the engine will populate in the response. More...
Pipeline  build () throws Exception
Build and return a pipeline that can perform device detection. More...

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
Exceptions
Exception -

◆ 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
allow - true 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
enabled - True 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
concurrency - expected 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
enabled - True 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
key - The 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
enabled - True to enable update on startup. False to disable.
Returns
This builder instance.

◆ 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
difference - to 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
drift - to 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
profile - The 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
property - the 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
enabled - True 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
pollingIntervalSeconds - The 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
pollingIntervalMillis - The 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
randomisationMaxSeconds - The 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
randomisationMaxMillis - The 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
use - true 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
use - true if the predictive graph should be used
Returns
this builder