C++  1.4.6
CloudBackend Software Development Kit - SDK API for C++
Public Member Functions | Protected Types | Protected Member Functions | List of all members
CBE::Container Class Reference
Inheritance diagram for CBE::Container:
Inheritance graph
[legend]
Collaboration diagram for CBE::Container:
Collaboration graph
[legend]

Public Member Functions

virtual ContainerPtr create (const std::string &name, CBE::ItemDelegatePtr delegate)
 
virtual void move (CBE::container_id_t destinationId, CBE::ItemDelegatePtr delegate)
 
virtual void rename (const std::string &name, CBE::ItemDelegatePtr delegate)
 
virtual void remove (CBE::ItemDelegatePtr delegate)
 
virtual CBE::ObjectPtr createObject (std::string name, CBE::ItemDelegatePtr delegate, metadata_type metadata=metadata_type())
 
virtual CBE::ObjectPtr upload (const std::string &name, const std::string &path, CBE::TransferUploadDelegatePtr delegate)
 
virtual CBE::ObjectPtr upload (const std::string &name, uint64_t length, char *byteData, CBE::TransferUploadDelegatePtr delegate)
 
virtual QueryChainPtr query (CBE::ItemDelegatePtr delegate)
 
virtual QueryChainPtr query (CBE::Filter filter, CBE::ItemDelegatePtr delegate)
 
virtual CBE::QueryChainPtr queryWithPath (std::string relativePath, CBE::ItemDelegatePtr delegate)
 
virtual QueryResultPtr search (std::string tags, CBE::ItemDelegatePtr delegate)
 
virtual QueryResultPtr search (CBE::Filter filter, CBE::ItemDelegatePtr delegate)
 
virtual void setACL (std::map< CBE::user_id_t, CBE::permission_status_t > toUserPermissions, CBE::ShareDelegatePtr delegate)
 
virtual void getACL (CBE::ShareDelegatePtr delegate)
 
virtual void share (user_id_t toUserGroup, std::string description, CBE::ShareDelegatePtr delegate)
 
virtual void unShare (uint64_t shareId, CBE::ShareDelegatePtr delegate)
 
- Public Member Functions inherited from CBE::Item
virtual std::map< uint64_t, std::vector< CBE::ShareData > > getShareIds () const
 
virtual CBE::share_id_t getShareFromUserId (user_id_t userId)
 
virtual CBE::user_id_t getUserFromShareId (user_id_t shareId)
 
virtual std::string aclTag () const
 
virtual std::string description () const
 
virtual CBE::item_id_t id () const
 
virtual CBE::container_id_t parentId () const
 
virtual CBE::container_id_t oldParentId () const
 
virtual std::string name () const
 
virtual std::string path () const
 
virtual CBE::user_id_t ownerId () const
 
virtual CBE::container_id_t driveId () const
 
virtual std::string username () const
 
virtual bool idLoaded () const
 
virtual bool dataLoaded () const
 
virtual CBE::date_t created () const
 
virtual CBE::date_t updated () const
 
virtual CBE::date_t deleted () const
 
virtual CBE::item_t type () const
 
virtual bool operator< (const CBE::Item &other) const
 
std::map< uint64_t, CBE::permission_status_t > ACLMap () const
 
virtual ~Item ()
 

Protected Types

typedef std::map< std::string, std::pair< std::string, bool > > metadata_type
 

Protected Member Functions

 Container ()
 

Member Function Documentation

◆ create()

virtual ContainerPtr CBE::Container::create ( const std::string &  name,
CBE::ItemDelegatePtr  delegate 
)
virtual

Create's a container Inside this containerto be used for adding objects.

Parameters
namefor the container.
delegateis a shared pointer to an ItemEventProtocol that the user has implemented.
The pointer is defined in Types.h.

◆ move()

virtual void CBE::Container::move ( CBE::container_id_t  destinationId,
CBE::ItemDelegatePtr  delegate 
)
virtual

Move is used to move container whith its content to user specified location ex other container or to root container.

Parameters
destinationIdid of the container to which it should be moved to.
delegateis a shared pointer to an ItemEventProtocol that the user has implemented.
The pointer is defined in Types.h.

◆ rename()

virtual void CBE::Container::rename ( const std::string &  name,
CBE::ItemDelegatePtr  delegate 
)
virtual

Rename the container.

Parameters
nameis the new name.
delegateis a shared pointer to an ItemEventProtocol that the user has implemented.
The pointer is defined in Types.h.

◆ remove()

virtual void CBE::Container::remove ( CBE::ItemDelegatePtr  delegate)
virtual

Removes/deletes the container and all its content.

Parameters
delegateis a shared pointer to an ItemEventProtocol that the user has implemented.
The pointer is defined in Types.h.

◆ createObject()

virtual CBE::ObjectPtr CBE::Container::createObject ( std::string  name,
CBE::ItemDelegatePtr  delegate,
metadata_type  metadata = metadata_type() 
)
virtual

Creates an object with indexed tags or indexed tags + non indexed tags.

Parameters
nameof the new object.
delegateis a shared pointer to an ItemEventProtocol that the user has implemented.
The pointer is defined in Types.h.
metadata(Optional) Metadata is a map with the tag (key), the value of that tag and if it is indexed or not.

◆ upload() [1/2]

virtual CBE::ObjectPtr CBE::Container::upload ( const std::string &  name,
const std::string &  path,
CBE::TransferUploadDelegatePtr  delegate 
)
virtual

Upload object to container with path, the object is instantly returned with a temporary id. Once the response from the server is called back the object gets updated with the correct unique object id:

Parameters
nameof the file to upload and will be the name of the object
pathis the path to the local directory, ending with a /
delegateis a shared pointer to an TransferEventProtocol that the user has implemented.
The pointer is defined in Types.h.

