51Degrees Device Detection .NET  4.1

Device detection services for 51Degrees Pipeline

FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder Class Reference

Detailed Description

Builder for the DeviceDetectionHashEngine.

All options for the engine should be set here.

Inheritance diagram for FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder:

[legend]

Collaboration diagram for FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder:

[legend]

Public Member Functions

 DeviceDetectionHashEngineBuilder (ILoggerFactory loggerFactory)
Construct a new instance of the builder. More...
 DeviceDetectionHashEngineBuilder (ILoggerFactory loggerFactory, IDataUpdateService dataUpdateService)
Construct a new instance of the builder. More...
override DeviceDetectionHashEngineBuilder  SetDifference (int difference)
Set the maximum difference in hash value to allow when processing HTTP headers. More...
DeviceDetectionHashEngineBuilder  SetDrift (int drift)
Set maximum drift in hash position to allow when processing HTTP headers. More...
override DeviceDetectionHashEngineBuilder  SetAllowUnmatched (bool allow)
If set to false, a non-matching User-Agent will result in properties without set values. More...
DeviceDetectionHashEngineBuilder  SetReuseTempFile (bool reuse)
Set whether or not an existing temp file should be used if one is found in the temp directory. More...
DeviceDetectionHashEngineBuilder  SetUpdateMatchedUserAgent (bool update)
Set whether or not the matched characters of the User-Agent should be stored to be returned in the results. More...
DeviceDetectionHashEngineBuilder  SetUsePerformanceGraph (bool use)
Specify if the 'performance' evaluation graph should be used or not. More...
DeviceDetectionHashEngineBuilder  SetUsePredictiveGraph (bool use)
Specify if the 'predictive' evaluation graph should be used or not. More...
DeviceDetectionHashEngineBuilder  SetPerformanceProfile (string profileName)
Set the performance profile to use when constructing the data set. More...
override DeviceDetectionHashEngineBuilder  SetPerformanceProfile (PerformanceProfiles profile)
Set the performance profile to use when constructing the data set. More...
override DeviceDetectionHashEngineBuilder  SetConcurrency (ushort concurrency)
Set the expected number of concurrent operations using the engine. More...

Protected Member Functions

override DeviceDetectionHashEngine  NewEngine (List< string > properties)
Called by the 'BuildEngine' method to handle creation of the engine instance. More...

Protected Attributes

override string  DefaultDataDownloadType => "HashV41"
Get the default value for the 'Type' parameter that is passed to the 51Degrees Distributor service when checking for updated data files. More...

Constructor & Destructor Documentation

◆ DeviceDetectionHashEngineBuilder() [1/2]

FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.DeviceDetectionHashEngineBuilder ( ILoggerFactory   loggerFactory )

Construct a new instance of the builder.

Parameters
loggerFactory - Factory used to create loggers for the engine

◆ DeviceDetectionHashEngineBuilder() [2/2]

FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.DeviceDetectionHashEngineBuilder ( ILoggerFactory   loggerFactory,
IDataUpdateService   dataUpdateService  
)

Construct a new instance of the builder.

Parameters
loggerFactory - Factory used to create loggers for the engine
dataUpdateService - Data update service used to keep the engine's data up to date.

Member Function Documentation

◆ NewEngine()

override DeviceDetectionHashEngine FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.NewEngine ( List< string >   properties )
protected

Called by the 'BuildEngine' method to handle creation of the engine instance.

Parameters
properties -
Returns
An IAspectEngine.

◆ SetAllowUnmatched()

override DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetAllowUnmatched ( bool   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

◆ SetConcurrency()

override DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetConcurrency ( ushort   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()

override DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetDifference ( int   difference )

Set the maximum difference in hash value to allow when processing HTTP headers.

Parameters
difference - Difference to allow
Returns
This builder

◆ SetDrift()

DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetDrift ( int   drift )

Set maximum drift in hash position to allow when processing HTTP headers.

Parameters
drift - Drift to allow
Returns
This builder

◆ SetPerformanceProfile() [1/2]

DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetPerformanceProfile ( string   profileName )

Set the performance profile to use when constructing the data set.

Parameters
profileName - Name of the profile to use
Returns
This builder

◆ SetPerformanceProfile() [2/2]

override DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetPerformanceProfile ( PerformanceProfiles   profile )

Set the performance profile to use when constructing the data set.

Parameters
profile - Profile to use
Returns
This builder

◆ SetReuseTempFile()

DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetReuseTempFile ( bool   reuse )

Set whether or not an existing temp file should be used if one is found in the temp directory.

Parameters
reuse - True if an existing file should be used
Returns
This builder

◆ SetUpdateMatchedUserAgent()

DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetUpdateMatchedUserAgent ( bool   update )

Set whether or not the matched characters of the User-Agent should be stored to be returned in the results.

Parameters
update - True if the matched User-Agent should be stored
Returns
This builder

◆ SetUsePerformanceGraph()

DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetUsePerformanceGraph ( bool   use )

Specify if the 'performance' evaluation graph should be used or not.

The performance graph is faster than predictive but can be less accurate. Note that the performance graph will always be evaluated first if it is enableds so if you have both performance and predictive enabled, you will often be getting results from just the performance graph. In that situation, predictive will only be used if a match cannot be found using the performance graph.

Parameters
use - True to use the performance graph, false to ignore it.
Returns
This builder.

◆ SetUsePredictiveGraph()

DeviceDetectionHashEngineBuilder FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.SetUsePredictiveGraph ( bool   use )

Specify if the 'predictive' evaluation graph should be used or not.

The predictive graph is more accurate than performance but is also slower. Note that the performance graph will always be evaluated first if it is enabled, so if you have both performance and predictive enabled, you will often be getting results from just the performance graph. In that situation, predictive will only be used if a match cannot be found using the performance graph.

Parameters
use - True to use the performance graph, false to ignore it.
Returns
This builder.

Member Data Documentation

◆ DefaultDataDownloadType

override string FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngineBuilder.DefaultDataDownloadType => "HashV41"
protected

Get the default value for the 'Type' parameter that is passed to the 51Degrees Distributor service when checking for updated data files.