SDK  2.1.4
CloudBackend Software Development Kit - SDK API for C++
cbe::Object Class Reference

Holder of a set of data, can represent a table row. More...

#include <Object.h>

Inheritance diagram for cbe::Object:
Collaboration diagram for cbe::Object:

Public Types

using MoveDelegatePtr = delegate::object::MoveDelegatePtr
 
using MoveException = delegate::object::MoveDelegate::Exception
 
using MoveError = delegate::object::MoveDelegate::ErrorInfo
 
using RenameDelegatePtr = delegate::object::RenameDelegatePtr
 
using RenameException = delegate::object::RenameDelegate::Exception
 
using RenameError = delegate::object::RenameDelegate::ErrorInfo
 
using RemoveDelegatePtr = delegate::object::RemoveDelegatePtr
 
using RemoveException = delegate::object::RemoveDelegate::Exception
 
using RemoveError = delegate::object::RemoveDelegate::ErrorInfo
 
using DownloadDelegatePtr = delegate::DownloadDelegatePtr
 
using DownloadException = delegate::DownloadDelegate::Exception
 
using DownloadError = delegate::DownloadDelegate::ErrorInfo
 
using DownloadBinaryDelegatePtr = delegate::DownloadBinaryDelegatePtr
 
using DownloadBinaryException = delegate::DownloadBinaryDelegate::Exception
 
using DownloadBinaryError = delegate::DownloadBinaryDelegate::ErrorInfo
 
using UploadDelegatePtr = delegate::UploadDelegatePtr
 
using UploadException = delegate::UploadDelegate::Exception
 
using UploadError = delegate::UploadDelegate::ErrorInfo
 
using UpdateKeyValuesDelegatePtr = delegate::UpdateKeyValuesDelegatePtr
 
using UpdateKeyValuesException = delegate::UpdateKeyValuesDelegate::Exception
 
using UpdateKeyValuesError = delegate::UpdateKeyValuesDelegate::ErrorInfo
 
using GetStreamsDelegatePtr = delegate::GetStreamsDelegatePtr
 
using Streams = cbe::Streams
 Collection of Stream objects. More...
 
using GetStreamsException = delegate::GetStreamsDelegate::Exception
 
using GetStreamsError = delegate::GetStreamsDelegate::ErrorInfo
 
using GetAclDelegatePtr = delegate::AclDelegatePtr
 
using GetAclException = delegate::AclDelegate::Exception
 
using GetAclError = delegate::AclDelegate::ErrorInfo
 
using SetAclDelegatePtr = delegate::AclDelegatePtr
 
using SetAclException = delegate::AclDelegate::Exception
 
using SetAclError = delegate::AclDelegate::ErrorInfo
 
using ShareDelegatePtr = delegate::ShareDelegatePtr
 
using ShareException = delegate::ShareDelegate::Exception
 
using ShareError = delegate::ShareDelegate::ErrorInfo
 
using UnShareDelegatePtr = delegate::UnShareDelegatePtr
 
using UnShareException = delegate::UnShareDelegate::Exception
 
using UnShareError = delegate::UnShareDelegate::ErrorInfo
 
using PublishDelegatePtr = delegate::PublishDelegatePtr
 
using PublishException = delegate::PublishDelegate::Exception
 
using PublishError = delegate::PublishDelegate::ErrorInfo
 
using UnPublishDelegatePtr = delegate::UnPublishDelegatePtr
 
using UnPublishException = delegate::UnPublishDelegate::Exception
 
using UnPublishError = delegate::UnPublishDelegate::ErrorInfo
 
using UnSubscribeDelegatePtr = delegate::UnSubscribeDelegatePtr
 
using UnSubscribeException = delegate::UnSubscribeDelegate::Exception
 
using UnSubscribeError = delegate::UnSubscribeDelegate::ErrorInfo
 

Public Member Functions

void move (cbe::ContainerId dstId, MoveDelegatePtr delegate)
 Relocates an object to a different container. More...
 
cbe::Object move (cbe::ContainerId dstId)
 
cbe::util::Optional< cbe::Objectmove (cbe::ContainerId dstId, MoveError &error)
 
void rename (const std::string &name, RenameDelegatePtr delegate)
 Rename object. More...
 
cbe::Object rename (const std::string &name)
 
cbe::util::Optional< cbe::Objectrename (const std::string &name, RenameError &error)
 
void remove (RemoveDelegatePtr delegate)
 Remove the object from cloud and locally. More...
 
delegate::object::RemoveSuccess remove ()
 
cbe::util::Optional< delegate::object::RemoveSuccessremove (RemoveError &error)
 
void download (const std::string &path, DownloadDelegatePtr delegate)
 Download the data of current object to the the local file system. More...
 
delegate::DownloadSuccess download (const std::string &path, delegate::ProgressEventFn &&progressEventFn)
 
delegate::DownloadSuccess download (const std::string &path)
 
cbe::util::Optional< delegate::DownloadSuccessdownload (const std::string &path, delegate::ProgressEventFn &&progressEventFn, DownloadError &error)
 
cbe::util::Optional< delegate::DownloadSuccessdownload (const std::string &path, DownloadError &error)
 
void download (std::size_t &&sizeLimit, DownloadBinaryDelegatePtr delegate)
 Download the binary data associated with current object. More...
 
delegate::DownloadBinarySuccess download (std::size_t &&sizeLimit, delegate::ProgressEventFn &&progressEventFn)
 
delegate::DownloadBinarySuccess download (std::size_t &&sizeLimit)
 
cbe::util::Optional< delegate::DownloadBinarySuccessdownload (std::size_t &&sizeLimit, delegate::ProgressEventFn &&progressEventFn, DownloadBinaryError &error)
 
cbe::util::Optional< delegate::DownloadBinarySuccessdownload (std::size_t &&sizeLimit, DownloadBinaryError &error)
 
void downloadStream (const std::string &path, cbe::Stream stream, DownloadDelegatePtr delegate)
 
delegate::DownloadSuccess downloadStream (const std::string &path, cbe::Stream stream, delegate::ProgressEventFn &&progressEventFn)
 
delegate::DownloadSuccess downloadStream (const std::string &path, cbe::Stream stream)
 
cbe::util::Optional< delegate::DownloadSuccessdownloadStream (const std::string &path, cbe::Stream stream, delegate::ProgressEventFn &&progressEventFn, DownloadError &error)
 
cbe::util::Optional< delegate::DownloadSuccessdownloadStream (const std::string &path, cbe::Stream stream, DownloadError &error)
 
void uploadStream (const std::string &filePath, cbe::StreamId streamId, UploadDelegatePtr delegate)
 Upload a file for adding a new or replacing existing stream attached to this object. More...
 
cbe::Object uploadStream (const std::string &filePath, cbe::StreamId streamId, delegate::ProgressEventFn &&progressEventFn)
 