◆ upload() [2/2]

virtual CBE::ObjectPtr CBE::Container::upload ( const std::string &  name,
uint64_t  length,
char *  byteData,
CBE::TransferUploadDelegatePtr  delegate 
)
virtual

Upload object to container with binary data.

Parameters
namethe name of the object to hold the data
lengthsize in Bytes in memory to be uploaded
byteDatachar pointer to an array in memory containing the data
delegateis a shared pointer to an TransferEventProtocol that the user has implemented.
The pointer is defined in Types.h.

◆ query() [1/2]

virtual QueryChainPtr CBE::Container::query ( CBE::ItemDelegatePtr  delegate)
virtual

Call to get a list of items in the container. Implement onQueryLoaded to from CBE::ItemDelegatePtrto recieve the callback.

Parameters
delegateis a shared pointer to the class in which you implement CBE::ItemDelegate. CBE::ItemDelegate is defined in Types.h and is a shared pointer to an ItemEventProtocol.

◆ query() [2/2]

virtual QueryChainPtr CBE::Container::query ( CBE::Filter  filter,
CBE::ItemDelegatePtr  delegate 
)
virtual

Call to get a list of items in the contianer. Implement onQueryLoaded to from CBE::ItemDelegatePtrto recieve the callback.

Parameters
filteris a CBE::Filter on which you can set how you want data selected in the call.
delegateis a shared pointer to the class in which you implement CBE::ItemDelegate, which is defined in Types.h and is a shared pointer to an ItemEventProtocol.

◆ queryWithPath()

virtual CBE::QueryChainPtr CBE::Container::queryWithPath ( std::string  relativePath,
CBE::ItemDelegatePtr  delegate 
)
virtual

Queries the container with a given relative path, returns container with objects. E.g.: /Documents/Pictures will return objects and subContainers for Pictures. Note! .. or . options are not available, top down Paths in the container tree are available.

Parameters
relativePathis a relative path to the sub container, e.g. /Documents/Pictures.
delegateis a shared pointer to the class in which you implement CBE::ItemEventProtocol to recieve the callback on function completion.

◆ search() [1/2]

virtual QueryResultPtr CBE::Container::search ( std::string  tags,
CBE::ItemDelegatePtr  delegate 
)
virtual

Search the whole container for tags related to Objects in the container structure. E.g.: Key = Name, Value Contract/Object/Song => Name:Contract1.

Search handles tags in combination of conjunctions of keys and/or key values seperated by |. E.g.: Name:*|Country:Sweden|Country:Norway, this would search for objects with key Name but any value and where key Country is either Sweden or Norway.

Parameters
tagsis a string of key tags or key:value pairs that are seperated by |.
delegateis the callback pointer to when the API returns from either cache or Server.

◆ search() [2/2]

virtual QueryResultPtr CBE::Container::search ( CBE::Filter  filter,
CBE::ItemDelegatePtr  delegate 
)
virtual

Search the whole container for tags related to Objects in the container structure. E.g.: Key = Name, Value Contract/Object/Song => Name:Contract1.

Search handles tags in combination / conjunction of keys and/or key values seperated by |. E.g.: Name:*|Country:Sweden|Country:Norway, this would search for objects with key Name but any value and where key Country is either Sweden or Norway.

Parameters
filteris a CBE::Filter on which you can set how you want data to be ordered when searching, remember to set the queryString to be keys/tags or key:value pairs that are seperated by |.
delegateis the callback pointer to when the API returns from either cache or Server.

◆ setACL()

virtual void CBE::Container::setACL ( std::map< CBE::user_id_t, CBE::permission_status_t >  toUserPermissions,
CBE::ShareDelegatePtr  delegate 
)
virtual

set the Access control list for the container. For containers set does set the whole container tree, so all its sub items as well. Remeber this is set and not update so everytime you set all ids that should be there should be added.

Parameters
toUserPermissionsis a std::map of uint64_t and signed int (userId and permission), simply setting the permission you want to a valid user id that you want. CBE::permission_status_t is defined in Types.h.
delegateis a shared pointer to the class in wich you implement CBE::ShareDelegate, which is defined in Types.h and is a shared pointer to an ShareEventProtocol.

◆ getACL()

virtual void CBE::Container::getACL ( CBE::ShareDelegatePtr  delegate)
virtual

get the Access Control List for the Container.

Parameters
delegateis a shared pointer to the class in which you implement CBE::ShareDelegate, which is defined in Types.h and is a shared pointer to an ShareEventProtocol.

◆ share()

virtual void CBE::Container::share ( user_id_t  toUserGroup,
std::string  description,
CBE::ShareDelegatePtr  delegate 
)
virtual

Shares a container and its content to a user.
This provides the user the ability to access what has been shared to them via the listAvailableShares command.
To allow users to view and change shared information see ACLs. Note: At present Shareing the container gives the user read permissions for the container and all its sub-items, this might change in the future.

Parameters
toUserGrouptakes a user id or group id to share to.
descriptionnames the specific share between you and the user/group.
delegateis a shared pointer to the class in wich you implement CBE::ShareDelegate, which is defined in Types.h and is a shared pointer to a ShareEventProtocol.

◆ unShare()

virtual void CBE::Container::unShare ( uint64_t  shareId,
CBE::ShareDelegatePtr  delegate 
)
virtual

unShare the container to a specific shareId created when sharing. Each share is unique between user/group and the one sharing. This is represented with a unique share id.

Parameters
shareIdis as mentioned the unique id for a share between the owner and other user/group.
delegateis a shared pointer to the class in wich you implement CBE::ShareDelegate. which is defined in Types.h and is a shared pointer to a ShareEventProtocol,

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