public class ConnectorPreferencesManager extends java.lang.Object implements IConnectorPreferences
| Constructor and Description |
|---|
ConnectorPreferencesManager(IConnectorPreferences connectorPreferences,
AbstractCloudConnector connector)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAuthorizationPassword()
Retrieves the authorization password setting value if the authorization
type is configured to
PreferencesConstants.AUTHORIZATION_TYPE_BASIC
(). |
java.lang.String |
getAuthorizationType()
Retrieves the connection authorization type.
|
java.lang.String |
getContact()
Retrieves the Cloud Connector device contact setting.
|
java.lang.String |
getDescription()
Retrieves the Cloud Connector device description setting.
|
java.lang.String |
getDeviceID()
Retrieves the device's Device ID.
|
java.lang.String |
getDeviceType()
Retrieves the device type.
|
java.lang.String |
getFileSystemRootDir()
Retrieves the file system root (sandbox) directory.
|
java.lang.String |
getFirmwareVersion()
Retrieves the 4 digit firmware version of the system.
|
int |
getKeepAliveTime()
Retrieves the keep alive time setting value in seconds.
|
java.lang.String |
getLocation()
Retrieves the Cloud Connector device location setting.
|
int |
getReconnectTime()
Retrieves the configured reconnect time delay setting in seconds.
|
int |
getServerKeepAliveTime()
Retrieves the server keep alive time setting value in seconds.
|
Location |
getStaticLocation()
Retrieves the static location to use.
|
byte[] |
getURL()
Retrieves the configured Cloud Connector URL preference as byte array.
|
java.lang.String |
getURLString()
Retrieves the configured Cloud Connector URL preference.
|
byte[] |
getVendorID()
Retrieves the device vendor ID.
|
int |
getWaitTimes()
Retrieves the value of the wait times preference.
|
boolean |
isCompressionEnabled()
Retrieves whether messages compression is enabled or not.
|
boolean |
isDataServiceEnabled()
Retrieves whether the data service is enabled or not.
|
boolean |
isFileSystemEnabled()
Retrieves whether file system should be enabled or not.
|
boolean |
isRCIEnabled()
Retrieves whether the RCI facility is enabled or not.
|
boolean |
isReconnectEnabled()
Retrieves whether reconnect setting is enabled or not.
|
boolean |
isSecureConnectionEnabled()
Retrieves whether secure connection is enabled or not.
|
void |
setAuthorizationPassword(java.lang.String password)
Sets the authorization password setting new value.
|
void |
setAuthorizationType(java.lang.String authorizationType)
Sets the new value for the connection authorization type setting.
|
void |
setCompressionEnabled(boolean enabled)
Sets the new value of the compress messages setting.
|
void |
setContact(java.lang.String contact)
Sets the Cloud Connector device contact setting.
|
void |
setDescription(java.lang.String description)
Sets the Cloud Connector device description setting.
|
void |
setDeviceID(java.lang.String deviceID)
Stores the device ID.
|
void |
setKeepAliveTime(int time)
Sets the new value for the Keep Alive time setting in seconds.
|
void |
setLocation(java.lang.String location)
Sets the Cloud Connector device location setting.
|
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 value)
Sets the new value for the use secure connection setting.
|
void |
setServerKeepAliveTime(int time)
Sets the new value for the Server Keep Alive time setting in seconds.
|
void |
setStaticLocation(Location location)
Sets the value of the static location.
|
void |
setURLString(java.lang.String url)
Sets the Cloud Connector URL preference.
|
void |
setUseStaticLocation(boolean useStaticLocation)
Sets the value of use static location preference.
|
void |
setVendorID(java.lang.String vendorID)
Sets the Cloud Connector Vendor ID setting.
|
void |
setWaitTimes(int waitTimes)
Sets the new value for the wait times setting.
|
boolean |
useStaticLocation()
Retrieves whether static location will be used or not.
|
public ConnectorPreferencesManager(IConnectorPreferences connectorPreferences, AbstractCloudConnector connector)
connectorPreferences - Class implementing IConnectorPreferences
interface in charge of managing the connector
preferences methods that are platform dependent.connector - Cloud Connector.public java.lang.String getAuthorizationPassword()
IConnectorPreferencesPreferencesConstants.AUTHORIZATION_TYPE_BASIC
().getAuthorizationPassword in interface IConnectorPreferencesPreferencesConstants.AUTHORIZATION_TYPE_BASIC,
IConnectorPreferences.setAuthorizationPassword(java.lang.String),
IConnectorPreferences.getAuthorizationType(),
IConnectorPreferences.setAuthorizationType(java.lang.String)public java.lang.String getAuthorizationType()
IConnectorPreferencesIt should be PreferencesConstants.AUTHORIZATION_TYPE_NONE or
PreferencesConstants.AUTHORIZATION_TYPE_BASIC
().
For the PreferencesConstants.AUTHORIZATION_TYPE_BASIC
authorization type a password should be provided
IConnectorPreferences.getAuthorizationPassword().
getAuthorizationType in interface IConnectorPreferencesPreferencesConstants.AUTHORIZATION_TYPE_NONE,
PreferencesConstants.AUTHORIZATION_TYPE_BASIC,
IConnectorPreferences.setAuthorizationType(java.lang.String),
IConnectorPreferences.getAuthorizationPassword(),
IConnectorPreferences.setAuthorizationPassword(java.lang.String)public java.lang.String getContact()
IConnectorPreferencesgetContact in interface IConnectorPreferencesPreferencesConstants.DEFAULT_CONTACT
().PreferencesConstants.DEFAULT_CONTACT,
IConnectorPreferences.setContact(java.lang.String)public java.lang.String getDescription()
IConnectorPreferencesgetDescription in interface IConnectorPreferencesPreferencesConstants.DEFAULT_DESCRIPTION
().PreferencesConstants.DEFAULT_DESCRIPTION,
IConnectorPreferences.setDescription(java.lang.String)public java.lang.String getDeviceID()
IConnectorPreferencesThis method should return null to use provisioning to get the
Device ID.
getDeviceID in interface IConnectorPreferencespublic java.lang.String getDeviceType()
IConnectorPreferencesA null or empty string is an invalid value.
The maximum length of this string is
PreferencesConstants.DEVICE_TYPE_MAXIMUM_LENGTH
().
getDeviceType in interface IConnectorPreferencesPreferencesConstants.DEVICE_TYPE_MAXIMUM_LENGTHpublic java.lang.String getFileSystemRootDir()
IConnectorPreferencesgetFileSystemRootDir in interface IConnectorPreferencesIConnectorPreferences.isFileSystemEnabled()public java.lang.String getFirmwareVersion()
IConnectorPreferencesThis version will be used as Firmware Target 0x00 version
if no firmware targets are provided (see
IFirmwareUpdateImplementation.getFirmwareTargets()),
if no firmware target 0x00 is defined or it is invalid.
In these cases a virtual target 0x00 non-update-able will be
generated using the version provided by this method.
Target 0x00 represents the firmware that is running Cloud
Connector.
getFirmwareVersion in interface IConnectorPreferencespublic int getKeepAliveTime()
IConnectorPreferencesThe value should be:
time > PreferenceConstants.KEEP_ALIVE_MINIMUM_VALUE
()time < PreferenceConstants.KEEP_ALIVE_MAXIMUM_VALUE
()getKeepAliveTime in interface IConnectorPreferencesPreferencesConstants.DEFAULT_KEEP_ALIVE_TIME
().PreferencesConstants.DEFAULT_KEEP_ALIVE_TIME,
IConnectorPreferences.setKeepAliveTime(int)public java.lang.String getLocation()
IConnectorPreferencesgetLocation in interface IConnectorPreferencesPreferencesConstants.DEFAULT_LOCATION
().PreferencesConstants.DEFAULT_LOCATION,
IConnectorPreferences.setLocation(java.lang.String)public int getReconnectTime()
IConnectorPreferencesThe value should be:
time > PreferenceConstants.RECONNECT_TIME_MINIMUM_VALUE
()time < PreferenceConstants.RECONNECT_TIME_MAXIMUM_VALUE
()getReconnectTime in interface IConnectorPreferencesPreferencesConstants.DEFAULT_RECONNECT_TIME
()..PreferencesConstants.DEFAULT_RECONNECT_TIME,
PreferencesConstants.RECONNECT_TIME_MINIMUM_VALUE,
PreferencesConstants.RECONNECT_TIME_MAXIMUM_VALUE,
PreferencesConstants.RECONNECT_TIME_MAX_RANDOM,
IConnectorPreferences.setReconnectTime(int),
IConnectorPreferences.isReconnectEnabled(),
IConnectorPreferences.setReconnectEnabled(boolean)public int getServerKeepAliveTime()
IConnectorPreferencesThe value should be:
time > PreferenceConstants.KEEP_ALIVE_MINIMUM_VALUE
()time < PreferenceConstants.KEEP_ALIVE_MAXIMUM_VALUE
()getServerKeepAliveTime in interface IConnectorPreferencesPreferencesConstants.DEFAULT_SERVER_KEEP_ALIVE_TIME
().PreferencesConstants.DEFAULT_SERVER_KEEP_ALIVE_TIME,
IConnectorPreferences.setServerKeepAliveTime(int)public Location getStaticLocation()
IConnectorPreferencesgetStaticLocation in interface IConnectorPreferencesIConnectorPreferences.useStaticLocation(),
IConnectorPreferences.setUseStaticLocation(boolean),
IConnectorPreferences.setStaticLocation(com.etherios.connector.core.system.Location)public byte[] getURL()
public java.lang.String getURLString()
IConnectorPreferencesIt should be PreferencesConstants.URL_US
(PreferencesConstants.URL_US) or
PreferencesConstants.URL_UK (PreferencesConstants.URL_UK).
getURLString in interface IConnectorPreferencesnull if not
configured.PreferencesConstants.URL_US,
PreferencesConstants.URL_UK,
IConnectorPreferences.setURLString(java.lang.String)public byte[] getVendorID()
IConnectorPreferencesgetVendorID in interface IConnectorPreferencesnull if not configured.public int getWaitTimes()
IConnectorPreferencesThe value should be:
times > PreferenceConstants.WAIT_TIMES_MINIMUM_VALUE
()times < PreferenceConstants.WAIT_TIMES_MAXIMUM_VALUE
()getWaitTimes in interface IConnectorPreferencesPreferencesConstants.DEFAULT_WAIT_TIMES
()
if not configured.PreferencesConstants.DEFAULT_WAIT_TIMES,
PreferencesConstants.WAIT_TIMES_MINIMUM_VALUE,
PreferencesConstants.WAIT_TIMES_MAXIMUM_VALUE,
IConnectorPreferences.setWaitTimes(int)public boolean isCompressionEnabled()
IConnectorPreferencesThe default value is returned if it is not configured
PreferencesConstants.DEFAULT_ENABLE_COMPRESSION
().
isCompressionEnabled in interface IConnectorPreferencestrue if messages compression is enabled, false
otherwise.PreferencesConstants.DEFAULT_ENABLE_COMPRESSION,
IConnectorPreferences.setCompressionEnabled(boolean)public boolean isDataServiceEnabled()
IConnectorPreferencesThe default value is returned if it is not configured
PreferencesConstants.DEFAULT_ENABLE_DATA_SERVICE
().
isDataServiceEnabled in interface IConnectorPreferencestrue if the data service is enabled, false
otherwise.PreferencesConstants.DEFAULT_ENABLE_DATA_SERVICEpublic boolean isFileSystemEnabled()
IConnectorPreferencesThe default value is returned if it is not configured
PreferencesConstants.DEFAULT_ENABLE_FILE_SYSTEM
().
isFileSystemEnabled in interface IConnectorPreferencestrue if file system is enabled, false otherwise.PreferencesConstants.DEFAULT_ENABLE_FILE_SYSTEM,
IConnectorPreferences.getFileSystemRootDir()public boolean isRCIEnabled()
IConnectorPreferencesThe default value is returned if it is not configured
PreferencesConstants.DEFAULT_ENABLE_RCI
().
isRCIEnabled in interface IConnectorPreferencestrue if RCI facility is enabled, false otherwise.PreferencesConstants.DEFAULT_ENABLE_RCIpublic boolean isReconnectEnabled()
IConnectorPreferencesThe default value is returned if it is not configured
PreferencesConstants.DEFAULT_ENABLE_RECONNECT
().
isReconnectEnabled in interface IConnectorPreferencestrue if reconnect setting is configured, false
otherwise.PreferencesConstants.DEFAULT_ENABLE_RECONNECT,
IConnectorPreferences.setReconnectEnabled(boolean),
IConnectorPreferences.getReconnectTime(),
IConnectorPreferences.setReconnectTime(int)public boolean isSecureConnectionEnabled()
IConnectorPreferencesThe default value is returned if it is not configured
PreferencesConstants.DEFAULT_ENABLE_SECURE_CONNECTION
().
isSecureConnectionEnabled in interface IConnectorPreferencestrue if secure connection is enabled, false
otherwise.PreferencesConstants.DEFAULT_ENABLE_SECURE_CONNECTION,
IConnectorPreferences.setSecureConnectionEnabled(boolean)public void setAuthorizationPassword(java.lang.String password)
IConnectorPreferencesPreferencesConstants.AUTHORIZATION_TYPE_BASIC
().setAuthorizationPassword in interface IConnectorPreferencespassword - New value for the authorization password setting.PreferencesConstants.AUTHORIZATION_TYPE_NONE,
PreferencesConstants.AUTHORIZATION_TYPE_BASIC,
IConnectorPreferences.getAuthorizationPassword(),
IConnectorPreferences.getAuthorizationType(),
IConnectorPreferences.setAuthorizationType(java.lang.String)public void setAuthorizationType(java.lang.String authorizationType)
IConnectorPreferencesIt should be PreferencesConstants.AUTHORIZATION_TYPE_NONE or
PreferencesConstants.AUTHORIZATION_TYPE_BASIC
().
For the PreferencesConstants.AUTHORIZATION_TYPE_BASIC
authorization type a password should be provided
IConnectorPreferences.getAuthorizationPassword().
setAuthorizationType in interface IConnectorPreferencesauthorizationType - Value of connection authorization type.PreferencesConstants.AUTHORIZATION_TYPE_NONE,
PreferencesConstants.AUTHORIZATION_TYPE_BASIC,
IConnectorPreferences.getAuthorizationType(),
IConnectorPreferences.getAuthorizationPassword(),
IConnectorPreferences.setAuthorizationPassword(java.lang.String)public void setCompressionEnabled(boolean enabled)
IConnectorPreferencessetCompressionEnabled in interface IConnectorPreferencesenabled - true to compress messages, false otherwise.IConnectorPreferences.isCompressionEnabled()public void setContact(java.lang.String contact)
IConnectorPreferencessetContact in interface IConnectorPreferencescontact - The Cloud Connector device contact setting.IConnectorPreferences.getContact()public void setDescription(java.lang.String description)
IConnectorPreferencessetDescription in interface IConnectorPreferencesdescription - The Cloud Connector device description setting.IConnectorPreferences.getDescription()public void setDeviceID(java.lang.String deviceID)
IConnectorPreferencesnull device ID.setDeviceID in interface IConnectorPreferencesdeviceID - Device ID to store.public void setKeepAliveTime(int time)
IConnectorPreferencesThe value should be:
time > PreferenceConstants.KEEP_ALIVE_MINIMUM_VALUE
()time < PreferenceConstants.KEEP_ALIVE_MAXIMUM_VALUE
()setKeepAliveTime in interface IConnectorPreferencestime - New value for the Keep Alive time setting.PreferencesConstants.DEFAULT_KEEP_ALIVE_TIME,
PreferencesConstants.KEEP_ALIVE_MINIMUM_VALUE,
PreferencesConstants.KEEP_ALIVE_MAXIMUM_VALUE,
IConnectorPreferences.getKeepAliveTime()public void setLocation(java.lang.String location)
IConnectorPreferencessetLocation in interface IConnectorPreferenceslocation - The Cloud Connector device location setting.IConnectorPreferences.getLocation()public void setReconnectEnabled(boolean enabled)
IConnectorPreferencessetReconnectEnabled in interface IConnectorPreferencesenabled - true to enable reconnect, false otherwise.IConnectorPreferences.isReconnectEnabled(),
IConnectorPreferences.getReconnectTime(),
IConnectorPreferences.setReconnectTime(int)public void setReconnectTime(int time)
IConnectorPreferencesThe value should be:
time > PreferenceConstants.RECONNECT_TIME_MINIMUM_VALUE
()time < PreferenceConstants.RECONNECT_TIME_MAXIMUM_VALUE
()setReconnectTime in interface IConnectorPreferencestime - New value for the reconnect time setting.PreferencesConstants.DEFAULT_RECONNECT_TIME,
PreferencesConstants.RECONNECT_TIME_MINIMUM_VALUE,
PreferencesConstants.RECONNECT_TIME_MAXIMUM_VALUE,
PreferencesConstants.RECONNECT_TIME_MAX_RANDOM,
IConnectorPreferences.getReconnectTime(),
IConnectorPreferences.isReconnectEnabled(),
IConnectorPreferences.setReconnectEnabled(boolean)public void setSecureConnectionEnabled(boolean value)
IConnectorPreferencessetSecureConnectionEnabled in interface IConnectorPreferencesvalue - true to enable secure connection, false
otherwise.IConnectorPreferences.isSecureConnectionEnabled()public void setServerKeepAliveTime(int time)
IConnectorPreferencesThe value should be:
time > PreferenceConstants.KEEP_ALIVE_MINIMUM_VALUE
()time < PreferenceConstants.KEEP_ALIVE_MAXIMUM_VALUE
()setServerKeepAliveTime in interface IConnectorPreferencestime - New value for the Server Keep Alive time setting.PreferencesConstants.DEFAULT_SERVER_KEEP_ALIVE_TIME,
IConnectorPreferences.getServerKeepAliveTime()public void setStaticLocation(Location location)
IConnectorPreferencessetStaticLocation in interface IConnectorPreferenceslocation - The static location value.IConnectorPreferences.useStaticLocation(),
IConnectorPreferences.setUseStaticLocation(boolean),
IConnectorPreferences.getStaticLocation()public void setURLString(java.lang.String url)
IConnectorPreferencesIt should be PreferencesConstants.URL_US
(PreferencesConstants.URL_US) or
PreferencesConstants.URL_UK (PreferencesConstants.URL_UK).
setURLString in interface IConnectorPreferencesurl - The new Cloud Connector URL.PreferencesConstants.URL_US,
PreferencesConstants.URL_UK,
IConnectorPreferences.getURLString()public void setUseStaticLocation(boolean useStaticLocation)
IConnectorPreferencessetUseStaticLocation in interface IConnectorPreferencesuseStaticLocation - true to use static location,
false otherwise.IConnectorPreferences.useStaticLocation(),
IConnectorPreferences.getStaticLocation(),
IConnectorPreferences.setStaticLocation(com.etherios.connector.core.system.Location)public void setVendorID(java.lang.String vendorID)
IConnectorPreferencessetVendorID in interface IConnectorPreferencesvendorID - The Cloud Connector VendorID setting.public void setWaitTimes(int waitTimes)
IConnectorPreferencesThe value should be:
times > PreferenceConstants.WAIT_TIMES_MINIMUM_VALUE
()times < PreferenceConstants.WAIT_TIMES_MAXIMUM_VALUE
()setWaitTimes in interface IConnectorPreferenceswaitTimes - New value of the wait times setting.PreferencesConstants.WAIT_TIMES_MINIMUM_VALUE,
PreferencesConstants.WAIT_TIMES_MAXIMUM_VALUE,
IConnectorPreferences.getWaitTimes()public boolean useStaticLocation()
IConnectorPreferencesThe default value is returned if it is not configured
PreferencesConstants.DEFAULT_USE_STATIC_LOCATION
().
useStaticLocation in interface IConnectorPreferencestrue if static location will be used, false
otherwise.PreferencesConstants.DEFAULT_USE_STATIC_LOCATION,
IConnectorPreferences.setUseStaticLocation(boolean),
IConnectorPreferences.getStaticLocation(),
IConnectorPreferences.setStaticLocation(com.etherios.connector.core.system.Location)© Copyright 2014 Etherios, Inc. All rights reserved. Etherios, Inc. is a Division of Digi International Inc.