Package com.cbe
Class Object
java.lang.Object
com.cbe.Item
com.cbe.Object
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.
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.
-
Field Summary
Fields inherited from class com.cbe.Item
swigCMemOwn
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
void
download
(long sizeLimit, DownloadBinaryDelegate delegate) Download the binary data associated with current object.void
download
(String path, DownloadDelegate delegate) Download the data of current object to the the local file system.void
downloadStream
(String path, Stream stream, DownloadDelegate delegate) Download a stream of an Object to local filesystem.void
finalize()
void
getAcl
(AclDelegate delegate) Returns the Access Control List for current Object.static long
Returns the mime type of the object.int
Returns the Object type.void
getStreams
(GetStreamsDelegate delegate) Downloads the streams meta data associated with current object to
the SDK's cache.Returns all the key/values for current object as a map.long
length()
Returns the binary length/size in bytes of current object.void
move
(long dstId, MoveDelegate delegate) Relocates an object to a different container.void
publish
(PublishAccess security, PublishVisibility privacy, String description, String password, PublishDelegate delegate) Publishes current object to any user.void
remove
(RemoveDelegate delegate) Remove the object from cloud and locally.void
rename
(String name, RenameDelegate delegate) Rename object.void
setAcl
(Acl_Map aclMap, AclDelegate delegate) Sets the Access Control List for current object.void
share
(long toUserGroup, String description, ShareDelegate delegate) Share current object to a user.void
unPublish
(UnPublishDelegate delegate) UnPublishes current object.void
unShare
(long shareId, UnShareDelegate delegate) void
unSubscribe
(UnSubscribeDelegate delegate) UnSubscribes from this object.void
updateKeyValues
(UpdateKeyValuesDelegate delegate) Deletes all key/value pairs of data to the object.void
updateKeyValues
(Obj_KV_Map keyValues, UpdateKeyValuesDelegate delegate) Adds key/value pair data to the object.void
uploadStream
(String filePath, long streamId, UploadDelegate delegate) Upload a file for adding a new or replacing existing stream attached
to this 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
-
Object
public Object(long cPtr, boolean cMemoryOwn) -
Object
-
-
Method Details
-
getCPtr
-
finalize
public void finalize() -
delete
public void delete() -
move
Relocates an object to a different container.
Asynchronous version of this service function.
- Parameters:
dstId
- Id of the destination container.delegate
- Pointer to a delegate::object::MoveDelegate instance
that is implemented by the user.
-
rename
Rename object.
Asynchronous version of this service function.
- Parameters:
name
- string name of the object.delegate
- Pointer to a delegate::object::RenameDelegate instance
that is implemented by the user.
-
remove
Remove the object from cloud and locally.
Asynchronous version of this service function.
- Parameters:
delegate
- Pointer to a delegate::object::RemoveDelegate instance
that is implemented by the user.
-
download
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 parameterpath
.
- Parameters:
path
- Folder location, on the local file system, of the file to
be downloaded. This string must end with a slash ("/").delegate
- Pointer to a delegate::DownloadDelegate instance
that is implemented by the user.
-
download
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:
delegate
- Pointer to a delegate::DownloadBinaryDelegate instance
that is implemented by the user.sizeLimit
- Blocks anything larger than the size limit the
user inputs. Prevents accidental downloads of
too large objects on to the device.
-
downloadStream
Download a stream of an Object to local filesystem.
Asynchronous version of this service function.
- Parameters:
path
- Folder location, on the local file system, of the file to be
downloaded. This string must end with a slash ("/").stream
- Get which stream you want by first calling getStream() and
then choose which one to download.delegate
- Pointer to a delegate::DownloadDelegate instance
that is implemented by the user.
-
uploadStream
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:
filePath
- Fully qualified file name. I.e., the path, relative or
absolute, including file name.streamId
- If the stream id already exists, it will be
overwritten.delegate
- Pointer to a delegate::UploadStreamDelegate instance
that is implemented by the user.
-
updateKeyValues
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:
keyValues
- Map of key/value pairs (metadata).delegate
- Pointer to a delegate::UpdateKeyValuesDelegate instance
that is implemented by the user.
-
updateKeyValues
Deletes all key/value pairs of data to the object.
Same as
updateKeyValues(KeyValues,UpdateKeyValuesDelegatePtr),
but without thekeyValues
parameter.
Note: Any and all existing key/values will be erased. -
getStreams
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,
seeuploadStream()
- Parameters:
delegate
- Pointer to a delegate::GetStreamsDelegate instance
that is implemented by the user.
-
getMimeType
Returns the mime type of the object.
E.g., application/pdf, audio/wav, image/jpg, text/xml, video/mp4 etc. -
length
public long length()Returns the binary length/size in bytes of current object. -
getObjectType
public int getObjectType() -
keyValues
Returns all the key/values for current object as a map. -
getAcl
Returns the Access Control List for current Object.
Asynchronous version of this service function.
- Parameters:
delegate
- Pointer to a delegate::AclDelegate instance
that is implemented by the user.
-
setAcl
Sets the Access Control List for current object.
Asynchronous version of this service function.
- Parameters:
aclMap
- The desired permission
for current object.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 current object to any user.
Asynchronous version of this service function.
Can be revoked with unPublish()
- Parameters:
security
- A cbe::PublishAccess enumprivacy
- A cbe::WebShareVisibility enumdescription
- Free textpassword
- Passworddelegate
- Pointer to a delegate::PublishDelegate instance
that is implemented by the user.
-
unPublish
UnPublishes current object.
Asynchronous version of this service function.
Revokes previous publish().
- Parameters:
delegate
- Pointer to a delegate::UnPublishDelegate instance
that is implemented by the user.
-
unSubscribe
UnSubscribes from this object.
Asynchronous version of this service function.
Revokes the subscription previously established with
cbe::SubscribeManager::subscribe()
- Parameters:
delegate
- Pointer to a delegate::UnSubscribeDelegate instance
that is implemented by the user.
-