public abstract class AbstractCloudConnector
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_NUMBER_OF_DATA_POINTS_PER_PACKAGE
Maximum number of data points that can be sent in just one package: 250.
|
static int |
MAX_SIZE_OF_BINARY_DATA_POINTS_KB
Maximum size of binary data points allowed: 64 KB.
|
static int |
MAX_SIZE_OF_DEVICE_REQUESTS_REPLIES_KB
Maximum size of replies to Device Requests: 2048 KB.
|
static int |
MAX_SIZE_OF_SEND_DATA_REQUEST_KB
Maximum size of send data requests: 2048 KB.
|
| Constructor and Description |
|---|
AbstractCloudConnector(INetworkImplementation networkImpl,
ISystemImplementation systemImpl,
IConnectorPreferences connectorPreferences,
ConnectorLogger connectorLogger,
IRCIExtension rciExtension,
IFileSystemImplementation fileSystemImpl,
IFirmwareUpdateImplementation fwUpdateImpl)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortFirmwareUpdate(int reason)
Aborts the firmware update process.
|
void |
appendDataToRemoteFile(java.io.InputStream inputStream,
java.lang.String destPath,
java.lang.String contentType)
Appends the data in the input stream to the given destination file in
Device Cloud.
|
void |
appendDataToRemoteFile(java.lang.String text,
java.lang.String destPath)
Appends a string to the given destination text file in Device Cloud.
|
void |
deRegisterEventsListener(EventsListener eventsListener)
Removes the given Cloud Connector events listener from the list of
listeners.
|
abstract java.lang.String |
getConnectorVersion()
Retrieves the Cloud Connector version.
|
java.lang.String |
getDeviceID()
Retrieves the device ID associated with this connector.
|
IDeviceRequestListener |
getDeviceRequestListener()
Retrieves the Cloud Connector device request listener.
|
ListenerList |
getEventsListenersList()
Returns the list of Cloud Connector events listeners.
|
java.util.List<FirmwareTarget> |
getFirmwareTargets()
Retrieves a list of the available firmware targets.
|
ConnectorLogger |
getLogger()
Retrieves the logger used to log messages from Cloud Connector.
|
ConnectorNetworkManager |
getNetworkManager()
Retrieves the Cloud Connector network manager.
|
ConnectorPreferencesManager |
getPreferencesManager()
Retrieves the Cloud Connector preferences manager.
|
com.etherios.connector.core.RestrictionLevel |
getRestrictionLevel()
Retrieves the Cloud Connector restriction level.
|
long |
getRXBytes()
Retrieves the total bytes read by Cloud Connector.
|
java.lang.String |
getStorageRootDir()
Retrieves the directory path where file system storage root point is
located.
|
ConnectorSystemManager |
getSystemManager()
Retrieves the Cloud Connector system manager.
|
long |
getTXBytes()
Retrieves the total bytes written by Cloud Connector.
|
byte[] |
getVendorID()
Retrieves the vendor ID associated with this connector.
|
boolean |
isConnected()
Retrieves whether Cloud Connector is running or not.
|
boolean |
isStarting()
Retrieves whether Cloud Connector is starting or not.
|
void |
notifyEvent(Event event)
Notifies to the events listener that an event has occurred in
Cloud Connector.
|
void |
registerDeviceRequestListener(IDeviceRequestListener deviceRequestListener)
Registers the device request listener object used to be notified of
incoming device requests for any target.
|
void |
registerEventsListener(EventsListener eventsListener)
Registers the events listener to be used to be notified of Cloud
Connector events.
|
void |
resetRXBytes()
Resets the total bytes read by Cloud Connector.
|
void |
resetTXBytes()
Resets the total bytes written by Cloud Connector.
|
void |
sendBinaryDataPoint(BinaryDataPoint binaryDataPoint)
Sends to Device Cloud the given binary data point following the binary
concise alternative format.
|
void |
sendDataPoint(DataPoint dataPoint)
Sends to Device Cloud the given data point.
|
void |
sendDataPoint(java.util.List<DataPoint> dataPoints)
Sends to Device Cloud the given list of data points.
|
void |
sendDataToRemoteFile(java.io.InputStream inputStream,
java.lang.String destPath,
java.lang.String contentType)
Sends the data in the input stream to the given destination file in
Device Cloud.
|
void |
sendDataToRemoteFile(java.lang.String text,
java.lang.String destPath)
Sends a string to the given destination text file in Device Cloud.
|
void |
start()
Starts Cloud Connector.
|
void |
stop()
Stops Cloud Connector.
|
void |
updateDataCompressionStrategy()
This method updates the compression strategy based on the device enabled
compression algorithms.
|
public static final int MAX_NUMBER_OF_DATA_POINTS_PER_PACKAGE
public static final int MAX_SIZE_OF_BINARY_DATA_POINTS_KB
public static final int MAX_SIZE_OF_DEVICE_REQUESTS_REPLIES_KB
public static final int MAX_SIZE_OF_SEND_DATA_REQUEST_KB
public AbstractCloudConnector(INetworkImplementation networkImpl, ISystemImplementation systemImpl, IConnectorPreferences connectorPreferences, ConnectorLogger connectorLogger, IRCIExtension rciExtension, IFileSystemImplementation fileSystemImpl, IFirmwareUpdateImplementation fwUpdateImpl)
networkImpl - Object implementing INetworkImplementation interface in charge of managing all network methods
that are system/OS dependent.systemImpl - Object implementing ISystemImplementation interface in charge of managing all system methods
that are OS dependent.connectorPreferences - Object implementing IConnectorPreferences interface in charge of managing all connector
preferences that are system/OS dependent.connectorLogger - Object extending the ConnectorLogger class in charge of logging all connector
messages.rciExtension - Object implementing IRCIExtension interface in charge of managing all RCI hooks
that are user defined.fileSystemImpl - Object implementing IFileSystemImplementation interface in charge of managing all
file system service actions.fwUpdateImpl - Object implementing the IFirmwareUpdateImplementation interface in charge of manage
the system specific methods while updating the device firmware.public void abortFirmwareUpdate(int reason)
reason - Reason of the abort.public void appendDataToRemoteFile(java.io.InputStream inputStream,
java.lang.String destPath,
java.lang.String contentType)
The input stream is closed after sending the data.
inputStream - Input stream containing data to be append to the given
file in Device Cloud.destPath - Path and name of the file to append the data.contentType - File content type.java.lang.IllegalArgumentException - if inputStream == nulljava.lang.RuntimeException - if !isConnected()public void appendDataToRemoteFile(java.lang.String text,
java.lang.String destPath)
text - Text to be appended to the text file.destPath - Path and name of the file to append the text in the
Device Cloud storage.java.lang.IllegalArgumentException - if text == nulljava.lang.RuntimeException - if !isConnected()public void deRegisterEventsListener(EventsListener eventsListener)
eventsListener - Listener to be removed.public abstract java.lang.String getConnectorVersion()
public java.lang.String getDeviceID()
public IDeviceRequestListener getDeviceRequestListener()
public ListenerList getEventsListenersList()
public java.util.List<FirmwareTarget> getFirmwareTargets()
The Firmware Access facility allows to update the firmware for any processors by having them registered as targets. The client can define any given segment of code as a target, and therefore update sections of code indexed by the target number assigned to it.
FirmwareTargetpublic ConnectorLogger getLogger()
public ConnectorNetworkManager getNetworkManager()
public ConnectorPreferencesManager getPreferencesManager()
public com.etherios.connector.core.RestrictionLevel getRestrictionLevel()
public long getRXBytes()
public java.lang.String getStorageRootDir()
Used mainly by the File System service. It may be null if the file system is not enabled in the Cloud Connector configuration.
public ConnectorSystemManager getSystemManager()
public long getTXBytes()
public byte[] getVendorID()
public boolean isConnected()
public boolean isStarting()
public void notifyEvent(Event event)
event - Event to to notify.public void registerDeviceRequestListener(IDeviceRequestListener deviceRequestListener)
deviceRequestListener - Device request listener object used to be
notified of incoming device requests for
any target.public void registerEventsListener(EventsListener eventsListener)
This method has no effect if the same listener is already registered.
eventsListener - Events listener object to be notified of Cloud
Connector events.public void resetRXBytes()
public void resetTXBytes()
public void sendBinaryDataPoint(BinaryDataPoint binaryDataPoint)
The size of the byte array to be sent should be less than 64 KB.
The associated DataStream attributes obtained with
getUnits() and getForwardTo() will not be used in the
binary concise alternative format, although they are specified.
binaryDataPoint - The binary data point to be sent.java.lang.IllegalArgumentException - if binaryDataPoint == null or
if the binary value to be sent is > MAX_SIZE_OF_BINARY_DATA_POINTS_KBpublic void sendDataPoint(DataPoint dataPoint)
dataPoint - The data point to be sent.java.lang.IllegalArgumentException - if dataPoint == null.public void sendDataPoint(java.util.List<DataPoint> dataPoints)
dataPoints - The list of data points to be sent.java.lang.IllegalArgumentException - if dataPoints == null or
if dataPoints.isEmpty() or
if dataPoints.size() > MAX_NUMBER_OF_DATA_POINTS_PER_PACKAGEjava.lang.RuntimeException - if !isConnected()MAX_NUMBER_OF_DATA_POINTS_PER_PACKAGEpublic void sendDataToRemoteFile(java.io.InputStream inputStream,
java.lang.String destPath,
java.lang.String contentType)
If the destination file already exists it will be overwrote.
The input stream is closed after sending the data.
inputStream - Input stream containing data to be stored in Device
Cloud.destPath - Path and name of the file to store the data in
Device Cloud.contentType - File content type.java.lang.IllegalArgumentException - if inputStream == nulljava.lang.RuntimeException - if !isConnected()public void sendDataToRemoteFile(java.lang.String text,
java.lang.String destPath)
If the destination file already exists it will be overwrote.
text - Text to be written in the text file.destPath - Path and name of the file to be stored in the Device
Cloud storage.java.lang.IllegalArgumentException - if text == nulljava.lang.RuntimeException - if !isConnected()public void start()
public void stop()
public void updateDataCompressionStrategy()
© Copyright 2014 Etherios, Inc. All rights reserved. Etherios, Inc. is a Division of Digi International Inc.