CPP Device Virtualization API Reference for Oracle Internet of Things Cloud Service Client Software Library. Release 21.1.1.0.0-3. E92477-09
|
Public Member Functions | |
virtual | ~StorageObject () |
Destructor. | |
virtual const std::string & | getName () const |
Get the the name of this object in the storage cloud. More... | |
virtual const std::string & | getType () const |
Get the mime-type of the content. More... | |
virtual const std::string & | getEncoding () const |
Get the compression scheme of the content. More... | |
virtual long | getLength () const |
Get the length of the content in bytes. More... | |
virtual time_t | getDate () const |
Get the date and time the content was created or last modified in cloud storage. More... | |
virtual SyncStatus | getSyncStatus () const |
Get the status of whether or not the content is in sync with the storage cloud. More... | |
virtual const std::string & | getInputPath () const |
Get the input path. More... | |
virtual void | setInputPath (const std::string &inputPath) throw (GeneralException, std::invalid_argument) |
Set the input path for uploading content to the storage cloud. More... | |
virtual const std::string & | getOutputPath () const |
Get the output path. More... | |
virtual void | setOutputPath (const std::string &outputPath) throw (GeneralException, std::invalid_argument) |
Set the output path for downloading content from the storage cloud. More... | |
virtual void | setCustomMetadata (const std::string &key, const std::string &value) throw (std::invalid_argument) |
Sets the metadata for the StorageObject. More... | |
virtual void | sync () throw (GeneralException, std::invalid_argument) |
Notify the library to sync content with the storage cloud. More... | |
virtual void | setOnSync (const SyncCallback *callback) |
Set a iotdcl::SyncCallback that is invoked when the content referred to by this StorageObject is synchronized. More... | |
virtual const std::string & | getURI () |
Get the URI value. More... | |
Public Member Functions inherited from iotdcl::ExternalObject | |
virtual | ~ExternalObject () |
Destructor. | |
ExternalObject (const std::string &uri) | |
Create an iotdcl::ExternalObject. More... | |
virtual const std::string & | getURI () const |
Get the URI value. More... | |
Protected Member Functions | |
void | setVirtualDevice (VirtualDevice *vd) |
iotcs_storage_object_handle | c_handler () const |
Protected Attributes | |
VirtualDevice * | vd |
std::string * | name |
std::string * | outPath |
std::string * | inPath |
std::string * | type |
std::string * | encoding |
friend | VirtualDevice |
friend | Alert |
friend | Data |
Protected Attributes inherited from iotdcl::ExternalObject | |
std::string * | uri |
iotcs_storage_object_handle | storage_object_handle |
|
virtual |
Get the date and time the content was created or last modified in cloud storage.
This may be NULL if the content has not been uploaded. The date and time stamp format is ISO 8601.
|
virtual |
Get the compression scheme of the content.
|
virtual |
Get the input path.
|
virtual |
Get the length of the content in bytes.
This is the number of bytes required to upload or download the content.
|
virtual |
Get the the name of this object in the storage cloud.
|
virtual |
Get the output path.
|
virtual |
Get the status of whether or not the content is in sync with the storage cloud.
|
virtual |
|
virtual |
Get the URI value.
|
virtual |
Sets the metadata for the StorageObject.
All metdata will be added to Storage Cloud Service as custom metadata with the "X-Object-Meta-KeyName" header.
key | The metadata key |
value | The metadata value |
std::invalid_argument | if the key or value is empty |
std::invalid_argument | if the key or value is NULL
|
|
virtual |
Set the input path for uploading content to the storage cloud.
The implementation allows for either the input path to be set, or the output path to be set, but not both. If the inputPath parameter is not empty, the output path will empty If the inputPath parameter is not empty and does not equal the current input path, the sync status will be reset to SyncStatus::NOT_IN_SYNC}. This method will throw an std::invalid_argument if StorageObject::getSyncStatus() sync status is SyncStatus::SYNC_PENDING},
inputPath | the path from which to read the content for upload |
iotdcl::GeneralException | if the output path cannot be written |
std::invalid_argument | if called when sync status is iotdcl::SyncStatus::SYNC_PENDING |
|
virtual |
Set a iotdcl::SyncCallback that is invoked when the content referred to by this StorageObject is synchronized.
callback | a callback to invoke when there is an error setting a value, if NULL, the existing syncCallback will be removed |
|
virtual |
Set the output path for downloading content from the storage cloud.
The implementation allows for either the output path to be set, or the input path to be set, but not both. If the outputPath parameter is not empty, the input path will be set to empty. If the outputPath parameter is not empty and does not equal the current output path, the sync status will be reset to iotdcl::SyncStatus::NOT_IN_SYNC. This method will throw an std::invalid_argument if the StorageObject.getSyncStatus() sync status is iotdcl::SyncStatus::SYNC_PENDING,
outputPath | the path to which the content will be downloaded. If the path does not already exist, it will be created. |
iotdcl::GeneralException | if the output path cannot be written |
std::invalid_argument | if called when sync status is iotdcl::SyncStatus::SYNC_PENDING |
|
virtual |
Notify the library to sync content with the storage cloud.
The direction of the sync, upload or download, depends on whether the setInputPath(std::string) input path or the setOutputPath(std::string) output path} has been set. This method does not start any uploads or downloads if getSyncStatus() sync status is other than iotdcl::SyncStatus::NOT_IN_SYNC.
This is a non-blocking call. The sync is performed on a separate thread. The status of the sync can be monitored by setting a iotdcl::SyncCallback on this StorageObject.
If the input path cannot be read, or the output path cannot be written, an iotdcl::GeneralException is thrown. Any I/O exceptions during the background sync are reported through the iotdcl::ErrorCallback error syncCallback} of the virtual device.
std::invalid_argument | if both input path and output path are empty |