5 #ifndef INCLUDE_CBE_CONTAINER_H_
6 #define INCLUDE_CBE_CONTAINER_H_
9 #include "cbe/delegate/container/MoveDelegate.h"
10 #include "cbe/delegate/container/RenameDelegate.h"
11 #include "cbe/delegate/container/RemoveDelegate.h"
12 #include "cbe/delegate/AclDelegate.h"
13 #include "cbe/delegate/CreateContainerDelegate.h"
14 #include "cbe/delegate/CreateObjectDelegate.h"
15 #include "cbe/delegate/Error.h"
16 #include "cbe/delegate/PublishDelegate.h"
17 #include "cbe/delegate/PublishSuccess.h"
18 #include "cbe/delegate/ShareDelegate.h"
19 #include "cbe/delegate/UnPublishDelegate.h"
20 #include "cbe/delegate/UnShareDelegate.h"
21 #include "cbe/delegate/UnSubscribeDelegate.h"
22 #include "cbe/delegate/UploadDelegate.h"
23 #include "cbe/delegate/QueryDelegate.h"
24 #include "cbe/delegate/QueryJoinDelegate.h"
27 #include "cbe/delegate/ProgressEventFn.h"
30 #include "cbe/util/Context.h"
31 #include "cbe/util/ErrorInfo.h"
32 #include "cbe/util/Exception.h"
33 #include "cbe/util/Optional.h"
36 #include "cbe/Object.h"
37 #include "cbe/Types.h"
41 using ContainerPtr = std::shared_ptr<CBI::Container>;
42 class ItemEventProtocol;
43 using ItemDelegatePtr = std::shared_ptr<ItemEventProtocol>;
131 const std::string&
name,
481 const std::string&
path,
494 std::uint64_t length,
495 const char* byteData,
542 const std::string& filePath,
553 const std::string& filePath);
573 const std::string&
name,
574 const std::string&
path,
585 const std::string&
name,
586 const std::string&
path);
606 const std::string&
name,
607 std::uint64_t length,
608 const char* byteData,
618 const std::string&
name,
619 std::uint64_t length,
620 const char* byteData);
669 const std::string& filePath,
680 const std::string& filePath,
704 const std::string&
name,
705 const std::string&
path,
717 const std::string&
name,
718 const std::string&
path,
737 const std::string&
name,
738 std::uint64_t length,
739 const char* byteData,
751 const std::string&
name,
752 std::uint64_t length,
753 const char* byteData,
933 std::string relativePath,
1400 std::string password,
1426 std::string password);
1462 std::string password,
1618 Impl& getImpl()
const;
1627 Container(CBI::ContainerPtr cbiPeerPtr);
1629 CBI::ContainerPtr getCbiPeerPtr()
const;
Login account information.
Definition: Account.h:26
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
cbe::util::Optional< cbe::Object > createObject(std::string name, cbe::KeyValues keyValues, CreateObjectError &error)
Synchronous [non-throwing] createObject.
delegate::AclDelegatePtr GetAclDelegatePtr
Definition: Container.h:1163
cbe::util::Optional< delegate::UnShareDelegate::Success > unShare(cbe::ShareId shareId, UnShareError &error)
Synchronous [non-throwing] unShare.
cbe::Container createContainer(const std::string &name)
Synchronous [exception] createContainer.
delegate::AclDelegatePtr SetAclDelegatePtr
Definition: Container.h:1087
delegate::CreateObjectDelegatePtr CreateObjectDelegatePtr
Definition: Container.h:348
cbe::QueryResult search(cbe::Filter)
Synchronous [exception] search using filter.
delegate::container::RemoveSuccess remove()
Synchronous [exception] remove/delete.
void getAcl(GetAclDelegatePtr delegate)
Retrieves its ACL map.
delegate::UnPublishSuccess unPublish()
Synchronous [exception] unPublish.
void unShare(cbe::ShareId shareId, UnShareDelegatePtr delegate)
Revoke a previous share.
cbe::QueryChainExt query(Filter filter, delegate::QueryJoinDelegatePtr delegate)
Select list of objects using filter, for join.
cbe::Object upload(const std::string &name, std::uint64_t length, const char *byteData)
Synchronous [exception] upload from memory.
cbe::util::Optional< delegate::container::RemoveSuccess > remove(RemoveError &error)
Synchronous [non-throwing] remove/delete.
cbe::QueryChain query(Filter filter, QueryDelegatePtr delegate)
Select list of objects using filter.
cbe::QueryChainSync query(Filter filter)
Synchronous [exception] Select list of objects using filter.
cbe::util::Optional< delegate::UnPublishSuccess > unPublish(UnPublishError &error)
Synchronous [non-throwing] unPublish.
cbe::Object upload(const std::string &name, const std::string &path, UploadDelegatePtr delegate)
Create an object in current container by uploading a file.
cbe::Object upload(const std::string &name, const std::string &path)
Synchronous [exception] upload.
cbe::util::Optional< cbe::Object > upload(const std::string &name, std::uint64_t length, const char *byteData, delegate::ProgressEventFn &&progressEventFn, UploadError &error)
Synchronous [non-throwing] upload from memory with progress.
delegate::PublishSuccess publish(cbe::PublishAccess security, cbe::PublishVisibility privacy, std::string description, std::string password)
Synchronous [exception] publish.
cbe::util::Optional< cbe::AclMap > getAcl(GetAclError &error)
Synchronous [non-throwing] getAcl.
delegate::container::RenameDelegatePtr RenameDelegatePtr
Definition: Container.h:211
cbe::Object createObject(std::string name, cbe::KeyValues keyValues)
Synchronous [exception] createObject.
delegate::container::RemoveDelegatePtr RemoveDelegatePtr
Definition: Container.h:280
delegate::UnPublishDelegatePtr UnPublishDelegatePtr
Definition: Container.h:1472
cbe::Object createObject(std::string name, cbe::KeyValues keyValues, CreateObjectDelegatePtr delegate)
Create a new object.
void rename(const std::string &name, RenameDelegatePtr delegate)
Change the name of the container.
void unSubscribe(UnSubscribeDelegatePtr delegate)
UnSubscribes from this container.
cbe::Object upload(const std::string &filePath, delegate::ProgressEventFn &&progressEventFn)
Synchronous [exception] upload.
cbe::util::Optional< cbe::Object > upload(const std::string &filePath, UploadError &error)
Synchronous [non-throwing] upload.
cbe::Object upload(const std::string &name, const std::string &path, delegate::ProgressEventFn &&progressEventFn)
Synchronous [exception] upload with progress.
cbe::util::Optional< delegate::ShareDelegate::Success > share(cbe::UserId toUserGroup, std::string description, ShareError &error)
Synchronous [non-throwing] share.
cbe::QueryResult search(std::string tags)
Synchronous [exception] search.
std::shared_ptr< delegate::UnShareDelegate > UnShareDelegatePtr
Definition: Container.h:1309
cbe::util::Optional< cbe::QueryResult > search(std::string tags, SearchError &error)
Synchronous [non-throwing] search.
void setAcl(cbe::AclMap aclMap, SetAclDelegatePtr delegate)
set ACL.
cbe::util::Optional< cbe::Object > upload(const std::string &filePath, delegate::ProgressEventFn &&progressEventFn, UploadError &error)
Synchronous [non-throwing] upload with progress.
cbe::util::Optional< cbe::Container > move(cbe::ContainerId dstId, MoveError &error)
Synchronous [non-throwing] move.
cbe::QueryResult search(cbe::Filter filter, QueryDelegatePtr delegate)
Search using filter.
delegate::ShareDelegatePtr ShareDelegatePtr
Definition: Container.h:1230
void unPublish(UnPublishDelegatePtr delegate)
UnPublishes this container.
cbe::Object upload(const std::string &name, std::uint64_t length, const char *byteData, delegate::ProgressEventFn &&progressEventFn)
Synchronous [exception] upload from memory with progress.
cbe::QueryChain query(QueryDelegatePtr queryDelegate)
Select list of objects.
cbe::Container move(cbe::ContainerId dstId)
Synchronous [exception] move.
cbe::AclMap setAcl(cbe::AclMap aclMap)
Synchronous [exception] setAcl.
cbe::QueryChainExt query(delegate::QueryJoinDelegatePtr delegate)
Select list of objects, for join.
cbe::QueryResult search(std::string tags, QueryDelegatePtr delegate)
Search by tags.
cbe::Object upload(const std::string &name, std::uint64_t length, const char *byteData, UploadDelegatePtr delegate)
Upload from local memory to an object.
cbe::QueryChainSync query(Filter filter, QueryJoinError &error)
Synchronous [non-throwing] Select list of objects using filter, for join.
void remove(RemoveDelegatePtr delegate)
Delete the container.
cbe::util::Optional< cbe::Object > upload(const std::string &name, std::uint64_t length, const char *byteData, UploadError &error)
Synchronous [non-throwing] upload from memory.
cbe::util::Optional< cbe::Container > rename(const std::string &name, RenameError &error)
Synchronous [non-throwing] rename.
cbe::util::Optional< cbe::Object > upload(const std::string &name, const std::string &path, UploadError &error)
Synchronous [non-throwing] upload.
cbe::util::Optional< cbe::Container > createContainer(const std::string &name, CreateContainerError &error)
Synchronous [non-throwing] createContainer.
void publish(cbe::PublishAccess security, cbe::PublishVisibility privacy, std::string description, std::string password, PublishDelegatePtr delegate)
Publishes a container and its content to any user.
cbe::QueryResult queryWithPath(std::string relativePath)
Synchronous [exception] queryWithPath.
delegate::UnShareDelegate::Success unShare(cbe::ShareId shareId)
Synchronous [exception] unShare.
cbe::AclMap getAcl()
Synchronous [exception] getAcl.
delegate::container::MoveDelegatePtr MoveDelegatePtr
Definition: Container.h:140
delegate::PublishDelegatePtr PublishDelegatePtr
Definition: Container.h:1382
cbe::util::Optional< delegate::PublishSuccess > publish(cbe::PublishAccess security, cbe::PublishVisibility privacy, std::string description, std::string password, PublishError &error)
Synchronous [non-throwing] publish.
void share(cbe::UserId toUserGroup, std::string description, ShareDelegatePtr delegate)
Make accessible by other user.
delegate::CreateContainerDelegatePtr CreateContainerDelegatePtr
Definition: Container.h:70
cbe::Container createContainer(const std::string &name, CreateContainerDelegatePtr delegate)
Create a container.
cbe::util::Optional< cbe::Object > upload(const std::string &name, const std::string &path, delegate::ProgressEventFn &&progressEventFn, UploadError &error)
Synchronous [non-throwing] upload with progress.
cbe::util::Optional< delegate::UnSubscribeSuccess > unSubscribe(UnSubscribeError &error)
Synchronous [non-throwing] unSubscribe.
delegate::UnSubscribeDelegatePtr UnSubscribeDelegatePtr
Definition: Container.h:1548
cbe::Object upload(const std::string &filePath)
Synchronous [exception] upload.
std::shared_ptr< delegate::QueryJoinDelegate > QueryJoinDelegatePtr
Definition: Container.h:788
delegate::ShareDelegate::Success share(cbe::UserId toUserGroup, std::string description)
Synchronous [exception] share.
delegate::UploadDelegatePtr UploadDelegatePtr
Definition: Container.h:441
cbe::Object upload(const std::string &filePath, UploadDelegatePtr delegate)
Upload object to container with file given by filePath.
cbe::QueryChainSync query(QueryJoinError &error)
Synchronous [non-throwing] Select list of objects, for join.
cbe::util::Optional< cbe::QueryResult > search(cbe::Filter filter, SearchError &error)
Synchronous [non-throwing] search.
cbe::util::Optional< cbe::QueryResult > queryWithPath(std::string relativePath, queryWithPathError &error)
Synchronous [non-throwing] queryWithPath.
cbe::QueryChain queryWithPath(std::string relativePath, QueryDelegatePtr delegate)
Select list of objects in hierarchy.
cbe::Container rename(const std::string &name)
Synchronous [exception] rename.
void move(cbe::ContainerId dstId, MoveDelegatePtr delegate)
Move a container to a different parent.
delegate::UnSubscribeSuccess unSubscribe()
Synchronous [exception] unSubscribe.
cbe::Object createObject(std::string name, CreateObjectDelegatePtr delegate)
cbe::QueryChainSync query()
Synchronous [exception] Select list of objects.
cbe::util::Optional< cbe::AclMap > setAcl(cbe::AclMap aclMap, SetAclError &error)
Synchronous [non-throwing] setAcl.
delegate::QueryDelegatePtr QueryDelegatePtr
Definition: Container.h:762
A database.
Definition: Database.h:27
Use to select Item that meets specific criterias when doing a query.
Definition: Filter.h:40
A group of members.
Definition: Group.h:42
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
Extension of class QueryChain.
Definition: QueryChain.h:150
Synchronous version of querychain.
Definition: QueryChainSync.h:17
To do a search for Object combining more than one Container table.
Definition: QueryChain.h:32
resultset of data retrieved.
Definition: QueryResult.h:51
Definition: AclDelegate.h:22
Convenience type that bundles the parameter passed to method cbe::delegate::ShareDelegate::onShareSuc...
Definition: PublishSuccess.h:14
QueryDelegate::ErrorInfo ErrorInfo
Definition: QueryJoinDelegate.h:47
Definition: ShareDelegate.h:20
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
Definition: UnShareDelegate.h:20
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::container::RemoveDelegat...
Definition: RemoveDelegate.h:74
Class template Optional manages an optional contained value - i.e., a value that is either present or...
Definition: Optional.h:20
std::shared_ptr< RemoveDelegate > RemoveDelegatePtr
Definition: RemoveDelegate.h:67
std::shared_ptr< RenameDelegate > RenameDelegatePtr
Definition: RenameDelegate.h:64
std::shared_ptr< MoveDelegate > MoveDelegatePtr
Definition: MoveDelegate.h:64
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< 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< CreateContainerDelegate > CreateContainerDelegatePtr
Definition: CreateContainerDelegate.h:67
std::shared_ptr< QueryJoinDelegate > QueryJoinDelegatePtr
Definition: QueryJoinDelegate.h:76
std::shared_ptr< AclDelegate > AclDelegatePtr
Definition: AclDelegate.h:68
std::shared_ptr< QueryDelegate > QueryDelegatePtr
Definition: QueryDelegate.h:100
std::shared_ptr< CreateObjectDelegate > CreateObjectDelegatePtr
Definition: CreateObjectDelegate.h:63
std::shared_ptr< UploadDelegate > UploadDelegatePtr
Definition: UploadDelegate.h:83
std::shared_ptr< UnSubscribeDelegate > UnSubscribeDelegatePtr
Definition: UnSubscribeDelegate.h:69
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
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 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
exception thrown by cbe::Object::getAcl() if the request fails.
Definition: AclDelegate.h:51
Definition: CreateContainerDelegate.h:41
exception thrown by cbe::Container::createContainer() if the request fails.
Definition: CreateContainerDelegate.h:53
Definition: CreateObjectDelegate.h:41
exception thrown by cbe::Container::createObject() if the request fails.
Definition: CreateObjectDelegate.h:51
Definition: PublishDelegate.h:38
exception thrown by:
Definition: PublishDelegate.h:51
Definition: QueryDelegate.h:61
exception thrown by
Definition: QueryDelegate.h:84
Definition: ShareDelegate.h:42
exception thrown by
Definition: ShareDelegate.h:55
Definition: UnPublishDelegate.h:42
exception thrown by
Definition: UnPublishDelegate.h:55
Definition: UnShareDelegate.h:38
exception thrown by
Definition: UnShareDelegate.h:51
Definition: UnSubscribeDelegate.h:41
exception thrown by
Definition: UnSubscribeDelegate.h:54
Definition: UploadDelegate.h:57
exception thrown by cbe::Container::upload(const std::string&,const std::string&) and its overloads i...
Definition: UploadDelegate.h:68
Definition: MoveDelegate.h:43
exception thrown by cbe::Container::move() if the request fails.
Definition: MoveDelegate.h:53
Definition: RemoveDelegate.h:44
exception thrown by cbe::Container::remove() if the request fails.
Definition: RemoveDelegate.h:54
Definition: RenameDelegate.h:43
exception thrown by cbe::Container::rename() if the request fails.
Definition: RenameDelegate.h:53