Package com.cbe

Class Container

java.lang.Object
com.cbe.Item
com.cbe.Container

public class Container extends Item
A collection of Item, can also represent a table or folder.
  • Constructor Details

    • Container

      public Container(long cPtr, boolean cMemoryOwn)
    • Container

      public Container(DefaultCtor arg0)
  • Method Details

    • getCPtr

      public static long getCPtr(Container obj)
    • finalize

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

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

      public Container createContainer(String name, CreateContainerDelegate delegate)
      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

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

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

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

      public Object createObject(String name, Obj_KV_Map keyValues, CreateObjectDelegate delegate)
      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

      public Object createObject(String name, CreateObjectDelegate delegate)
      Create a new empty object. Same as createObject(std::string, cbe::KeyValues, CreateObjectDelegatePtr),
      but without the keyValues parameter.
    • upload

      public Object upload(String filePath, UploadDelegate delegate)
      Upload object to container with file given by filePath.
      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

      public Object upload(String name, String path, UploadDelegate delegate)
      Create an object in current container by uploading a file.
      Object is named by name, residing at path.

      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

      public Object uploadBinary(String name, byte[] byteData, UploadDelegate delegate)
      Upload from local memory to an object.
      Parameters:
      name - name that the uploaded object will get
      length - size of file in Bytes
      byteData - (char pointer to an array containing the data).
      delegate - Pointer to a delegate::UploadDelegate instance
      that is implemented by the user.
    • query

      public QueryChain query(QueryDelegate queryDelegate)
      Select list of objects.
      In line with function
      CloudBackend::query(ContainerId, QueryDelegatePtr), but with
      its ContainerId parameter excluded.
      see CloudBackend::query(ContainerId, QueryDelegatePtr)
    • query

      public QueryChain query(Filter filter, QueryDelegate delegate)
      Select list of objects using filter.
      In line with function
      CloudBackend::query(ContainerId, Filter, QueryDelegatePtr), but
      with its ContainerId parameter excluded.
      see CloudBackend::query(ContainerId, Filter, QueryDelegatePtr) //doxygen \ does not work
    • query

      public QueryChainExt query(QueryJoinDelegate delegate)
      Select list of objects, for join.
      In line with function
      CloudBackend::query(ContainerId, delegate::QueryJoinDelegatePtr), but with
      its ContainerId parameter excluded.
      see CloudBackend::query(ContainerId,delegate::QueryJoinDelegatePtr)
    • query

      public QueryChainExt query(Filter filter, QueryJoinDelegate delegate)
      Select list of objects using filter, for join.
      In line with function
      CloudBackend::query(ContainerId, Filter, delegate::QueryJoinDelegatePtr),
      but with its ContainerId parameter excluded.
      see CloudBackend::query(ContainerId,Filter,delegate::QueryJoinDelegatePtr)
    • queryWithPath

      public QueryChain queryWithPath(String relativePath, QueryDelegate delegate)
      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/Pictures
      delegate - Pointer to a delegate::QueryDelegate instance
      that is implemented by the user.
    • search

      public QueryResult search(String tags, QueryDelegate delegate)
      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

      public QueryResult search(Filter filter, QueryDelegate delegate)
      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

      public void setAcl(Acl_Map aclMap, AclDelegate delegate)
      set ACL.
      Set the Access Control List ACL 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

      public void getAcl(AclDelegate delegate)
      Retrieves its ACL map.
      get the Access Control List ACL of the Container.
      Parameters:
      delegate - Pointer to a delegate::AclDelegate instance
      that is implemented by the user.
    • share

      public void share(long toUserGroup, String description, ShareDelegate delegate)
      Make accessible by other user.
      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 ACL .
      Note: At present Sharing the container gives the user read permissions for
      the container and all its sub-items, this might change in the future.
      Parameters:
      toUserGroup - takes a user id or group id to share to.
      description - names the specific share between you and the user/group.
      delegate - Pointer to a delegate::ShareDelegate instance
      that is implemented by the user.
    • unShare

      public void unShare(long shareId, UnShareDelegate delegate)
      Revoke a previous share.
      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:
      shareId - is as mentioned 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 a container and its content to any user.
      Asynchronous version of this service function.

      Can be revoked with unPublish()

      Parameters:
      security - A cbe::PublishAccess enum
      privacy - A cbe::PublishVisibility 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 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

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