Package com.cbe
Class Container
java.lang.Object
com.cbe.Item
com.cbe.Container
A collection of Item, can also represent a table or folder.
-
Field Summary
Fields inherited from class com.cbe.Item
swigCMemOwn
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateContainer
(String name, CreateContainerDelegate delegate) Create a container.createObject
(String name, CreateObjectDelegate delegate) Create a new empty object.createObject
(String name, Obj_KV_Map keyValues, CreateObjectDelegate delegate) Create a new object.void
delete()
void
finalize()
void
getAcl
(AclDelegate delegate) Retrieves its ACL map.static long
void
move
(long dstId, MoveDelegate delegate) Move a container to a different parent.void
publish
(PublishAccess security, PublishVisibility privacy, String description, String password, PublishDelegate delegate) Publishes a container and its content to any user.query
(QueryDelegate queryDelegate) Select list of objects.query
(QueryJoinDelegate delegate) Select list of objects, for join.query
(Filter filter, QueryDelegate delegate) Select list of objects using filter.query
(Filter filter, QueryJoinDelegate delegate) Select list of objects using filter, for join.queryWithPath
(String relativePath, QueryDelegate delegate) Select list of objects in hierarchy.void
remove
(RemoveDelegate delegate) Delete the container.void
rename
(String name, RenameDelegate delegate) Change the name of the container.search
(Filter filter, QueryDelegate delegate) Search using filter.search
(String tags, QueryDelegate delegate) Search by tags.void
setAcl
(Acl_Map aclMap, AclDelegate delegate) set ACL.void
share
(long toUserGroup, String description, ShareDelegate delegate) Make accessible by other user.void
unPublish
(UnPublishDelegate delegate) UnPublishes this container.void
unShare
(long shareId, UnShareDelegate delegate) Revoke a previous share.void
unSubscribe
(UnSubscribeDelegate delegate) UnSubscribes from this container.upload
(String filePath, UploadDelegate delegate) Upload object to container with file given byfilePath
.upload
(String name, String path, UploadDelegate delegate) Create an object in current container by uploading a file.uploadBinary
(String name, byte[] byteData, UploadDelegate delegate) Upload from local memory to an object.Methods inherited from class com.cbe.Item
aclMap, aclTag, created, databaseId, dataLoaded, deleted, description, getCPtr, getPublished, getShareFromUserId, getShareIds, getSubscribe, getUserFromShareId, hasPublished, hasSubscribe, id, idLoaded, name, oldParentId, ownerId, parentId, path, type, updated, username
-
Constructor Details
-
Container
public Container(long cPtr, boolean cMemoryOwn) -
Container
-
-
Method Details
-
getCPtr
-
finalize
public void finalize() -
delete
public void delete() -
createContainer
Create a container.
Creates a container inside this container to be used for adding objects.- Parameters:
name
- Name of the container to be created.delegate
- Pointer to a delegate::CreateContainerDelegate
instance that is implemented by the user.
-
move
Move a container to a different parent.
Used to move container with its content to user specified location
e.g., other container or to root container.- Parameters:
dstId
- id of the container to which it should be moved to.delegate
- Pointer to a delegate::container::MoveDelegate instance
that is implemented by the user.
-
rename
Change the name of the container.
Rename the container.- Parameters:
name
- New name of the container.delegate
- Pointer to a delegate::container::RenameDelegate instance
that is implemented by the user.
-
remove
Delete the container.
Removes/deletes the container and all its content.
- Parameters:
delegate
- Pointer to a delegate::container::RemoveDelegate instance
that is implemented by the user.
-
createObject
Create a new object.
Creates an object with indexed tags or indexed tags + non indexed tags
a.k.a. metadata, key/value pairs.- Parameters:
name
- Name of the object.keyValues
- Optional map of key/value pairs (metadata).delegate
- Pointer to a delegate::CreateObjectDelegate instance
that is implemented by the user.
Note: If an old object with the same name already exists
that will be removed.
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.
-
createObject
Create a new empty object. Same as createObject(std::string, cbe::KeyValues, CreateObjectDelegatePtr),
but without thekeyValues
parameter. -
upload
Upload object to container with file given byfilePath
.
See upload(const std::string&,const std::string& path,UploadDelegatePtr)- Parameters:
filePath
- Fully qualified file name. I.e., the path, relative or
absolute, including file name.
-
upload
Create an object in current container by uploading a file.
Object is named byname
, residing atpath
.
The object being created is instantly returned with
a temporary id. When the response is retrieved from from the server,
via callback method
onUploadSuccess()
the object will be updated with its final unique id.- Parameters:
name
- Name of local file name. The object, that is created, will
be given the same name.path
- Path to local folder where the file is located.
The can be relative or absolute and must end with a
slash (/).delegate
- Pointer to a delegate::UploadDelegate instance
that is implemented by the user.- Returns:
- The created Object, first with its temporary id, and after
successful with is final id.
-
uploadBinary
Upload from local memory to an object.- Parameters:
name
- name that the uploaded object will getlength
- size of file in BytesbyteData
- (char pointer to an array containing the data).delegate
- Pointer to a delegate::UploadDelegate instance
that is implemented by the user.
-
query
Select list of objects.
In line with function
CloudBackend::query(ContainerId, QueryDelegatePtr), but with
itsContainerId
parameter excluded.
see CloudBackend::query(ContainerId, QueryDelegatePtr) -
query
Select list of objects using filter.
In line with function
CloudBackend::query(ContainerId, Filter, QueryDelegatePtr), but
with itsContainerId
parameter excluded.
see CloudBackend::query(ContainerId, Filter, QueryDelegatePtr) //doxygen \ does not work -
query
Select list of objects, for join.
In line with function
CloudBackend::query(ContainerId, delegate::QueryJoinDelegatePtr), but with
itsContainerId
parameter excluded.
see CloudBackend::query(ContainerId,delegate::QueryJoinDelegatePtr) -
query
Select list of objects using filter, for join.
In line with function
CloudBackend::query(ContainerId, Filter, delegate::QueryJoinDelegatePtr),
but with itsContainerId
parameter excluded.
see CloudBackend::query(ContainerId,Filter,delegate::QueryJoinDelegatePtr) -
queryWithPath
Select list of objects in hierarchy.
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 . path options are not available,
top down Paths in the container tree are available.- Parameters:
relativePath
- container path, e.g. /Documents/Picturesdelegate
- Pointer to a delegate::QueryDelegate instance
that is implemented by the user.
-
search
Search by tags.
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 separated 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:
tags
- is a string of key tags or key:value pairs
that are separated by |.delegate
- Pointer to a delegate::QueryDelegate instance
that is implemented by the user.
-
search
Search using filter.
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
separated 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:
filter
- is 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 separated by |.delegate
- Pointer to a delegate::QueryDelegate instance
that is implemented by the user.
-
setAcl
set ACL.
Set the Access Control ListACL
for the container.
For containers set does set the whole container tree,
so all its sub items as well.
Remember this is set and not update so every time you set
all ids that should be there should be added.- Parameters:
aclMap
- The desired permissions
for current container.delegate
- Pointer to a delegate::AclDelegate instance
that is implemented by the user.
-
getAcl
Retrieves its ACL map.
get the Access Control ListACL
of the Container.- Parameters:
delegate
- Pointer to a delegate::AclDelegate instance
that is implemented by the user.
-
publish
public void publish(PublishAccess security, PublishVisibility privacy, String description, String password, PublishDelegate delegate) Publishes a container and its content to any user.
Asynchronous version of this service function.
Can be revoked with unPublish()
- Parameters:
security
- A cbe::PublishAccess enumprivacy
- A cbe::PublishVisibility enumdescription
- Free textpassword
- Passworddelegate
- Pointer to a delegate::PublishDelegate instance
that is implemented by the user.
-
unPublish
UnPublishes this container.
Asynchronous version of this service function.
Revokes previous publish().
- Parameters:
delegate
- Gets notified when the container has been
unPublished (or if there was an error)
-
unSubscribe
UnSubscribes from this container.
Asynchronous version of this service function.
Revokes the subscription previously established with
cbe::SubscribeManager::subscribe()
- Parameters:
delegate
- Gets notified when the container has been
unSubscribed (or if there was an error)
-