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:
-
licenceKey
String
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:
-
cacheDirectory
String
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:
-
cacheExpirySeconds
Number
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:
-
timeoutSeconds
Number
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:
-
useCache
Boolean
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:
-
useFileCache
Boolean