◆ constructor()
DeviceDetectionOnPremise::constructor | ( | { dataFilePath, autoUpdate, cache, dataUpdateUrl=constants.dataUpdateUrl, dataUpdateVerifyMd5=true, dataUpdateUseUrlFormatter=true, restrictedProperties, licenceKeys, download, performanceProfile='LowMemory', reuseTempFile=false, updateMatchedUserAgent=false, maxMatchedUserAgentLength, drift, difference, concurrency=os.cpus().length, allowUnmatched, fileSystemWatcher, pollingInterval, updateTimeMaximumRandomisation, createTempDataCopy, tempDataDir=os.tmpdir(), updateOnStart=false } | ) |
inline
Constructor for Device Detection On Premise engine.
- Parameters
-
- {object} - options options for the engine
- {string} - options.dataFilePath path to the datafile
- {boolean} - options.autoUpdate whether the datafile should be registered with the data file update service
- {number} - options.pollingInterval How often to poll for updates to the datafile (minutes)
- {number} - options.updateTimeMaximumRandomisation Maximum randomisation offset in seconds to polling time interval
- {DataKeyedCache} - options.cache an instance of the Cache class from Fiftyone.Pipeline.Engines. NOTE: This is no longer supported for on-premise engine.
- {string} - options.dataUpdateUrl base url for the datafile update service
- {boolean} - options.dataUpdateVerifyMd5 whether to check MD5 of datafile
- {boolean} - options.dataUpdateUseUrlFormatter whether to append default URL params for Data File download
- {Array<string>} - options.restrictedProperties list of properties the engine will be restricted to
- {string} - options.licenceKeys license key(s) used by the data file update service. A key can be obtained from the 51Degrees website: https://51degrees.com/pricing. If you do not wish to use a key then you can specify an empty string, but this will cause automatic updates to be disabled.
- {boolean} - options.download whether to download the datafile or store it in memory
- {string} - options.performanceProfile options are: LowMemory, MaxPerformance, Balanced, BalancedTemp, HighPerformance
- {boolean} - options.fileSystemWatcher whether to monitor the datafile path for changes
- {number} - options.concurrency defaults to the number of cpus in the machine
- {boolean} - options.reuseTempFile Indicates that an existing temp file may be used. This should be selected if multiple instances wish to use the same file to prevent high disk usage.
- {boolean} - options.updateMatchedUserAgent True if the detection should record the matched characters from the target User-Agent
- {number} - options.maxMatchedUserAgentLength Number of characters to consider in the matched User-Agent. Ignored if updateMatchedUserAgent is false
- {number} - options.drift Set maximum drift in hash position to allow when processing HTTP headers.
- {number} - options.difference Set the maximum difference to allow when processing HTTP headers. 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.
- {boolean} - options.allowUnmatched True if there should be at least one matched node in order for the results to be considered valid. By default, this is false
- {boolean} - options.createTempDataCopy If true, the engine will create a copy of the data file in a temporary location rather than using the file provided directly. If not loading all data into memory, this is required for automatic data updates to occur.
- {string} - options.tempDataDir The directory to use for the temporary data copy if 'createTempDataCopy' is set to true.
- {boolean} - options.updateOnStart whether to download / update the datafile on initialisation
Function for initialising the engine, wrapped like this so that an engine can be initialised once the datafile is retrieved if updateOnStart is set to true
- Returns
- {void}