Config Class
DeviceAtlas Cloud API configuration. An instance of this
class must be created with the licence key and passed into
the Client instance. This class provides setter methods
to change the default client behaviour.
Constructor
Config
-
licenceKey
Parameters:
-
licenceKeyString
Item Index
Methods
cacheDirectory
()
A directory used by the file cache.
cacheDirectory
-
cacheDirectory
Sets a directory for the file cache.
The default directory is the system's temporary directory.
Parameters:
-
cacheDirectoryString
cacheExpirySeconds
()
Number
Returns the time (in seconds) that items remain cached for.
Returns:
cacheExpirySeconds
-
cacheExpirySeconds
Sets the time (in seconds) that items remain cached for.
The default cache expiry is 30 days (2592000 seconds).
Parameters:
-
cacheExpirySecondsNumber
licenceKey
()
Returns a licence key which was used to initialize the Config.
timeoutSeconds
()
Number
Returns the timeout in seconds allowed for the Cloud API connections.
Returns:
timeoutSeconds
-
timeoutSeconds
Sets the timeout (in seconds) to allow to obtain the device properties from the Cloud API endpoint.
The default timeout is 2 seconds.
Parameters:
-
timeoutSecondsNumber
useCache
()
Returns true if the in-memory cache is used.
useCache
-
useCache
Turns on/off the in-memory cache.
The in-memory cache is enabled by default.
Parameters:
-
useCacheBoolean
useFileCache
()
Returns true if the file cache is used.
useFileCache
-
useFileCache
Turns on/off the file cache.
The file cache is enabled by default.
Parameters:
-
useFileCacheBoolean
