Package com.cbe

Class CloudBackend


  • public class CloudBackend
    extends java.lang.Object
    class CloudBackend, Server/Edge Node API:s to login, query e.t.c.
    • Constructor Summary

      Constructors 
      Constructor Description
      CloudBackend()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Account account()
      Returns the account object with user account info.
      void addListener​(ItemEventProtocol delegate)
      adds a listner that will recieve updates as changes occur on the account.
      static Container castContainer​(Item item)
      casts an item to a container.
      static Object castObject​(Item item)
      casts an item to an object
      boolean clearCache()
      clears the cache to prevent memory issues in case of a very large cache.
      static CloudBackend createAccount​(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String firstName, java.lang.String lastName, java.lang.String source, AccountEventProtocol delegate)
      Source is not currently being used and should be fixed.
      Call to create an account.
      GroupManager groupManager()
      Returns the groupManager object which list and search group apis are listed.
      static CloudBackend logIn​(java.lang.String username, java.lang.String password, java.lang.String source, AccountEventProtocol delegate)
      This should return a instance of cloudbackend giving the user access to the root contianer and logIng in the user
      static CloudBackend logIn​(java.lang.String username, java.lang.String password, java.lang.String source, java.lang.String host, AccountEventProtocol delegate)
      This should return a instance of cloudbackend giving the user access to the root contianer and logIng in the user
      QueryChain query​(long containerId, Filter filter, ItemEventProtocol delegate)
      Call to get a list of items in the container using a filter.
      QueryChain query​(long containerId, ItemEventProtocol delegate)
      Call to get a list of items in the container.
      QueryChain queryWithPath​(java.lang.String relativePath, ItemEventProtocol delegate)
      Queries with a given path to the container or object given in the path
      QueryChain queryWithPath​(java.lang.String relativePath, ItemEventProtocol delegate, long queryRoot)
      Queries with a given path to the container or object given in the path
      void removeListener​(ItemEventProtocol delegate)
      removes a listner that will recieve updates as changes occur on the account
      QueryResult search​(Filter filter, long containerId, ItemEventProtocol delegate)
      Search the whole container for tags related to Objects in the container structure.
      QueryResult search​(java.lang.String tags, long containerId, ItemEventProtocol delegate)
      Search the whole container for tags related to Objects in the container structure.
      ShareManager shareManager()
      Returns the shareManager object where list available and list my shares are available.
      java.lang.String version()
      Returns the version of the CloudBackend SDK.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CloudBackend

        public CloudBackend()
    • Method Detail

      • logIn

        public static CloudBackend logIn​(java.lang.String username,
                                         java.lang.String password,
                                         java.lang.String source,
                                         AccountEventProtocol delegate)
        This should return a instance of cloudbackend giving the user access to the root contianer and logIng in the user
        Parameters:
        username - of the user to be signed in
        password - of the user to be signed in
        source - is the identifier for the tenant
        delegate - , AccountDelegate is a callback delegate to the user defined/implementation of the callbacks on AccountEventProtocol.
      • logIn

        public static CloudBackend logIn​(java.lang.String username,
                                         java.lang.String password,
                                         java.lang.String source,
                                         java.lang.String host,
                                         AccountEventProtocol delegate)
        This should return a instance of cloudbackend giving the user access to the root contianer and logIng in the user
        Parameters:
        username - of the user to be signed in
        password - of the user to be signed in
        source - is the identifier for the tenant
        host - can be set to our core v1.cloudbackend.com for now but in the future edge nodes and public cloud ip:s
        delegate - , AccountDelegate is a callback delegate to the user defined implementation of the callbacks on AccountEventProtocol.
      • createAccount

        public static CloudBackend createAccount​(java.lang.String username,
                                                 java.lang.String password,
                                                 java.lang.String email,
                                                 java.lang.String firstName,
                                                 java.lang.String lastName,
                                                 java.lang.String source,
                                                 AccountEventProtocol delegate)
        Source is not currently being used and should be fixed.
        Call to create an account. Implement onCreated to from CBE::AccountDelegatePtrto recieve the
        callback. currently disabled
        Parameters:
        username -
        password -
        email -
        firstName -
        lastName -
        source -
        delegate - , AccountDelegate is a callback delegate to the user defined implementation of the callbacks on AccountEventProtocol.
      • addListener

        public void addListener​(ItemEventProtocol delegate)
        adds a listner that will recieve updates as changes occur on the account. removeListener should always be called when you stop using the delegate.
        Parameters:
        delegate - , ItemDelegate is a callback delegate to the user defined implementation of the callbacks on ItemEventProtocol.
      • removeListener

        public void removeListener​(ItemEventProtocol delegate)
        removes a listner that will recieve updates as changes occur on the account
        Parameters:
        delegate - , ItemDelegate is a callback delegate to the user defined implementation of the callbacks on ItemEventProtocol.
      • query

        public QueryChain query​(long containerId,
                                ItemEventProtocol delegate)
        Call to get a list of items in the container. Implement onQueryLoaded to from CBE::ItemDelegatePtrto recieve the callback. Requires you already signedIn.
        Parameters:
        containerId -
        delegate - , ItemDelegate is a callback delegate to the user defined implementation of the callbacks on ItemEventProtocol.
      • query

        public QueryChain query​(long containerId,
                                Filter filter,
                                ItemEventProtocol delegate)
        Call to get a list of items in the container using a filter. Implement onQueryLoaded to from CBE::ItemEventProtocol to recieve the callback. Requires you already signedIn
        Does not require a containerId due to having the filter.
        Parameters:
        filter -
        delegate - , ItemDelegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
      • queryWithPath

        public QueryChain queryWithPath​(java.lang.String relativePath,
                                        ItemEventProtocol delegate,
                                        long queryRoot)
        Queries with a given path to the container or object given in the path
        Parameters:
        relativePath - , is the relative path from the queryRoot e.x /Documents/Pictures from a queryRoot that has the /Documents/Pictures containers.
        delegate - , ItemDelegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
        queryRoot - , is the Container id that will be the root of this query. Option to not add a id will resolve in rootContainer beeing the starting point.
      • queryWithPath

        public QueryChain queryWithPath​(java.lang.String relativePath,
                                        ItemEventProtocol delegate)
        Queries with a given path to the container or object given in the path
        Parameters:
        relativePath - , is the relative path from the queryRoot e.x /Documents/Pictures from a queryRoot that has the /Documents/Pictures containers.
        delegate - , ItemDelegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
      • search

        public QueryResult search​(java.lang.String tags,
                                  long containerId,
                                  ItemEventProtocol delegate)
        Search the whole container for tags related to Objects in the container structure.
        EX: Key = Name, Value Contract/Object/Song => Name:Contract1.

        Search handles tags in combination / conjunction of keys and/or key values seperated by |.
        EX: 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 seperated by |.
        containerId - is the uint64_t id of the rootContainer to start the search of Objects in. ex: if starting in the rootContainer, the whole account will be searched for matching tags, key:value's.
        delegate - , ItemDelegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
      • search

        public QueryResult search​(Filter filter,
                                  long containerId,
                                  ItemEventProtocol delegate)
        Search the whole container for tags related to Objects in the container structure.
        EX: Key = Name, Value Contract/Object/Song => Name:Contract1.

        Search handles tags in combination / conjunction of keys and/or key values seperated by |.
        EX: 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 seperated by |.
        containerId - is the uint64_t id of the rootContainer to start the search of Objects in. ex: if starting in the rootContainer, the whole account will be searched for matching tags, key:value's.
        delegate - , ItemDelegate is a callback delegate to the user defined/implementation of the callbacks on ItemEventProtocol.
      • castContainer

        public static Container castContainer​(Item item)
        casts an item to a container.
      • castObject

        public static Object castObject​(Item item)
        casts an item to an object
      • clearCache

        public boolean clearCache()
        clears the cache to prevent memory issues in case of a very large cache.
      • account

        public Account account()
        Returns the account object with user account info.
      • version

        public java.lang.String version()
        Returns the version of the CloudBackend SDK. Can be used to report issues on the SDK.
      • groupManager

        public GroupManager groupManager()
        Returns the groupManager object which list and search group apis are listed.
      • shareManager

        public ShareManager shareManager()
        Returns the shareManager object where list available and list my shares are available.