The DeviceAtlas DeviceApi documentation
Public Member Functions | Public Attributes | Properties | List of all members
Com.DeviceAtlas.Device.Config Class Reference

DeviceApi Configurations. To change the default configs of the DeviceAtlas DeviceApi create an instance of this class, set your preferred configs and pass the instance to the constructor of a DeviceApi or DeviceApiWeb. Note that you may change the configs even after the Config instance has been passed to the DeviceApi. More...

Inheritance diagram for Com.DeviceAtlas.Device.Config:

Public Member Functions

object Clone ()
 
 Config ()
 Config constructor. More...
 

Public Attributes

const string DEFAULT_COOKIE_NAME = "DAPROPS"
 The default cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages. More...
 
const int DEFAULT_MAX_CACHE_ENTRIES = 4096
 The default config value for result (Properties object) caching. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection the result cache may increase performance by preventing repeated lookups. More...
 

Properties

virtual string CookieName [get, set]
 To change the cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.
When the user-agent or HTTP headers are set manually to GetProperties() or GetProperty(), the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for GetProperties(REQUEST-OBJECT) or GetProperty(REQUEST-OBJECT). More...
 
virtual int MaxCacheEntries [get, set]
 Set the max number of results to be cached. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection, increasing the result cache may increase performance by preventing repeated lookups. For a tight set of inputs (i.e. an almost unique set of user-agents) set to lower numbers or o to disable. More...
 
virtual int CacheConcurrencyLevel [get, set]
 The cache uses a ConcurrentDictionary as an in-memory data store, the higher the concurrency level, the higher the theoretical number of operations that could be performed concurrently on the ConcurrentDictionary. If not set, the default concurrency level will be set the number of processors that are available (Environment.ProcessorCount). More...
 

Detailed Description

DeviceApi Configurations. To change the default configs of the DeviceAtlas DeviceApi create an instance of this class, set your preferred configs and pass the instance to the constructor of a DeviceApi or DeviceApiWeb. Note that you may change the configs even after the Config instance has been passed to the DeviceApi.

Author
DeviceAtlas Limited

Constructor & Destructor Documentation

◆ Config()

Com.DeviceAtlas.Device.Config.Config ( )
inline

Config constructor.

Member Data Documentation

◆ DEFAULT_COOKIE_NAME

const string Com.DeviceAtlas.Device.Config.DEFAULT_COOKIE_NAME = "DAPROPS"

The default cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.

◆ DEFAULT_MAX_CACHE_ENTRIES

const int Com.DeviceAtlas.Device.Config.DEFAULT_MAX_CACHE_ENTRIES = 4096

The default config value for result (Properties object) caching. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection the result cache may increase performance by preventing repeated lookups.

Property Documentation

◆ CacheConcurrencyLevel

virtual int Com.DeviceAtlas.Device.Config.CacheConcurrencyLevel
getset

The cache uses a ConcurrentDictionary as an in-memory data store, the higher the concurrency level, the higher the theoretical number of operations that could be performed concurrently on the ConcurrentDictionary. If not set, the default concurrency level will be set the number of processors that are available (Environment.ProcessorCount).

Parameters
cacheConcurrencyLevelconcurrency level for the ConcurrentDictionary powering the cache

◆ CookieName

virtual string Com.DeviceAtlas.Device.Config.CookieName
getset

To change the cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.
When the user-agent or HTTP headers are set manually to GetProperties() or GetProperty(), the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for GetProperties(REQUEST-OBJECT) or GetProperty(REQUEST-OBJECT).

Parameters
cookieNameThe cookie name which the client side properties are set to Set to null to turn off using client-side properties.

◆ MaxCacheEntries

virtual int Com.DeviceAtlas.Device.Config.MaxCacheEntries
getset

Set the max number of results to be cached. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection, increasing the result cache may increase performance by preventing repeated lookups. For a tight set of inputs (i.e. an almost unique set of user-agents) set to lower numbers or o to disable.

Parameters
maxCacheEntriesmax number of cache entries

The documentation for this class was generated from the following file: