public class CloudConnectorPreferencesManager
extends java.lang.Object
Use the CloudConnectorManager.getPreferencesManager()
to retrieve an
instance of this object.
Modifier and Type | Field and Description |
---|---|
static int |
CONTACT_MAXIMUM_LENGTH
Device contact information maximum length (in characters).
|
static boolean |
DEFAULT_ENABLE_AUTO_CONNECT
Default value for enabling auto connect: false.
|
static boolean |
DEFAULT_ENABLE_COMPRESSION
Default value for enabling compression: false.
|
static boolean |
DEFAULT_ENABLE_RECONNECT
Default value for enabling reconnect: true.
|
static boolean |
DEFAULT_ENABLE_SECURE_CONNECTION
Default value for enabling secure connection: false.
|
static int |
DEFAULT_RECONNECT_TIME
Default value for reconnect time: 10 seconds.
|
static int |
DESCRIPTION_MAXIMUM_LENGTH
Device description maximum length (in characters).
|
static int |
DEVICE_NAME_MAXIMUM_LENGTH
Device name maximum length (in characters).
|
static int |
MAXIMUM_UPLOAD_SAMPLES_SIZE
System monitor maximum upload samples size.
|
static int |
MINIMUM_SAMPLE_RATE
System monitor minimum sample rate in seconds.
|
static int |
RECONNECT_TIME_MAXIMUM_VALUE
Reconnect time maximum value (in seconds).
|
static int |
RECONNECT_TIME_MINIMUM_VALUE
Reconnect time minimum value (in seconds).
|
Modifier and Type | Method and Description |
---|---|
void |
enableSystemMonitor(boolean enable)
Sets the new value of the enable system monitor setting.
|
void |
enableSystemMonitorCPULoadSampling(boolean enable)
Sets the new value of the enable system monitor CPU load sampling.
|
void |
enableSystemMonitorCPUTemperatureSampling(boolean enable)
Sets the new value of the enable system monitor CPU temperature sampling.
|
void |
enableSystemMonitorMemorySampling(boolean enable)
Sets the new value of the enable system monitor memory sampling.
|
java.lang.String |
getAppUpdateDirectory()
Returns the directory used to hold applications and updates.
|
java.lang.String |
getDeviceContactInformation()
Returns the configured device contact information preference.
|
java.lang.String |
getDeviceDescription()
Returns the configured device description preference.
|
java.lang.String |
getDeviceID()
Returns the Device ID.
|
java.lang.String |
getDeviceName()
Returns the configured device name preference.
|
int |
getReconnectTime()
Returns the configured reconnect time delay setting in seconds.
|
int |
getSystemMonitorSampleRate()
Returns the system monitor sample rate.
|
int |
getSystemMonitorUploadSamplesSize()
Returns the system monitor number of samples to store for each channel
before uploading to Device Cloud.
|
java.lang.String |
getURL()
Returns the configured Cloud Connector URL preference.
|
java.lang.String |
getVendorID()
Returns the device vendor ID.
|
boolean |
isAutoConnectEnabled()
Returns whether auto-connect setting is enabled.
|
boolean |
isCompressionEnabled()
Returns whether messages compression is enabled.
|
boolean |
isReconnectEnabled()
Returns whether reconnect setting is enabled.
|
boolean |
isSecureConnectionEnabled()
Returns whether secure connection is enabled.
|
boolean |
isSystemMonitorCPULoadSamplingEnabled()
Returns whether the system monitor CPU load sampling is enabled.
|
boolean |
isSystemMonitorCPUTemperatureSamplingEnabled()
Returns whether the system monitor CPU temperature sampling is enabled.
|
boolean |
isSystemMonitorEnabled()
Returns the current state of the system monitor.
|
boolean |
isSystemMonitorMemorySamplingEnabled()
Returns whether the system monitor memory sampling is enabled.
|
void |
setAppUpdateDirectory(java.lang.String appsDir)
Sets the directory used to hold applications and updates.
|
void |
setAutoConnectEnabled(boolean enabled)
Sets the new value of the auto-connect setting.
|
void |
setCompressionEnabled(boolean enabled)
Sets the new value of the compress messages setting.
|
void |
setDeviceContactInformation(java.lang.String contactInformation)
Sets the device contact information preference.
|
void |
setDeviceDescription(java.lang.String deviceDescription)
Sets the device description preference.
|
void |
setDeviceName(java.lang.String deviceName)
Sets the device name preference.
|
void |
setReconnectEnabled(boolean enabled)
Sets the new value of the reconnect setting.
|
void |
setReconnectTime(int time)
Sets the new value for the reconnect time setting in seconds.
|
void |
setSecureConnectionEnabled(boolean enabled)
Sets the new value for the use secure connection setting.
|
void |
setSystemMonitorSampleRate(int sampleRate)
Sets the system monitor sample rate.
|
void |
setSystemMonitorUploadSamplesSize(int size)
Sets the system monitor number of samples to store for each channel
before uploading to Device Cloud.
|
void |
setURL(java.lang.String url)
Sets the Cloud Connector URL preference.
|
void |
setVendorID(java.lang.String vendorID)
Sets the Cloud Connector Vendor ID setting.
|
public static final int RECONNECT_TIME_MINIMUM_VALUE
The value of this constant is 1 seconds.
public static final int RECONNECT_TIME_MAXIMUM_VALUE
The value of this constant is 32767 seconds.
public static final int DEVICE_NAME_MAXIMUM_LENGTH
The value of this constant is 255 characters.
public static final int DESCRIPTION_MAXIMUM_LENGTH
The value of this constant is 63 characters.
public static final int CONTACT_MAXIMUM_LENGTH
The value of this constant is 63 characters.
public static final int MAXIMUM_UPLOAD_SAMPLES_SIZE
The value of this constant is 250.
public static final int MINIMUM_SAMPLE_RATE
The value of this constant is 5.
public static final boolean DEFAULT_ENABLE_AUTO_CONNECT
public static final boolean DEFAULT_ENABLE_RECONNECT
public static final int DEFAULT_RECONNECT_TIME
public static final boolean DEFAULT_ENABLE_SECURE_CONNECTION
public static final boolean DEFAULT_ENABLE_COMPRESSION
public boolean isAutoConnectEnabled()
Auto-connect setting determines whether Cloud Connector service should connect as soon as device boots or there is internet connectivity available.
true
if auto-connect is enabled, false
otherwise.setAutoConnectEnabled(boolean)
public void setAutoConnectEnabled(boolean enabled)
Auto-connect setting determines whether Cloud Connector service should connect as soon as device boots or there is internet connectivity available.
enabled
- true
to enable auto-connect, false
otherwise.isAutoConnectEnabled()
public boolean isReconnectEnabled()
Reconnect setting determines whether Cloud Connector should attempt a reconnect after connection is lost due to error.
true
if reconnect is enabled, false
otherwise.getReconnectTime()
,
setReconnectEnabled(boolean)
,
setReconnectTime(int)
public void setReconnectEnabled(boolean enabled)
enabled
- true
to enable reconnect, false
otherwise.isReconnectEnabled()
,
getReconnectTime()
,
setReconnectTime(int)
public int getReconnectTime()
isReconnectEnabled()
,
setReconnectTime(int)
,
setReconnectEnabled(boolean)
public void setReconnectTime(int time)
The value should be:
time
- New value for the reconnect time setting.java.lang.IllegalArgumentException
- If time < RECONNECT_TIME_MINIMUM_VALUE
or
if time > RECONNECT_TIME_MAXIMUM_VALUE
.RECONNECT_TIME_MAXIMUM_VALUE
,
RECONNECT_TIME_MINIMUM_VALUE
,
getReconnectTime()
,
isReconnectEnabled()
,
setReconnectEnabled(boolean)
public boolean isSecureConnectionEnabled()
true
if secure connection is enabled, false
otherwise.setSecureConnectionEnabled(boolean)
public void setSecureConnectionEnabled(boolean enabled)
enabled
- true
to enable secure connection, false
otherwise.isSecureConnectionEnabled()
public boolean isCompressionEnabled()
true
if messages compression is enabled, false
otherwise.setCompressionEnabled(boolean)
public void setCompressionEnabled(boolean enabled)
enabled
- true
to compress messages, false
otherwise.isCompressionEnabled()
public java.lang.String getVendorID()
Vendor ID follows this format: '0x01234567'
null
if not configured.setVendorID(String)
public void setVendorID(java.lang.String vendorID)
Vendor ID follows this format: '0x01234567'
vendorID
- The Cloud Connector VendorID setting.java.lang.IllegalArgumentException
- If vendorID
is invalid.java.lang.NullPointerException
- If vendorID
is null
.getVendorID()
public java.lang.String getURL()
null
if not configured.setURL(String)
public void setURL(java.lang.String url)
url
- The new Cloud Connector URL.java.lang.NullPointerException
- If url
is null
.getURL()
public java.lang.String getDeviceID()
public java.lang.String getDeviceName()
null
if not configured.setDeviceName(String)
public void setDeviceName(java.lang.String deviceName)
deviceName
- The new device name value.java.lang.IllegalArgumentException
- If deviceName
is invalid.java.lang.NullPointerException
- If deviceName
is null
.DEVICE_NAME_MAXIMUM_LENGTH
,
getDeviceName()
public java.lang.String getDeviceDescription()
null
if not configured.setDeviceDescription(String)
public void setDeviceDescription(java.lang.String deviceDescription)
deviceDescription
- The new device description value.java.lang.IllegalArgumentException
- If deviceDescription
is invalid.java.lang.NullPointerException
- If deviceDescription
is null
.DESCRIPTION_MAXIMUM_LENGTH
,
getDeviceDescription()
public java.lang.String getDeviceContactInformation()
null
if not
configured.setDeviceContactInformation(String)
public void setDeviceContactInformation(java.lang.String contactInformation)
contactInformation
- The new device contact information value.java.lang.IllegalArgumentException
- If contactInformation
is invalid.java.lang.NullPointerException
- If contactInformation
is null
.CONTACT_MAXIMUM_LENGTH
,
getDeviceContactInformation()
public void enableSystemMonitor(boolean enable)
enable
- true
to enable the system monitor, false
to disable it.isSystemMonitorEnabled()
public boolean isSystemMonitorEnabled()
true
if the system monitor is enabled, false
otherwise.enableSystemMonitor(boolean)
public void setSystemMonitorSampleRate(int sampleRate)
sampleRate
- The new system monitor sample rate (in seconds).java.lang.IllegalArgumentException
- If sampleRate < MINIMUM_SAMPLE_RATE
(5 seconds).MINIMUM_SAMPLE_RATE
,
getSystemMonitorSampleRate()
public int getSystemMonitorSampleRate()
setSystemMonitorSampleRate(int)
public void setSystemMonitorUploadSamplesSize(int size)
size
- The system monitor number of samples to store in the buffer
for each channel before uploading to Device Cloud.java.lang.IllegalArgumentException
- If size < 1
or
if size > MAXIMUM_UPLOAD_SAMPLES_SIZE
(250 seconds).MAXIMUM_UPLOAD_SAMPLES_SIZE
,
getSystemMonitorUploadSamplesSize()
public int getSystemMonitorUploadSamplesSize()
setSystemMonitorUploadSamplesSize(int)
public void enableSystemMonitorMemorySampling(boolean enable)
enable
- true
to enable the system monitor memory sampling,
false
to disable it.isSystemMonitorMemorySamplingEnabled()
public boolean isSystemMonitorMemorySamplingEnabled()
true
if the system monitor memory sampling is enabled,
false
otherwise.enableSystemMonitorMemorySampling(boolean)
public void enableSystemMonitorCPULoadSampling(boolean enable)
enable
- true
to enable the system monitor CPU load sampling,
false
to disable it.isSystemMonitorCPULoadSamplingEnabled()
public boolean isSystemMonitorCPULoadSamplingEnabled()
true
if the system monitor CPU load sampling is enabled,
false
otherwise.enableSystemMonitorCPULoadSampling(boolean)
public void enableSystemMonitorCPUTemperatureSampling(boolean enable)
enable
- true
to enable the system monitor CPU temperature
sampling, false
to disable it.isSystemMonitorCPUTemperatureSamplingEnabled()
public boolean isSystemMonitorCPUTemperatureSamplingEnabled()
true
if the system monitor CPU temperature sampling is
enabled, false
otherwise.enableSystemMonitorCPUTemperatureSampling(boolean)
public void setAppUpdateDirectory(java.lang.String appsDir)
appsDir
- The directory Cloud Connector will use to look for
applications and updates.java.lang.NullPointerException
- If appsDir
is null
.getAppUpdateDirectory()
public java.lang.String getAppUpdateDirectory()
setAppUpdateDirectory(String)