cbe::Object uploadStream (const std::string &filePath, cbe::StreamId streamId)
 
cbe::util::Optional< cbe::ObjectuploadStream (const std::string &filePath, cbe::StreamId streamId, delegate::ProgressEventFn &&progressEventFn, UploadError &error)
 
cbe::util::Optional< cbe::ObjectuploadStream (const std::string &filePath, cbe::StreamId streamId, UploadError &error)
 
void updateKeyValues (KeyValues keyValues, UpdateKeyValuesDelegatePtr delegate)
 Adds key/value pair data to the object. More...
 
void updateKeyValues (UpdateKeyValuesDelegatePtr delegate)
 Deletes all key/value pairs of data to the object. More...
 
cbe::Object updateKeyValues (KeyValues keyValues)
 Synchronous [exception] Adds key/value pair data to the object. More...
 
cbe::Object updateKeyValues ()
 Synchronous [exception] Deletes all key/value pairs of data to the object. More...
 
cbe::util::Optional< cbe::ObjectupdateKeyValues (KeyValues keyValues, UpdateKeyValuesError &error)
 Synchronous [non-throwing] Adds key/value pair data to the object. More...
 
cbe::util::Optional< cbe::ObjectupdateKeyValues (UpdateKeyValuesError &error)
 Synchronous [non-throwing] Deletes all key/value pairs of data to the object. More...
 
void getStreams (GetStreamsDelegatePtr delegate)
 Downloads the streams meta data associated with current object to the SDK's cache. More...
 
Streams getStreams ()
 
cbe::util::Optional< StreamsgetStreams (GetStreamsError &error)
 
std::string getMimeType () const
 Returns the mime type of the object. More...
 
uint64_t length () const
 Returns the binary length/size in bytes of current object.
 
cbe::object_t getObjectType () const
 Returns the Object type. More...
 
cbe::KeyValues keyValues ()
 Returns all the key/values for current object as a map.
 
void getAcl (GetAclDelegatePtr delegate)
 Returns the Access Control List for current Object. More...
 
cbe::AclMap getAcl ()
 
cbe::util::Optional< cbe::AclMapgetAcl (GetAclError &error)
 
void setAcl (cbe::AclMap aclMap, SetAclDelegatePtr delegate)
 Sets the Access Control List for current object. More...
 
cbe::AclMap setAcl (cbe::AclMap aclMap)
 
cbe::util::Optional< cbe::AclMapsetAcl (cbe::AclMap aclMap, SetAclError &error)
 
void share (cbe::UserId toUserGroup, std::string description, ShareDelegatePtr delegate)
 Share current object to a user. More...
 
delegate::ShareSuccess share (cbe::UserId toUserGroup, std::string description)
 
cbe::util::Optional< delegate::ShareSuccessshare (cbe::UserId toUserGroup, std::string description, ShareError &error)
 
void unShare (cbe::ShareId shareId, UnShareDelegatePtr delegate)
 Unshare the object to a specific shareId created when sharing. More...
 
delegate::UnShareSuccess unShare (cbe::ShareId shareId)
 
cbe::util::Optional< delegate::UnShareSuccessunShare (cbe::ShareId shareId, UnShareError &error)
 
void publish (cbe::PublishAccess security, cbe::PublishVisibility privacy, std::string description, std::string password, PublishDelegatePtr delegate)
 Publishes current object to any user. More...
 
delegate::PublishSuccess publish (cbe::PublishAccess security, cbe::PublishVisibility privacy, std::string description, std::string password)
 
cbe::util::Optional< delegate::PublishSuccesspublish (cbe::PublishAccess security, cbe::PublishVisibility privacy, std::string description, std::string password, PublishError &error)
 
void unPublish (UnPublishDelegatePtr delegate)
 UnPublishes current object. More...
 
delegate::UnPublishSuccess unPublish ()
 
cbe::util::Optional< delegate::UnPublishSuccessunPublish (UnPublishError &error)
 
void unSubscribe (UnSubscribeDelegatePtr delegate)
 UnSubscribes from this object. More...
 
delegate::UnSubscribeSuccess unSubscribe ()
 
cbe::util::Optional< delegate::UnSubscribeSuccessunSubscribe (UnSubscribeError &error)
 
std::string url ()
 URL to current object.
 
 Object (cbe::DefaultCtor)
 
- Public Member Functions inherited from cbe::Item
cbe::ShareIds getShareIds () const
 
cbe::ShareId getShareFromUserId (cbe::UserId userId)
 
cbe::UserId getUserFromShareId (cbe::UserId shareId)
 
std::string aclTag () const
 
std::string description () const
 
cbe::ItemId id () const
 
cbe::ContainerId parentId () const
 
cbe::ContainerId oldParentId () const
 
std::string name () const
 
std::string path () const
 
cbe::UserId ownerId () const
 
cbe::ContainerId driveId () const
 
std::string username () const
 
bool idLoaded () const
 
bool dataLoaded () const
 
cbe::Date created () const
 
cbe::Date updated () const
 
cbe::Date deleted () const
 
cbe::ItemType type () const
 
bool hasPublished () const
 
Publish getPublished () const
 
bool hasSubscribe () const
 
Subscribe getSubscribe () const
 
bool operator< (const cbe::Item &rh) const
 
AclMap aclMap () const
 
 operator bool () const
 Checks if the inherited instance is real. More...
 

Friends

class CloudBackend
 
class Container
 

Additional Inherited Members

- Protected Member Functions inherited from cbe::Item
 Item (std::shared_ptr< Impl > pImpl)
 
template<class ImplT >
ImplT & castImpl () const
 

Detailed Description

Holder of a set of data, can represent a table row.

Note
The object name may not contain characters < & : /
Any key name must start with a letter or _
The following key names are reserved and should not be used: category, content, id, link and date
Key names are case sensitive, hence variations with uppercase are permitted.

Member Typedef Documentation

◆ MoveDelegatePtr

Pointer to cbe::delegate::object::MoveDelegate that is passed into asynchronous version of method move()

◆ MoveException

◆ MoveError

Forms the type of the error return parameter for the synchronous version of method move()
See delegate::object::MoveDelegate::ErrorInfo

◆ RenameDelegatePtr

Pointer to cbe::delegate::object::RenameDelegate that is passed into asynchronous version of method rename()

◆ RenameException

◆ RenameError

Forms the type of the error return parameter for the synchronous version of method rename()
See delegate::object::RenameDelegate::ErrorInfo

◆ RemoveDelegatePtr

Pointer to cbe::delegate::object::RenameDelegate that is passed into asynchronous version of method remove()

◆ RemoveException

◆ RemoveError

Forms the type of the error return parameter for the synchronous version of method remove()
See delegate::object::RemoveDelegate::ErrorInfo

