Package fiftyone.devicedetection
Class DeviceDetectionOnPremisePipelineBuilder
java.lang.Object
fiftyone.pipeline.core.flowelements.PipelineBuilderBase<TBuilder>
fiftyone.pipeline.engines.flowelements.PrePackagedPipelineBuilderBase<DeviceDetectionOnPremisePipelineBuilder>
fiftyone.devicedetection.DeviceDetectionOnPremisePipelineBuilder
public class DeviceDetectionOnPremisePipelineBuilder
extends fiftyone.pipeline.engines.flowelements.PrePackagedPipelineBuilderBase<DeviceDetectionOnPremisePipelineBuilder>
Builder used to create pipelines with an on-premise
device detection engine.
-
Field Summary
FieldsFields inherited from class fiftyone.pipeline.engines.flowelements.PrePackagedPipelineBuilderBase
lazyLoading, lazyLoadingTimeoutMillis, resultsCache, resultsCacheSizeFields inherited from class fiftyone.pipeline.core.flowelements.PipelineBuilderBase
autoCloseElements, flowElements, logger, loggerFactory, services, suppressProcessExceptions -
Method Summary
Modifier and TypeMethodDescriptionfiftyone.pipeline.core.flowelements.Pipelinebuild()Build and return a pipeline that can perform device detection.setAllowUnmatched(boolean allow) If set to false, a non-matching User-Agent will result in properties without set values.setAutoUpdate(boolean enabled) Enable/Disable auto update.setConcurrency(int concurrency) Set the expected number of concurrent operations using the engine.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.Set the license key used when checking for new device detection data files.setDataUpdateOnStartup(boolean enabled) Enable/Disable update on startup.setDataUpdateService(fiftyone.pipeline.engines.services.DataUpdateService dataUpdateService) Automatic updates require aDataUpdateService.setDataUpdateUrl(String url) Configure the engine to use the specified URL when looking for an updated data file.setDataUpdateUrlFormatter(fiftyone.pipeline.engines.data.DataUpdateUrlFormatter formatter) Specify aDataUpdateUrlFormatterto be used by theDataUpdateServicewhen building the complete URL to query for updated data.setDataUpdateVerifyMd5(Boolean verify) Set a value indicating if theDataUpdateServiceshould 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.setDifference(int difference) Set the maximum difference to allow when processing HTTP headers.setDrift(int drift) Set the maximum drift to allow when matching hashes.setPerformanceProfile(fiftyone.pipeline.engines.Constants.PerformanceProfiles profile) Set the performance profile for the device detection engine.setProperty(String property) Add a property to the list of properties that the engine will populate in the response.setShareUsage(boolean enabled) Set share usage enabled/disabled.setUpdatePollingInterval(int pollingIntervalSeconds) Set the time between checks for a new data file made by the DataUpdateService in seconds.setUpdatePollingIntervalMillis(long pollingIntervalMillis) Set the time between checks for a new data file made by the DataUpdateService in milliseconds.setUpdateRandomisationMax(int randomisationMaxSeconds) A random element can be added to the DataUpdateService polling interval.setUpdateRandomisationMaxMillis(long randomisationMaxMillis) A random element can be added to the DataUpdateService polling interval.setUsePerformanceGraph(boolean use) Set whether or not the performance optimized graph is used for processing.setUsePredictiveGraph(boolean use) Set whether or not the predictive optimized graph is used for processing.Methods inherited from class fiftyone.pipeline.engines.flowelements.PrePackagedPipelineBuilderBase
useLazyLoading, useLazyLoading, useResultsCache, useResultsCacheMethods inherited from class fiftyone.pipeline.core.flowelements.PipelineBuilderBase
addFlowElement, addFlowElementsParallel, addService, addServicesToPipeline, getFlowElements, onPreBuild, setAutoCloseElements, setSuppressProcessException
-
Field Details
-
Method Details
-
setAutoUpdate
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.
-
setDataFileSystemWatcher
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.
-
setDataUpdateService
public DeviceDetectionOnPremisePipelineBuilder setDataUpdateService(fiftyone.pipeline.engines.services.DataUpdateService dataUpdateService) Automatic updates require aDataUpdateService.- Parameters:
dataUpdateService- an instance of a dataUpdateService- Returns:
- This builder instance.
-
setDataUpdateOnStartup
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.
-
setUpdatePollingInterval
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
public 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
public 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
public 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.
-
setDataUpdateLicenseKey
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.
-
setPerformanceProfile
public DeviceDetectionOnPremisePipelineBuilder setPerformanceProfile(fiftyone.pipeline.engines.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.
-
setConcurrency
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
-
setDifference
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
-
setAllowUnmatched
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
-
setDrift
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
-
setUsePerformanceGraph
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.- Parameters:
use- true if the performance graph should be used- Returns:
- this builder
- See Also:
-
setUsePredictiveGraph
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.- Parameters:
use- true if the predictive graph should be used- Returns:
- this builder
- See Also:
-
setProperty
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
-
setDataUpdateUrl
Configure the engine to use the specified URL when looking for an updated data file.Default is the 51Degrees update URL
- Parameters:
url- the URL to check for a new data file- Returns:
- this builder
-
setDataUpdateVerifyMd5
Set a value indicating if theDataUpdateServiceshould 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:
verify- true if the content should be verified with the Md5 hash. False otherwise- Returns:
- this builder
-
setDataUpdateUrlFormatter
public DeviceDetectionOnPremisePipelineBuilder setDataUpdateUrlFormatter(fiftyone.pipeline.engines.data.DataUpdateUrlFormatter formatter) Specify aDataUpdateUrlFormatterto be used by theDataUpdateServicewhen building the complete URL to query for updated data.- Parameters:
formatter- the formatter to use- Returns:
- this builder
-
build
Build and return a pipeline that can perform device detection.- Overrides:
buildin classfiftyone.pipeline.core.flowelements.PipelineBuilderBase<DeviceDetectionOnPremisePipelineBuilder>- Returns:
- the built pipeline
- Throws:
Exception- on error