Package com.cbe
Class Object
- java.lang.Object
-
- com.cbe.Item
-
- com.cbe.Object
-
public class Object extends Item
Class Object, API:s to create, download and Object management on the server / edge node.
-
-
Constructor Summary
Constructors Constructor Description Object()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
download(TransferDownloadEventProtocol delegate)
Download object with binary data from contair and passes it to the delegate.void
download(java.lang.String path, TransferDownloadEventProtocol delegate)
Download object with path from a container to local:void
downloadStream(java.lang.String path, Stream stream, TransferDownloadEventProtocol delegate)
Downloads the stream # with stream id, to a path of the your choice.void
getACL(ShareEventProtocol delegate)
get the Access Control List for the Object.java.lang.String
getMimeType()
Returns the mime type of the object e.g xml/text or jpg e.t.cint
getObjectType()
Returns the Object type currently Other | GroupInvite | ShareInvitevoid
getStreams(ItemEventProtocol delegate)
Returns the streams attached to the Object, use object->_streams after this call to use the streams e.g in downloadStream.Obj_KV_Map
keyValues()
Returns all the keyValueslong
length()
Returns the binary length/size of the object.void
move(long destinationContainerId, ItemEventProtocol delegate)
Move object to either a container or the root container:void
remove(ItemEventProtocol delegate)
Remove the object from cloud and locallyvoid
rename(java.lang.String name, ItemEventProtocol delegate)
Rename object:void
setACL(ACL_Map ACL, ShareEventProtocol delegate)
set the Access control list for the object.
void
share(long toUserGroup, java.lang.String description, ShareEventProtocol delegate)
Share Object to a user.Streams_Vec
streams()
Returns the currently loaded stream / streams attached to the object.void
unShare(long shareId, ShareEventProtocol delegate)
unShare the object to a specific shareId created when sharing.void
updateKeyValues(ItemEventProtocol delegate)
Adds keyValue data to the existing object, if data has the same name it will be overwritten else itt will add to the existing keyValue on the object.void
updateKeyValues(ItemEventProtocol delegate, Obj_KV_Map metadata)
Adds keyValue data to the existing object, if data has the same name it will be overwritten else itt will add to the existing keyValue on the object.-
Methods inherited from class com.cbe.Item
ACLMap, aclTag, created, dataLoaded, deleted, description, driveId, getShareFromUserId, getShareIds, getUserFromShareId, id, idLoaded, name, oldParentId, ownerId, parentId, path, type, updated, username
-
-
-
-
Method Detail
-
move
public void move(long destinationContainerId, ItemEventProtocol delegate)
Move object to either a container or the root container:- Parameters:
destinationContainerId
- : destionation container Id.delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
-
rename
public void rename(java.lang.String name, ItemEventProtocol delegate)
Rename object:- Parameters:
name
- string name of the object.delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
-
remove
public void remove(ItemEventProtocol delegate)
Remove the object from cloud and locally- Parameters:
delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
-
download
public void download(java.lang.String path, TransferDownloadEventProtocol delegate)
Download object with path from a container to local:- Parameters:
path
- to where it will be downloaded.delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on TransferDownloadEventProtocol.
-
download
public void download(TransferDownloadEventProtocol delegate)
Download object with binary data from contair and passes it to the delegate. This is data is on the heap and you are responsible for calling delete on it, though we may change it to a shared pointer in the future.- Parameters:
delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on TransferDownloadEventProtocol.
-
downloadStream
public void downloadStream(java.lang.String path, Stream stream, TransferDownloadEventProtocol delegate)
Downloads the stream # with stream id, to a path of the your choice. To get which streams are added on a object use getStream.- Parameters:
path
- : Select which path you want to download the stream to.
delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on TransferDownloadEventProtocol.
-
updateKeyValues
public void updateKeyValues(ItemEventProtocol delegate, Obj_KV_Map metadata)
Adds keyValue data to the existing object, if data has the same name it will be overwritten else itt will add to the existing keyValue on the object.- Parameters:
delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.metadata
- : (Optional) Metadata is a map with the keyValue (key), the associated value of that key and if it is indexed or not
-
updateKeyValues
public void updateKeyValues(ItemEventProtocol delegate)
Adds keyValue data to the existing object, if data has the same name it will be overwritten else itt will add to the existing keyValue on the object.- Parameters:
delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
-
getStreams
public void getStreams(ItemEventProtocol delegate)
Returns the streams attached to the Object, use object->_streams after this call to use the streams e.g in downloadStream.- Parameters:
delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
-
streams
public Streams_Vec streams()
Returns the currently loaded stream / streams attached to the object. (NB if getStreams has not been called then streams() will return NULL).
-
getMimeType
public java.lang.String getMimeType()
Returns the mime type of the object e.g xml/text or jpg e.t.c
-
length
public long length()
Returns the binary length/size of the object.
-
getObjectType
public int getObjectType()
Returns the Object type currently Other | GroupInvite | ShareInvite
-
keyValues
public Obj_KV_Map keyValues()
Returns all the keyValues
-
setACL
public void setACL(ACL_Map ACL, ShareEventProtocol delegate)
set the Access control list for the object.
- Parameters:
delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ShareEventProtocol.
-
getACL
public void getACL(ShareEventProtocol delegate)
get the Access Control List for the Object.- Parameters:
delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ShareEventProtocol.
-
share
public void share(long toUserGroup, java.lang.String description, ShareEventProtocol delegate)
Share Object to a user. Notifies the user that a share has occured so that the user can check what permissions the've been given. Shareing gives read permissions as of right now but might change in the future.- Parameters:
toUserGroup
- takes a user id or group id (lastly named is for the future) and share to.description
- names the specific share between you and the user/group.delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ShareEventProtocol.
-
unShare
public void unShare(long shareId, ShareEventProtocol delegate)
unShare the object 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:
shareId
- is as mentioned the unique id for a share between the owner and other user/group.delegate
- , delegate is a callback delegate to the user defined/implementation of the callbacks on ShareEventProtocol.
-
-