◆ DownloadDelegatePtr

◆ DownloadException

◆ DownloadError

◆ DownloadBinaryDelegatePtr

Pointer to cbe::delegate::DownloadBinaryDelegate that is passed into asynchronous version of method download()

◆ DownloadBinaryException

◆ DownloadBinaryError

Forms the type of the error return parameter for the synchronous version of methods:

  • download(delegate::ProgressEventFn&&,DownloadBinaryError&)
  • download(DownloadBinaryError&)


See delegate::DownloadBinaryDelegate::ErrorInfo

◆ UploadDelegatePtr

Pointer to cbe::delegate::UploadDelegate that is passed into asynchronous version of method uploadStream()

◆ UploadException

See delegate::object::UploadDelegate::Exception

◆ UploadError

◆ UpdateKeyValuesDelegatePtr

Pointer to cbe::delegate::UpdateKeyValuesDelegate that is passed into asynchronous version of method updateKeyValues()

◆ UpdateKeyValuesException

See delegate::object::UpdateKeyValuesDelegate::Exception

◆ UpdateKeyValuesError

Forms the type of the error return parameter for the synchronous version of method updateKeyValues()
See delegate::UpdateKeyValuesDelegate::ErrorInfo

◆ GetStreamsDelegatePtr

Pointer to cbe::delegate::GetStreamsDelegate that is passed into asynchronous version of method getStream()

◆ Streams

Collection of Stream objects.

See cbe::Streams

◆ GetStreamsException

◆ GetStreamsError

Forms the type of the error return parameter for the synchronous version of method getStreams(GetStreamsError&)
See delegate::GetStreamsDelegate::ErrorInfo

◆ GetAclDelegatePtr

Pointer to cbe::delegate::AclDelegate that is passed into asynchronous version of method getAcl()

◆ GetAclException

See delegate::object::AclDelegate::Exception

◆ GetAclError

Forms the type of the error return parameter for the synchronous version of method getAcl()
See delegate::AclDelegate::ErrorInfo

◆ SetAclDelegatePtr

Pointer to cbe::delegate::AclDelegate that is passed into asynchronous version of method setAcl()

◆ SetAclException

See delegate::object::AclDelegate::Exception

◆ SetAclError

Forms the type of the error return parameter for the synchronous version of method setAcl()
See delegate::AclDelegate::ErrorInfo

◆ ShareDelegatePtr

Pointer to cbe::delegate::ShareDelegate that is passed into asynchronous version of method share()

◆ ShareException

See delegate::object::ShareDelegate::Exception

◆ ShareError

Forms the type of the error return parameter for the synchronous version of method share()
See delegate::ShareDelegate::ErrorInfo

◆ UnShareDelegatePtr

Pointer to cbe::delegate::UnShareDelegate that is passed into asynchronous version of method unShare()

◆ UnShareException

See delegate::object::UnShareDelegate::Exception

◆ UnShareError

Forms the type of the error return parameter for the synchronous version of method unShare()
See delegate::UnShareDelegate::ErrorInfo

◆ PublishDelegatePtr

Pointer to cbe::delegate::PublishDelegate that is passed into asynchronous version of method publish()

◆ PublishException

See delegate::object::PublishDelegate::Exception

◆ PublishError

Forms the type of the error return parameter for the synchronous version of method publish()
See delegate::PublishDelegate::ErrorInfo

◆ UnPublishDelegatePtr

Pointer to cbe::delegate::UnPublishDelegate that is passed into asynchronous version of method unPublish()

◆ UnPublishException

See delegate::object::UnPublishDelegate::Exception

◆ UnPublishError

Forms the type of the error return parameter for the synchronous version of method unPublish()
See delegate::UnPublishDelegate::ErrorInfo

◆ UnSubscribeDelegatePtr

◆ UnSubscribeException

See delegate::object::UnSubscribeDelegate::Exception

◆ UnSubscribeError

Forms the type of the error return parameter for the synchronous version of method unSubscribe()
See delegate::UnSubscribeDelegate::ErrorInfo

Member Function Documentation

◆ move() [1/3]

void cbe::Object::move ( cbe::ContainerId  dstId,
MoveDelegatePtr  delegate 
)

Relocates an object to a different container.

Asynchronous version of this service function.

Parameters
dstIdId of the destination container.
delegatePointer to a delegate::object::MoveDelegate instance that is implemented by the user.

◆ move() [2/3]

cbe::Object cbe::Object::move ( cbe::ContainerId  dstId)

Synchronous version of move(cbe::ContainerId,MoveDelegatePtr) , and throws an exception, MoveException, in case of a failed call.
See move(cbe::ContainerId,MoveDelegatePtr)

Returns
The moved object — if the call was successful.
Exceptions
MoveException

◆ move() [3/3]

cbe::util::Optional<cbe::Object> cbe::Object::move ( cbe::ContainerId  dstId,
MoveError error 
)

