Class DeviceDetectionOnPremisePipelineBuilder


  • public class DeviceDetectionOnPremisePipelineBuilder
    extends fiftyone.pipeline.engines.flowelements.PrePackagedPipelineBuilderBase<DeviceDetectionOnPremisePipelineBuilder>
    Builder used to create pipelines with an on-premise device detection engine.
    • Field Detail

      • shareUsageEnabled

        protected boolean shareUsageEnabled
    • Method Detail

      • setShareUsage

        public 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.
      • setAutoUpdate

        public 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.
      • setDataFileSystemWatcher

        public 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.
      • setDataUpdateService

        public DeviceDetectionOnPremisePipelineBuilder setDataUpdateService​(fiftyone.pipeline.engines.services.DataUpdateService dataUpdateService)
        Automatic updates require a DataUpdateService.
        Parameters:
        dataUpdateService - an instance of a dataUpdateService
        Returns:
        This builder instance.
      • setDataUpdateOnStartup

        public 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.
      • setUpdatePollingInterval

        public 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

        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

        public DeviceDetectionOnPremisePipelineBuilder setDataUpdateLicenseKey​(java.lang.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.
      • 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

        public 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
      • setDifference

        public 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
      • setAllowUnmatched

        public 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
      • setDrift

        public 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
      • setUsePerformanceGraph

        public 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.
        Parameters:
        use - true if the performance graph should be used
        Returns:
        this builder
        See Also:
        Hash Algorithm
      • setUsePredictiveGraph

        public 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.
        Parameters:
        use - true if the predictive graph should be used
        Returns:
        this builder
        See Also:
        Hash Algorithm
      • setProperty

        public DeviceDetectionOnPremisePipelineBuilder setProperty​(java.lang.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
      • setDataUpdateUrl

        public DeviceDetectionOnPremisePipelineBuilder setDataUpdateUrl​(java.lang.String url)
        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

        public DeviceDetectionOnPremisePipelineBuilder setDataUpdateVerifyMd5​(java.lang.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:
        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 a DataUpdateUrlFormatter to be used by the DataUpdateService when building the complete URL to query for updated data.
        Parameters:
        formatter - the formatter to use
        Returns:
        this builder
      • build

        public fiftyone.pipeline.core.flowelements.Pipeline build()
                                                           throws java.lang.Exception
        Build and return a pipeline that can perform device detection.
        Overrides:
        build in class fiftyone.pipeline.core.flowelements.PipelineBuilderBase<DeviceDetectionOnPremisePipelineBuilder>
        Returns:
        the built pipeline
        Throws:
        java.lang.Exception - on error