Package com.cbe

Class Object


public class Object extends Item
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.
  • Constructor Details

    • Object

      public Object(long cPtr, boolean cMemoryOwn)
    • Object

      public Object(DefaultCtor arg0)
  • Method Details

    • getCPtr

      public static long getCPtr(Object obj)
    • finalize

      public void finalize()
      Overrides:
      finalize in class Item
    • delete

      public void delete()
      Overrides:
      delete in class Item
    • move

      public void move(long dstId, MoveDelegate delegate)
      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

      public void rename(String name, RenameDelegate delegate)
      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

      public void remove(RemoveDelegate delegate)
      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

      public void download(String path, DownloadDelegate delegate)
      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 parameter path.

      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

      public void download(long sizeLimit, DownloadBinaryDelegate delegate)
      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

      public void downloadStream(String path, Stream stream, DownloadDelegate delegate)
      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

      public void uploadStream(String filePath, long streamId, UploadDelegate delegate)
      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

      public void updateKeyValues(Obj_KV_Map keyValues, UpdateKeyValuesDelegate delegate)
      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

      public void updateKeyValues(UpdateKeyValuesDelegate delegate)
      Deletes all key/value pairs of data to the object.

      Same as
      updateKeyValues(KeyValues,UpdateKeyValuesDelegatePtr),
      but without the keyValues parameter.
      Note: Any and all existing key/values will be erased.
    • getStreams

      public void getStreams(GetStreamsDelegate delegate)
      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,
      see uploadStream()
      Parameters:
      delegate - Pointer to a delegate::GetStreamsDelegate instance
      that is implemented by the user.
    • getMimeType

      public String 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()
      Returns the Object type.

      See cbe::ObjectType.
    • keyValues

      public Obj_KV_Map keyValues()
      Returns all the key/values for current object as a map.
    • getAcl

      public void getAcl(AclDelegate delegate)
      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

      public void setAcl(Acl_Map aclMap, AclDelegate delegate)
      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.
    • share

      public void share(long toUserGroup, String description, ShareDelegate delegate)
      Share current object to a user.

      Asynchronous version of this service function.

      Notifies the user that a share has ocurred so that
      the user can check what permissions the have been given. Sharing 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 - Pointer to a delegate::ShareDelegatePtr instance
      that is implemented by the user.
    • unShare

      public void unShare(long shareId, UnShareDelegate delegate)


      Unshare the object to a specific shareId created when sharing.

      Asynchronous version of this service function.

      Each share is unique between user/group and the one sharing.
      This is represented with a unique share id.
      Parameters:
      shareId - The unique id for a share between the owner and other
      user/group.
      delegate - Pointer to a delegate::UnShareDelegate 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 enum
      privacy - A cbe::WebShareVisibility enum
      description - Free text
      password - Password
      delegate - Pointer to a delegate::PublishDelegate instance
      that is implemented by the user.
    • unPublish

      public void unPublish(UnPublishDelegate delegate)
      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

      public void unSubscribe(UnSubscribeDelegate delegate)
      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.