Synchronous version of move(cbe::ContainerId,MoveDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See move(cbe::ContainerId,MoveDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the MoveError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ rename() [1/3]

void cbe::Object::rename ( const std::string &  name,
RenameDelegatePtr  delegate 
)

Rename object.

Asynchronous version of this service function.

Parameters
namestring name of the object.
delegatePointer to a delegate::object::RenameDelegate instance that is implemented by the user.

◆ rename() [2/3]

cbe::Object cbe::Object::rename ( const std::string &  name)

Synchronous version of rename(const std::string&,RenameDelegatePtr) , and throws an exception, RenameException, in case of a failed call.
See rename(const std::string&,RenameDelegatePtr)

Returns
The renamed object — if the call was successful.
Exceptions
RenameException

◆ rename() [3/3]

cbe::util::Optional<cbe::Object> cbe::Object::rename ( const std::string &  name,
RenameError error 
)

Synchronous version of rename(const std::string&,RenameDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See rename(const std::string&,RenameDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the RenameError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ remove() [1/3]

void cbe::Object::remove ( RemoveDelegatePtr  delegate)

Remove the object from cloud and locally.

Asynchronous version of this service function.

Parameters
delegatePointer to a delegate::object::RemoveDelegate instance that is implemented by the user.

◆ remove() [2/3]

delegate::object::RemoveSuccess cbe::Object::remove ( )

Synchronous version of remove(RemoveDelegatePtr) , and throws an exception, RemoveException, in case of a failed call.
See remove(RemoveDelegatePtr)

Returns
Information about the removed object — if the call was successful.
See RemoveSuccess
Exceptions
RemoveException

◆ remove() [3/3]

Synchronous version of remove(RemoveDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See remove(RemoveDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the RemoveError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ download() [1/10]

void cbe::Object::download ( const std::string &  path,
DownloadDelegatePtr  delegate 
)

Download the data of current object to the the local file system.

Asynchronous version of this service function.

The data will be contained in file, named after the name of current object (method name()), to the location given by parameter path.

Parameters
pathFolder location, on the local file system, of the file to be downloaded. This string must end with a slash ("/").
delegatePointer to a delegate::DownloadDelegate instance that is implemented by the user.

◆ download() [2/10]

delegate::DownloadSuccess cbe::Object::download ( const std::string &  path,
delegate::ProgressEventFn &&  progressEventFn 
)

Synchronous version of download(const std::string&,DownloadDelegatePtr) , and throws an exception, DownloadException, in case of a failed call.
See download(const std::string&,DownloadDelegatePtr)

Parameters
progressEventFnCallback function that is called for each memory chunk downloaded.
The callback function will be executed the calling thread's context.
Also see cbe::delegate::ProgressEventFn.
For the other parameters, see download(const std::string&,DownloadDelegatePtr)
Returns
Information about the download object — if the call was successful.
See DownloadSuccess
Note
To use this method, header file
cbe/delegate/DownloadSuccess.h
must be included
Exceptions
DownloadException

◆ download() [3/10]

delegate::DownloadSuccess cbe::Object::download ( const std::string &  path)

Same as download(const std::string&,delegate::ProgressEventFn&&), but without the parameter, progressEventFn.

◆ download() [4/10]

cbe::util::Optional<delegate::DownloadSuccess> cbe::Object::download ( const std::string &  path,
delegate::ProgressEventFn &&  progressEventFn,
DownloadError error 
)

Similar to synchronous method download(const std::string&,delegate::ProgressEventFn&&) , but throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See download(const std::string&,delegate::ProgressEventFn&&)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the DownloadError object passed in will we be populated with the error information.
For the other parameters, see download(const std::string&,delegate::ProgressEventFn&&)
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ download() [5/10]

cbe::util::Optional<delegate::DownloadSuccess> cbe::Object::download ( const std::string &  path,
DownloadError error 
)

Same as download(const std::string&,delegate::ProgressEventFn&&,DownloadError&) , but without the parameter, progressEventFn.

◆ download() [6/10]

void cbe::Object::download ( std::size_t &&  sizeLimit,
DownloadBinaryDelegatePtr  delegate 
)

Download the binary data associated with current object.

Asynchronous version of this service function.

The data, delivered as a BLOB (Binary Large OBject), via parameter data in the the callback method cbe::delegate::DownloadBinaryDelegate::onDownloadBinarySuccess().

Parameters
delegatePointer to a delegate::DownloadBinaryDelegate instance that is implemented by the user.
sizeLimitBlocks anything larger than the size limit the user inputs. Prevents accidental downloads of too large objects on to the device.

◆ download() [7/10]

delegate::DownloadBinarySuccess cbe::Object::download ( std::size_t &&  sizeLimit,
delegate::ProgressEventFn &&  progressEventFn 
)

Synchronous version of download(DownloadBinaryDelegatePtr) , and throws an exception, DownloadBinaryException, in case of a failed call.
See download(DownloadBinaryDelegatePtr)

Parameters
progressEventFnSee download(const std::string&,delegate::ProgressEventFn&&).
For the other parameters, see download(DownloadBinaryDelegatePtr)
Returns
Information about the downloaded object — if the call was successful.
See DownloadBinarySuccess
Note
To use this method, header file
cbe/delegate/DownloadBinarySuccess.h
must be included
Exceptions
DownloadBinaryException

◆ download() [8/10]

delegate::DownloadBinarySuccess cbe::Object::download ( std::size_t &&  sizeLimit)

Same as download(delegate::ProgressEventFn&&) , but without the parameter, progressEventFn.

◆ download() [9/10]

cbe::util::Optional<delegate::DownloadBinarySuccess> cbe::Object::download ( std::size_t &&  sizeLimit,
delegate::ProgressEventFn &&  progressEventFn,
DownloadBinaryError error 
)

Similar to synchronous method download(delegate::ProgressEventFn&&) , but throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See download(delegate::ProgressEventFn&&)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the DownloadError object passed in will we be populated with the error information.
For the other parameters, see download(delegate::ProgressEventFn&&)
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ download() [10/10]

cbe::util::Optional<delegate::DownloadBinarySuccess> cbe::Object::download ( std::size_t &&  sizeLimit,
DownloadBinaryError error 
)

Same as download(delegate::ProgressEventFn&&,DownloadBinaryError&) , but without the parameter, progressEventFn.

◆ downloadStream() [1/5]

void cbe::Object::downloadStream ( const std::string &  path,
cbe::Stream  stream,
DownloadDelegatePtr  delegate 
)

Download a stream of an Object to local filesystem.

Asynchronous version of this service function.

Parameters
pathFolder location, on the local file system, of the file to be downloaded. This string must end with a slash ("/").
streamGet which stream you want by first calling getStream() and then choose which one to download.
delegatePointer to a delegate::DownloadDelegate instance that is implemented by the user.

Example
Async downloading the data attached to a cbe::Object via a Stream with Object::downloadStream()
Continuation of: Async uploading data to a cbe::Object via a Stream with Object::uploadStream()
~~~
#include "cbe/delegate/DownloadDelegate.h"
~~~
struct MyDownloadDelegate : cbe::delegate::DownloadDelegate {
std::mutex mutex{};
std::condition_variable conditionVariable{};
bool called{};
Success success{};
void onDownloadSuccess(cbe::Object&& object,
std::string path) final {
{
std::lock_guard<std::mutex> lock{mutex};
success = Success{std::move(object), std::move(path)};
called = true;
}
conditionVariable.notify_one();
}
void onDownloadError(cbe::delegate::TransferError&& transferError,
cbe::util::Context&& context) final {
{
std::lock_guard<std::mutex> lock{mutex};
success = Success{};
called = true;
}
conditionVariable.notify_one();
}
cbe::Object waitForRsp() {
std::unique_lock<std::mutex> lock{mutex};
conditionVariable.wait(lock, [this]{ return called; } );
// Reset called flag, so current delegate instance can be reused
called = false;
// If object is still default constructed, this implies a failed
// cbe::Object::downloadStream() operation
return success.object;
}
}; // struct MyDownloadDelegate
~~~
std::shared_ptr<MyDownloadDelegate> myDownloadDelegate =
std::make_shared<MyDownloadDelegate>();
constexpr const char* const downloadPath = "/tmp/download/";
for (const auto& stream : streams2) {
const auto path = std::string{downloadPath} +
std::to_string(stream.streamId);
object.downloadStream(path, stream, myDownloadDelegate);
if (!myDownloadDelegate->waitForRsp()) {
// Failure, bail out
~~~
}
}
std::string path() const
Holder of a set of data, can represent a table row.
Definition: Object.h:64
Definition: DownloadDelegate.h:25
Definition: TransferError.h:18
Definition: Context.h:11

◆ downloadStream() [2/5]

delegate::DownloadSuccess cbe::Object::downloadStream ( const std::string &  path,
cbe::Stream  stream,
delegate::ProgressEventFn &&  progressEventFn 
)

Synchronous version of downloadStream(const std::string&,cbe::Stream,DownloadDelegatePtr) , and throws an exception, DownloadException, in case of a failed call.
See downloadStream(DownloadDelegatePtr)

Parameters
progressEventFnSee download(const std::string&,delegate::ProgressEventFn&&).
For the other parameters, see downloadStream(DownloadDelegatePtr)
Returns
Information about the downloaded stream — if the call was successful.
See DownloadSuccess
Exceptions
DownloadException
Example
Sync [exception] downloading the data attached to a cbe::Object via a Stream with Object::downloadStream()
Continuation of: Sync [exception] uploading data to a cbe::Object via a Stream with Object::uploadStream()
~~~
constexpr const char* const downloadPath = "/tmp/download/";
for (const auto& stream : streams2) {
const auto path = std::string{downloadPath} + std::to_string(stream.streamId);
try
{
auto result = object.downloadStream(path, stream);
}
catch (const cbe::Object::DownloadStreamException& e)
{
std::cout << "Error!" << std::endl << e.what() << std::endl;
~~~
}
}
~~~

◆ downloadStream() [3/5]

delegate::DownloadSuccess cbe::Object::downloadStream ( const std::string &  path,
cbe::Stream  stream 
)

Same as downloadStream(const std::string&,cbe::Stream,delegate::ProgressEventFn&&) , but without the parameter, progressEventFn.

◆ downloadStream() [4/5]

cbe::util::Optional<delegate::DownloadSuccess> cbe::Object::downloadStream ( const std::string &  path,
cbe::Stream  stream,
delegate::ProgressEventFn &&  progressEventFn,
DownloadError error 
)

Similar to synchronous method downloadStream(const std::string&,cbe::Stream,DownloadDelegatePtr) , but throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See downloadStream(const std::string&,cbe::Stream,DownloadDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the DownloadError object passed in will we be populated with the error information.
For the other parameters, see downloadStream(const std::string&,cbe::Stream,DownloadDelegatePtr)
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

Example
Sync [non-throwing] downloading the data attached to a cbe::Object via a Stream with Object::downloadStream()
Continuation of: Sync [non-throwing] uploading data to a cbe::Object via a Stream with Object::uploadStream()
~~~
constexpr const char* const downloadPath = "/tmp/download/";
for (const auto& stream : streams2) {
const auto path = std::string{downloadPath} + std::to_string(stream.streamId);
cbe::Object::DownloadStreamError downloadStreamError;
auto result = *object.downloadStream(path, stream, downloadStreamError);
if (downloadStreamError) {
std::cout << "Error! " << downloadStreamError << std::endl;
~~~
}
}

◆ downloadStream() [5/5]

cbe::util::Optional<delegate::DownloadSuccess> cbe::Object::downloadStream ( const std::string &  path,
cbe::Stream  stream,
DownloadError error 
)

◆ uploadStream() [1/5]

void cbe::Object::uploadStream ( const std::string &  filePath,
cbe::StreamId  streamId,
UploadDelegatePtr  delegate 
)

Upload a file for adding a new or replacing existing stream attached to this object.

Asynchronous version of this service function.

Requires that method getStreams(GetStreamsDelegatePtr) is called to identify all streams associated with current object.

Parameters
filePathFully qualified file name. I.e., the path, relative or absolute, including file name.
streamIdIf the stream id already exists, it will be overwritten.
delegatePointer to a delegate::UploadDelegate instance that is implemented by the user.

Example
Async uploading data to a cbe::Object via a Stream with Object::uploadStream()
Continuation of: Async retrieving the Streams attached to a cbe::Object with the Object::getStreams()
~~~
#include "cbe/delegate/UploadDelegate.h"
~~~
#include <algorithm> // std::max_element
#include <vector> // std::cbegin, std::cend
~~~
struct MyUploadDelegate : cbe::delegate::UploadDelegate {
std::mutex mutex{};
std::condition_variable conditionVariable{};
bool called{};
// Default construct, further see comment for object member in
// MyUploadDelegate above
void onUploadSuccess(cbe::Object&& object) final {
{
std::lock_guard<std::mutex> lock{mutex};
this->object = std::move(object);
called = true;
}
conditionVariable.notify_one();
}
void onUploadError(cbe::delegate::TransferError&& transferError,
cbe::util::Context&& context) final {
{
std::lock_guard<std::mutex> lock{mutex};
called = true;
}
conditionVariable.notify_one();
}
cbe::Object waitForRsp() {
std::unique_lock<std::mutex> lock{mutex};
conditionVariable.wait(lock, [this]{ return called; } );
// Reset called flag, so current delegate instance can be reused
called = false;
// If object is still default constructed, this implies a failed
// cbe::Object::uploadStream() operation
return object;
}
}; // struct MyUploadDelegate
~~~
constexpr const char* const myFile2Name = "myStream2";
const std::string qualFile2Name = std::string{uploadPath} + myFile2Name;
std::ofstream ofs2{qualFile2Name};
ofs2 << "Line 21\n" << "Line 22\n" << "Line 23\n" << "Line 24\n"
<< std::flush;
ofs2.close();
const auto nextStreamId =
std::max_element(std::cbegin(streams1), std::cend(streams1),
[](const cbe::Stream& stream1,
const cbe::Stream& stream2) {
return stream1.streamId < stream2.streamId;
})->streamId + 1;
std::shared_ptr<MyUploadDelegate> myUploadDelegate =
std::make_shared<MyUploadDelegate>();
object.uploadStream(qualFile2Name, nextStreamId, myUploadDelegate);
// Use of the bool type conversion operator to detect success or failure
// as above
if (!myUploadDelegate->waitForRsp()) {
// Failure, bail out
~~~
}
object.getStreams(getStreamsDelegate);
auto streamsOpt2 = getStreamsDelegate->waitForRsp();
if (!streamsOpt2) {
// Failure, bail out
~~~
}
const auto streams2 = std::move(*streamsOpt2);
~~~
A data file attached to Object.
Definition: Stream.h:24
cbe::StreamId streamId
Definition: Stream.h:30
Definition: UploadDelegate.h:28
DefaultCtor
Default constructor marker.
Definition: Types.h:204
Continues at: Async downloading the data attached to a cbe::Object via a Stream with Object::downloadStream()

◆ uploadStream() [2/5]

cbe::Object cbe::Object::uploadStream ( const std::string &  filePath,
cbe::StreamId  streamId,
delegate::ProgressEventFn &&  progressEventFn 
)

Synchronous version of uploadStream(const std::string&,cbe::StreamId,UploadDelegatePtr) , and throws an exception, UploadException, in case of a failed call.
See uploadStream(const std::string&,cbe::StreamId,UploadDelegatePtr)

Parameters
progressEventFnSee download(const std::string&,delegate::ProgressEventFn&&).
For the other parameters, see uploadStream(const std::string&,cbe::StreamId,UploadDelegatePtr)
Returns
Current object that was uploaded — if the call was successful.
See cbe::Object
Exceptions
UploadException
Example
Sync [exception] uploading data to a cbe::Object via a Stream with Object::uploadStream()
Continuation of: Sync [exception] retrieving the Streams attached to a cbe::Object with the Object::getStreams()
~~~
#include "cbe/delegate/UploadDelegate.h"
~~~
#include <algorithm> // std::max_element
#include <vector> // std::cbegin, std::cend
~~~
constexpr const char* const myFile2Name = "myStream2";
const std::string qualFile2Name = std::string{uploadPath} + myFile2Name;
std::ofstream ofs2{qualFile2Name};
ofs2 << "Line 21\n" << "Line 22\n" << "Line 23\n" << "Line 24\n"
<< std::flush;
ofs2.close();
const auto nextStreamId =
std::max_element(std::cbegin(streams1), std::cend(streams1),
[](const cbe::Stream& stream1,
const cbe::Stream& stream2) {
return stream1.streamId < stream2.streamId;
})->streamId + 1;
try
{
object.uploadStream(qualFile2Name, nextStreamId);
const auto streams2 = object.getStreams(getStreamsDelegate);
}
catch (const cbe::Object::UploadStreamException& e)
{
std::cout << "Error!" << std::endl << e.what() << std::endl;
~~~
}
catch (const cbe::Object::GetStreamException& e)
{
std::cout << "Error!" << std::endl << e.what() << std::endl;
~~~
}
~~~
Continues at: Sync [exception] downloading the data attached to a cbe::Object via a Stream with Object::downloadStream()

◆ uploadStream() [3/5]

cbe::Object cbe::Object::uploadStream ( const std::string &  filePath,
cbe::StreamId  streamId 
)

Same as uploadStream(const std::string&,cbe::StreamId,delegate::ProgressEventFn&&) , but without the parameter, progressEventFn.

◆ uploadStream() [4/5]

cbe::util::Optional<cbe::Object> cbe::Object::uploadStream ( const std::string &  filePath,
cbe::StreamId  streamId,
delegate::ProgressEventFn &&  progressEventFn,
UploadError error 
)

Similar to synchronous method uploadStream(const std::string&,cbe::StreamId,delegate::ProgressEventFn&&) , but throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See uploadStream(const std::string&,cbe::StreamId,UploadDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the DownloadError object passed in will we be populated with the error information.
For the other parameters, see uploadStream(const std::string&,cbe::StreamId,delegate::ProgressEventFn&&)
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

Example
Sync [non-throwing] uploading data to a cbe::Object via a Stream with Object::uploadStream()
Continuation of: Sync non-throwing of retrieving the Streams attached to a cbe::Object with the Object::getStreams()
#include <algorithm> // std::max_element
#include <vector> // std::cbegin, std::cend
~~~
constexpr const char* const myFile2Name = "myStream2";
const std::string qualFile2Name = std::string{uploadPath} + myFile2Name;
std::ofstream ofs2{qualFile2Name};
ofs2 << "Line 21\n" << "Line 22\n" << "Line 23\n" << "Line 24\n"
<< std::flush;
ofs2.close();
const auto nextStreamId =
std::max_element(std::cbegin(streams1), std::cend(streams1),
[](const cbe::Stream& stream1,
const cbe::Stream& stream2) {
return stream1.streamId < stream2.streamId;
})->streamId + 1;
cbe::Object::UploadStreamError uploadStreamError;
object.uploadStream(qualFile2Name, nextStreamId, uploadStreamError);
if (uploadStreamError) {
std::cout << "Error! " << uploadStreamError << std::endl;
~~~
}
const auto streams2 = *object.getStreams(getStreamsError);
if (getStreamsError) {
std::cout << "Error! " << getStreamsError << std::endl;
~~~
}
~~~
Definition: GetStreamsDelegate.h:46
Continues at: Sync [non-throwing] downloading the data attached to a cbe::Object via a Stream with Object::downloadStream()

◆ uploadStream() [5/5]

cbe::util::Optional<cbe::Object> cbe::Object::uploadStream ( const std::string &  filePath,
cbe::StreamId  streamId,
UploadError error 
)

◆ updateKeyValues() [1/6]

void cbe::Object::updateKeyValues ( KeyValues  keyValues,
UpdateKeyValuesDelegatePtr  delegate 
)

Adds key/value pair data to the object.

Asynchronous version of this service function.

Note
All existing key will be overwritten, new created.
Any key name must start with a letter or _
The following key names are reserved and should not be used: category, content, id, link and date
Key names are case sensitive, hence variations with uppercase are permitted.
Parameters
keyValuesMap of key/value pairs (metadata).
delegatePointer to a delegate::UpdateKeyValuesDelegate instance that is implemented by the user.

◆ updateKeyValues() [2/6]

void cbe::Object::updateKeyValues ( UpdateKeyValuesDelegatePtr  delegate)

Deletes all key/value pairs of data to the object.

Same as updateKeyValues(KeyValues,UpdateKeyValuesDelegatePtr), but without the keyValues parameter.

Note
Any and all existing key/values will be erased.

◆ updateKeyValues() [3/6]

cbe::Object cbe::Object::updateKeyValues ( KeyValues  keyValues)

Synchronous [exception] Adds key/value pair data to the object.

Synchronous version of updateKeyValues(KeyValues,UpdateKeyValuesDelegatePtr) , and throws an exception, UpdateKeyValuesException, in case of a failed call.
See updateKeyValues(UpdateKeyValuesDelegatePtr)

Returns
Current object that was uploaded — if the call was successful.
See cbe::Object
Exceptions
UpdateKeyValuesException

◆ updateKeyValues() [4/6]

cbe::Object cbe::Object::updateKeyValues ( )

Synchronous [exception] Deletes all key/value pairs of data to the object.

Same as updateKeyValues(KeyValues), but without the keyValues parameter.

◆ updateKeyValues() [5/6]

cbe::util::Optional<cbe::Object> cbe::Object::updateKeyValues ( KeyValues  keyValues,
UpdateKeyValuesError error 
)

Synchronous [non-throwing] Adds key/value pair data to the object.

Synchronous version of updateKeyValues(KeyValues,UpdateKeyValuesDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See updateKeyValues(KeyValues, UpdateKeyValuesDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the UpdateKeyValuesError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ updateKeyValues() [6/6]

cbe::util::Optional<cbe::Object> cbe::Object::updateKeyValues ( UpdateKeyValuesError error)

Synchronous [non-throwing] Deletes all key/value pairs of data to the object.

Same as updateKeyValues(KeyValues,UpdateKeyValuesError&), but without the keyValues parameter.

◆ getStreams() [1/3]

void cbe::Object::getStreams ( GetStreamsDelegatePtr  delegate)

Downloads the streams meta data associated with current object to the SDK's cache.

Asynchronous version of this service function.

The meta data i delivered as cbe::Streams via the delegate callback method cbe::delegate::GetStreamsDelegate::onGetStreamsSuccess()
Further, the actual stream data are retrieved through method downloadStream(const std::string&,cbe::Stream,DownloadDelegatePtr).

Note
This method must be re-called if you upload more streams, see uploadStream()
Parameters
delegatePointer to a delegate::GetStreamsDelegate instance that is implemented by the user.

Example
Async retrieving the Streams attached to a cbe::Object with the Object::getStreams()
Continuation of: Async creation of a cbe::Object by using Container::upload()
~~~
#include "cbe/delegate/GetStreamsDelegate.h"
#include "cbe/util/Optional.h"
~~~
struct MyGetStreamsDelegate : cbe::delegate::GetStreamsDelegate {
std::mutex mutex{};
std::condition_variable conditionVariable{};
bool called{};
// Represents the result stream meta data as a cbe::Optional. Where an empty
// Optional implies an error
void onGetStreamsSuccess(cbe::Streams&& streams) final {
{
std::lock_guard<std::mutex> lock{mutex};
this->streams = std::move(streams);
called = true;
}
conditionVariable.notify_one();
}
void onGetStreamsError(cbe::delegate::Error&& error,
cbe::util::Context&& context) final {
{
std::lock_guard<std::mutex> lock{mutex};
called = true;
}
conditionVariable.notify_one();
}
std::unique_lock<std::mutex> lock{mutex};
conditionVariable.wait(lock, [this]{ return called; } );
// Reset called flag, so current delegate instance can be reused
called = false;
// If streams is still default constructed, this implies a failed
// cbe::Object::getStreams() operation
return std::move(streams);
}
}; // struct MyGetStreamsDelegate
~~~
std::shared_ptr<MyGetStreamsDelegate> getStreamsDelegate =
std::make_shared<MyGetStreamsDelegate>();
object.getStreams(getStreamsDelegate);
// Simply make use of the Optional bool type conversion operator on the return
// value from the waitForRsp() method to determine the outcome of the
// getStreams() invocation above
getStreamsDelegate->waitForRsp();
if (!streamsOpt1) {
// Failure, bail out
~~~
}
// Now, streamsOpt1 contains the streams meta data, so move it to variable
// streams1
const cbe::Object::Streams streams1 = std::move(*streamsOpt1);
~~~
cbe::Streams Streams
Collection of Stream objects.
Definition: Object.h:878
Definition: Error.h:14
Definition: GetStreamsDelegate.h:26
Class template Optional manages an optional contained value - i.e., a value that is either present or...
Definition: Optional.h:20
std::vector< cbe::Stream > Streams
Collection of Stream objects.
Definition: Stream.h:49
Continues at: Async uploading data to a cbe::Object via a Stream with Object::uploadStream()

◆ getStreams() [2/3]

Streams cbe::Object::getStreams ( )

Synchronous version of getStreams(GetStreamsDelegatePtr) , and throws an exception, #GetStreamException, in case of a failed call.
See getStreams(GetStreamsDelegatePtr)

Returns
The streams attached to current object — if the call was successful.
Exceptions
#GetStreamException
Example
Sync [exception] retrieving the Streams attached to a cbe::Object with the Object::getStreams()
Continuation of: Sync [exception] creation of a cbe::Object by using Container::upload()
~~~
#include "cbe/util/Optional.h"
~~~
try
{
auto streams = object.getStreams();
}
{
std::cout << "Error!" << std::endl << e.what() << std::endl;
~~~
}
~~~
exception thrown by cbe::Object::getStreams() if the request fails.
Definition: GetStreamsDelegate.h:56
Continues at: Sync [exception] uploading data to a cbe::Object via a Stream with Object::uploadStream()

◆ getStreams() [3/3]

cbe::util::Optional<Streams> cbe::Object::getStreams ( GetStreamsError error)

Synchronous version of getStreams(GetStreamsDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See getStreams(GetStreamsDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the GetStreamsError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

Example
Sync [non-throwing] retrieving the Streams attached to a cbe::Object with the Object::getStreams()
Continuation of: Sync [non-throwing] creation of a cbe::Object by using Container::upload()
~~~
cbe::Object::GetStreamsError getStreamsError;
auto streams = *object.getStreams(getStreamsError);
if (getStreamsError) {
std::cout << "Error! " << getStreamsError << std::endl;
~~~
}
~~~
Continues at: Sync [non-throwing] uploading data to a cbe::Object via a Stream with Object::uploadStream()

◆ getMimeType()

std::string cbe::Object::getMimeType ( ) const

Returns the mime type of the object.

E.g., application/pdf, audio/wav, image/jpg, text/xml, video/mp4 etc.

◆ getObjectType()

cbe::object_t cbe::Object::getObjectType ( ) const

Returns the Object type.

See cbe::ObjectType.

◆ getAcl() [1/3]

void cbe::Object::getAcl ( GetAclDelegatePtr  delegate)

Returns the Access Control List for current Object.

Asynchronous version of this service function.

Parameters
delegatePointer to a delegate::AclDelegate instance that is implemented by the user.

◆ getAcl() [2/3]

cbe::AclMap cbe::Object::getAcl ( )

Synchronous version of getAcl(GetAclDelegatePtr) , and throws an exception, GetAclException, in case of a failed call.
See getAcl(GetAclDelegatePtr)

Returns
Information about the object from which the ACL is fetched — if the call was successful.
See AclSuccess
Exceptions
GetAclException

◆ getAcl() [3/3]

cbe::util::Optional<cbe::AclMap> cbe::Object::getAcl ( GetAclError error)

Synchronous version of getAcl(GetAclDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See getAcl(GetAclDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the GetAclError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ setAcl() [1/3]

void cbe::Object::setAcl ( cbe::AclMap  aclMap,
SetAclDelegatePtr  delegate 
)

Sets the Access Control List for current object.

Asynchronous version of this service function.

Parameters
aclMapThe desired permission for current object.
delegatePointer to a delegate::AclDelegate instance that is implemented by the user.

◆ setAcl() [2/3]

cbe::AclMap cbe::Object::setAcl ( cbe::AclMap  aclMap)

Synchronous version of setAcl(cbe::AclMap,SetAclDelegatePtr) , and throws an exception, SetAclException, in case of a failed call.
See setAcl(cbe::AclMap,SetAclDelegatePtr)

Returns
Information about the object from which the ACL has been set — if the call was successful.
See AclSuccess
Exceptions
SetAclException

◆ setAcl() [3/3]

cbe::util::Optional<cbe::AclMap> cbe::Object::setAcl ( cbe::AclMap  aclMap,
SetAclError error 
)

Synchronous version of setAcl(cbe::AclMap,SetAclDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See setAcl(cbe::AclMap,SetAclDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the SetAclError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ share() [1/3]

void cbe::Object::share ( cbe::UserId  toUserGroup,
std::string  description,
ShareDelegatePtr  delegate 
)

Share current object to a user.

Asynchronous version of this service function.

Notifies the user that a share has ocurred so that the user can check what permissions the have been given. Sharing gives read permissions as of right now but might change in the future.

Parameters
toUserGroupTakes a user id or group id (lastly named is for the future) and share to.
descriptionNames the specific share between you and the user/group.
delegatePointer to a delegate::ShareDelegatePtr instance that is implemented by the user.

◆ share() [2/3]

delegate::ShareSuccess cbe::Object::share ( cbe::UserId  toUserGroup,
std::string  description 
)

Synchronous version of share(cbe::UserId,std::string,ShareDelegatePtr) , and throws an exception, ShareException, in case of a failed call.
See share(ShareDelegatePtr)

Returns
Information about the id of the shared object — if the call was successful.
See ShareSuccess
Exceptions
ShareException

◆ share() [3/3]

cbe::util::Optional<delegate::ShareSuccess> cbe::Object::share ( cbe::UserId  toUserGroup,
std::string  description,
ShareError error 
)

Synchronous version of share(cbe::UserId,std::string,ShareDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See share(cbe::UserId,std::string,ShareDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the ShareError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ unShare() [1/3]

void cbe::Object::unShare ( cbe::ShareId  shareId,
UnShareDelegatePtr  delegate 
)

Unshare the object to a specific shareId created when sharing.

Asynchronous version of this service function.

Each share is unique between user/group and the one sharing. This is represented with a unique share id.

Parameters
shareIdThe unique id for a share between the owner and other user/group.
delegatePointer to a delegate::UnShareDelegate instance that is implemented by the user.

◆ unShare() [2/3]

delegate::UnShareSuccess cbe::Object::unShare ( cbe::ShareId  shareId)

Synchronous version of unShare(cbe::ShareId,UnShareDelegatePtr) , and throws an exception, UnShareException, in case of a failed call.
See unShare(cbe::ShareId,UnShareDelegatePtr)

Returns
Information about the unshared object — if the call was successful.
See UnShareSuccess
Exceptions
UnShareException

◆ unShare() [3/3]

cbe::util::Optional<delegate::UnShareSuccess> cbe::Object::unShare ( cbe::ShareId  shareId,
UnShareError error 
)

Synchronous version of unShare(cbe::ShareId,UnShareDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See unShare(cbe::ShareId,UnShareDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the UnShareError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ publish() [1/3]

void cbe::Object::publish ( cbe::PublishAccess  security,
cbe::PublishVisibility  privacy,
std::string  description,
std::string  password,
PublishDelegatePtr  delegate 
)

Publishes current object to any user.

Asynchronous version of this service function.

Can be revoked with unPublish()

Parameters
securityA cbe::PublishAccess enum
privacyA cbe::WebShareVisibility enum
descriptionFree text
passwordPassword
delegatePointer to a delegate::PublishDelegate instance that is implemented by the user.

◆ publish() [2/3]

delegate::PublishSuccess cbe::Object::publish ( cbe::PublishAccess  security,
cbe::PublishVisibility  privacy,
std::string  description,
std::string  password 
)

Synchronous version of publish(cbe::PublishAccess,cbe::PublishVisibility,std::string,std::string,PublishDelegatePtr) , and throws an exception, PublishException, in case of a failed call.
See publish(cbe::PublishAccess,cbe::PublishVisibility,std::string,std::string,PublishDelegatePtr)

Returns
Information about the published object — if the call was successful.
See PublishSuccess
Note
To use this method, header file
cbe/delegate/PublishSuccess.h
must be included
Exceptions
PublishException

◆ publish() [3/3]

cbe::util::Optional<delegate::PublishSuccess> cbe::Object::publish ( cbe::PublishAccess  security,
cbe::PublishVisibility  privacy,
std::string  description,
std::string  password,
PublishError error 
)

Synchronous version of publish(cbe::PublishAccess,cbe::PublishVisibility,std::string,std::string,PublishDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See publish(cbe::PublishAccess,cbe::PublishVisibility,std::string,std::string,PublishDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the PublishError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.
Note
To use this method, header file
cbe/delegate/PublishSuccess.h
must be included

◆ unPublish() [1/3]

void cbe::Object::unPublish ( UnPublishDelegatePtr  delegate)

UnPublishes current object.

Asynchronous version of this service function.

Revokes previous publish().

Parameters
delegatePointer to a delegate::UnPublishDelegate instance that is implemented by the user.

◆ unPublish() [2/3]

delegate::UnPublishSuccess cbe::Object::unPublish ( )

Synchronous version of unPublish(UnPublishDelegatePtr) , and throws an exception, UnPublishException, in case of a failed call.
See unPublish(UnPublishDelegatePtr)

Returns
Information about the unpublished object — if the call was successful.
See UnPublishSuccess
Exceptions
UnPublishException

◆ unPublish() [3/3]

cbe::util::Optional<delegate::UnPublishSuccess> cbe::Object::unPublish ( UnPublishError error)

Synchronous version of unPublish(UnPublishDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See unPublish( UnPublishDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the UnPublishError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ unSubscribe() [1/3]

void cbe::Object::unSubscribe ( UnSubscribeDelegatePtr  delegate)

UnSubscribes from this object.

Asynchronous version of this service function.

Revokes the subscription previously established with cbe::SubscribeManager::subscribe()

Parameters
delegatePointer to a delegate::UnSubscribeDelegate instance that is implemented by the user.

◆ unSubscribe() [2/3]

delegate::UnSubscribeSuccess cbe::Object::unSubscribe ( )

Synchronous version of unSubscribe(UnSubscribeDelegatePtr) , and throws an exception, UnSubscribeException, in case of a failed call.
See unSubscribe(UnSubscribeDelegatePtr)

Returns
Information about the unsubscribed object — if the call was successful.
See UnSubscribeSuccess
Exceptions
UnSubscribeException

◆ unSubscribe() [3/3]

cbe::util::Optional<delegate::UnSubscribeSuccess> cbe::Object::unSubscribe ( UnSubscribeError error)

Synchronous version of unSubscribe(UnSubscribeDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See unSubscribe(UnSubscribeDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the UnSubscribeError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

The documentation for this class was generated from the following file: