5 #ifndef INCLUDE_CBE_OBJECT_H_
6 #define INCLUDE_CBE_OBJECT_H_
9 #include "cbe/Stream.h"
10 #include "cbe/Types.h"
12 #include "cbe/delegate/AclDelegate.h"
13 #include "cbe/delegate/DownloadBinaryDelegate.h"
14 #include "cbe/delegate/DownloadDelegate.h"
15 #include "cbe/delegate/GetStreamsDelegate.h"
16 #include "cbe/delegate/object/MoveDelegate.h"
17 #include "cbe/delegate/object/RemoveDelegate.h"
18 #include "cbe/delegate/object/RenameDelegate.h"
19 #include "cbe/delegate/PublishDelegate.h"
20 #include "cbe/delegate/ShareDelegate.h"
21 #include "cbe/delegate/UnPublishDelegate.h"
22 #include "cbe/delegate/UnShareDelegate.h"
23 #include "cbe/delegate/UnSubscribeDelegate.h"
24 #include "cbe/delegate/UpdateKeyValuesDelegate.h"
25 #include "cbe/delegate/UploadDelegate.h"
28 #include "cbe/delegate/ProgressEventFn.h"
31 #include "cbe/delegate/Error.h"
32 #include "cbe/util/ErrorInfo.h"
33 #include "cbe/util/Exception.h"
34 #include "cbe/util/Optional.h"
41 using ObjectPtr = std::shared_ptr<CBI::Object>;
42 class ItemEventProtocol;
43 using ItemDelegatePtr = std::shared_ptr<ItemEventProtocol>;
44 class TransferDownloadEventProtocol;
45 using TransferDownloadDelegatePtr =
46 std::shared_ptr<TransferDownloadEventProtocol>;
47 class TransferUploadEventProtocol;
48 using TransferUploadDelegatePtr = std::shared_ptr<TransferUploadEventProtocol>;
88 using MoveException = delegate::object::MoveDelegate::Exception;
155 using RenameException = delegate::object::RenameDelegate::Exception;
168 const std::string&
name);
197 const std::string&
name,
221 using RemoveException = delegate::object::RemoveDelegate::Exception;
290 const std::string&
path,
303 using DownloadException = delegate::DownloadDelegate::Exception;
329 const std::string&
path,
337 const std::string&
path);
372 const std::string&
path,
374 DownloadError& error);
381 const std::string&
path,
382 DownloadError& error);
412 using DownloadBinaryException = delegate::DownloadBinaryDelegate::Exception;
474 std::size_t&& sizeLimit,
476 DownloadBinaryError& error);
483 std::size_t&& sizeLimit,
484 DownloadBinaryError& error);
508 const std::string&
path,
538 const std::string&
path,
547 const std::string&
path,
579 const std::string&
path,
582 DownloadError& error);
589 const std::string&
path,
591 DownloadError& error);
627 const std::string& filePath,
634 using UploadException = delegate::UploadDelegate::Exception;
663 const std::string& filePath,
672 const std::string& filePath,
717 const std::string& filePath,
727 const std::string& filePath,
769 using UpdateKeyValuesException = delegate::UpdateKeyValuesDelegate::Exception;
827 UpdateKeyValuesError& error);
837 UpdateKeyValuesError& error);
883 using GetStreamsException = delegate::GetStreamsDelegate::Exception;
945 GetStreamsError& error);
992 using GetAclException = delegate::AclDelegate::Exception;
1035 GetAclError& error);
1061 using SetAclException = delegate::AclDelegate::Exception;
1106 SetAclError& error);
1137 using ShareException = delegate::ShareDelegate::Exception;
1214 using UnShareException = delegate::UnShareDelegate::Exception;
1259 UnShareError& error);
1286 std::string password,
1292 using PublishException = delegate::PublishDelegate::Exception;
1313 std::string password);
1347 std::string password,
1348 PublishError& error);
1373 using UnPublishException = delegate::UnPublishDelegate::Exception;
1416 UnPublishError& error);
1442 using UnSubscribeException = delegate::UnSubscribeDelegate::Exception;
1485 UnSubscribeError& error);
1496 Impl& getImpl()
const;
1500 Object(CBI::ObjectPtr cbiPeerPtr);
1501 CBI::Object& getCbiPeer()
const;
The session that holds the connection with the cloud.
Definition: CloudBackend.h:47
A collection of Item, can also represent a table or folder.
Definition: Container.h:63
A set made up of Container and Object.
Definition: Item.h:36
std::string description() const
Holder of a set of data, can represent a table row.
Definition: Object.h:64
void getAcl(GetAclDelegatePtr delegate)
Returns the Access Control List for current Object.
void downloadStream(const std::string &path, cbe::Stream stream, DownloadDelegatePtr delegate)
void unSubscribe(UnSubscribeDelegatePtr delegate)
UnSubscribes from this object.
uint64_t length() const
Returns the binary length/size in bytes of current object.
void updateKeyValues(UpdateKeyValuesDelegatePtr delegate)
Deletes all key/value pairs of data to the object.
delegate::object::RenameDelegatePtr RenameDelegatePtr
Definition: Object.h:139
void download(const std::string &path, DownloadDelegatePtr delegate)
Download the data of current object to the the local file system.
delegate::AclDelegatePtr GetAclDelegatePtr
Definition: Object.h:977
delegate::UnShareDelegatePtr UnShareDelegatePtr
Definition: Object.h:1191
void unShare(cbe::ShareId shareId, UnShareDelegatePtr delegate)
Unshare the object to a specific shareId created when sharing.
void remove(RemoveDelegatePtr delegate)
Remove the object from cloud and locally.
std::string getMimeType() const
Returns the mime type of the object.
delegate::object::RemoveDelegatePtr RemoveDelegatePtr
Definition: Object.h:206
cbe::object_t getObjectType() const
Returns the Object type.
void getStreams(GetStreamsDelegatePtr delegate)
Downloads the streams meta data associated with current object to the SDK's cache.
delegate::UnPublishDelegatePtr UnPublishDelegatePtr
Definition: Object.h:1356
void rename(const std::string &name, RenameDelegatePtr delegate)
Rename object.
delegate::GetStreamsDelegatePtr GetStreamsDelegatePtr
Definition: Object.h:845
void updateKeyValues(KeyValues keyValues, UpdateKeyValuesDelegatePtr delegate)
Adds key/value pair data to the object.
std::string url()
URL to current object.
void publish(cbe::PublishAccess security, cbe::PublishVisibility privacy, std::string description, std::string password, PublishDelegatePtr delegate)
Publishes current object to any user.
void move(cbe::ContainerId dstId, MoveDelegatePtr delegate)
Relocates an object to a different container.
delegate::UploadDelegatePtr UploadDelegatePtr
Definition: Object.h:599
cbe::KeyValues keyValues()
Returns all the key/values for current object as a map.
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.
void unPublish(UnPublishDelegatePtr delegate)
UnPublishes current object.
delegate::UnSubscribeDelegatePtr UnSubscribeDelegatePtr
Definition: Object.h:1424
delegate::UpdateKeyValuesDelegatePtr UpdateKeyValuesDelegatePtr
Definition: Object.h:737
delegate::ShareDelegatePtr ShareDelegatePtr
Definition: Object.h:1114
cbe::Streams Streams
Collection of Stream objects.
Definition: Object.h:878
delegate::DownloadBinaryDelegatePtr DownloadBinaryDelegatePtr
Definition: Object.h:390
void setAcl(cbe::AclMap aclMap, SetAclDelegatePtr delegate)
Sets the Access Control List for current object.
void share(cbe::UserId toUserGroup, std::string description, ShareDelegatePtr delegate)
Share current object to a user.
delegate::DownloadDelegatePtr DownloadDelegatePtr
Definition: Object.h:275
delegate::object::MoveDelegatePtr MoveDelegatePtr
Definition: Object.h:71
delegate::AclDelegatePtr SetAclDelegatePtr
Definition: Object.h:1043
delegate::PublishDelegatePtr PublishDelegatePtr
Definition: Object.h:1267
void download(std::size_t &&sizeLimit, DownloadBinaryDelegatePtr delegate)
Download the binary data associated with current object.
A data file attached to Object.
Definition: Stream.h:24
Convenience type that bundles all parameters passed to method cbe::delegate::DownloadBinaryDelegate::...
Definition: DownloadBinarySuccess.h:17
Convenience type that bundles all parameters passed to method cbe::delegate::DownloadDelegate::onDown...
Definition: DownloadSuccess.h:16
Convenience type that bundles the parameter passed to method cbe::delegate::ShareDelegate::onShareSuc...
Definition: PublishSuccess.h:14
Convenience type that bundles the parameter passed to method cbe::delegate::ShareDelegate::onShareSuc...
Definition: ShareDelegate.h:77
Convenience type that bundles all parameters passed to method cbe::delegate::UnPublishDelegate::onUnP...
Definition: UnPublishDelegate.h:77
Convenience type that bundles the parameter passed to method cbe::delegate::ShareDelegate::onShareSuc...
Definition: UnShareDelegate.h:73
Convenience type that bundles all parameters passed to method cbe::delegate::UnSubscribeDelegate::onU...
Definition: UnSubscribeDelegate.h:76
Convenience type that bundles all parameters passed to method cbe::delegate::object::onRemoveSuccess.
Definition: RemoveDelegate.h:75
Class template Optional manages an optional contained value - i.e., a value that is either present or...
Definition: Optional.h:20
std::shared_ptr< MoveDelegate > MoveDelegatePtr
Definition: MoveDelegate.h:64
std::shared_ptr< RenameDelegate > RenameDelegatePtr
Definition: RenameDelegate.h:64
std::shared_ptr< RemoveDelegate > RemoveDelegatePtr
Definition: RemoveDelegate.h:68
std::function< void(const ChunkTransferred &)> ProgressEventFn
Callback interface function that the CloudBackend SDK uses to indicate the progress of an upload/down...
Definition: ProgressEventFn.h:19
std::shared_ptr< GetStreamsDelegate > GetStreamsDelegatePtr
Definition: GetStreamsDelegate.h:68
std::shared_ptr< UnPublishDelegate > UnPublishDelegatePtr
Definition: UnPublishDelegate.h:70
std::shared_ptr< ShareDelegate > ShareDelegatePtr
Definition: ShareDelegate.h:70
std::shared_ptr< PublishDelegate > PublishDelegatePtr
Definition: PublishDelegate.h:66
std::shared_ptr< UpdateKeyValuesDelegate > UpdateKeyValuesDelegatePtr
Definition: UpdateKeyValuesDelegate.h:66
std::shared_ptr< AclDelegate > AclDelegatePtr
Definition: AclDelegate.h:68
std::shared_ptr< UnShareDelegate > UnShareDelegatePtr
Definition: UnShareDelegate.h:66
std::shared_ptr< UploadDelegate > UploadDelegatePtr
Definition: UploadDelegate.h:83
std::shared_ptr< DownloadBinaryDelegate > DownloadBinaryDelegatePtr
Definition: DownloadBinaryDelegate.h:87
std::shared_ptr< UnSubscribeDelegate > UnSubscribeDelegatePtr
Definition: UnSubscribeDelegate.h:69
std::shared_ptr< DownloadDelegate > DownloadDelegatePtr
Definition: DownloadDelegate.h:84
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
std::vector< cbe::Stream > Streams
Collection of Stream objects.
Definition: Stream.h:49
std::map< cbe::AclGroupId, std::pair< cbe::Permissions, AclScope > > AclMap
ACL map (Access Control List) relating to users and groups.
Definition: Types.h:390
std::uint64_t StreamId
Uniquely identifies a cbe::Stream.
Definition: Types.h:118
std::uint64_t ShareId
Uniquely identifies a sharing of a cbe::Container or cbe::Object.
Definition: Types.h:113
std::uint64_t UserId
Uniquely identifies the CBE user number.
Definition: Types.h:126
std::uint64_t ContainerId
Unique Id of a cbe::Container.
Definition: Types.h:60
DefaultCtor
Default constructor marker.
Definition: Types.h:204
PublishVisibility
Definition: Types.h:357
PublishAccess
Definition: Types.h:342
std::map< std::string, std::pair< std::string, bool > > KeyValues
Map with key/value pairs, a.k.a. metadata.
Definition: Types.h:417
Definition: AclDelegate.h:41
Definition: DownloadBinaryDelegate.h:63
Definition: DownloadDelegate.h:56
Definition: GetStreamsDelegate.h:46
Definition: PublishDelegate.h:38
Definition: ShareDelegate.h:42
Definition: UnPublishDelegate.h:42
Definition: UnShareDelegate.h:38
Definition: UnSubscribeDelegate.h:41
Definition: UpdateKeyValuesDelegate.h:42
Definition: UploadDelegate.h:57
Definition: MoveDelegate.h:43
Definition: RemoveDelegate.h:45
Definition: RenameDelegate.h:43