Package com.c8db

Interface C8DB

  • All Superinterfaces:
    C8SerializationAccessor
    All Known Implementing Classes:
    C8DBImpl

    public interface C8DB
    extends C8SerializationAccessor
    Central access point for applications to communicate with an C8DB server.

    Will be instantiated through C8DB.Builder

     C8DB arango = new C8DB.Builder().build();
     C8DB arango = new C8DB.Builder().host("127.0.0.1", 8529).build();
     
    • Method Detail

      • shutdown

        void shutdown()
               throws C8DBException
        Releases all connections to the server and clear the connection pool.
        Throws:
        C8DBException
      • db

        C8Database db()
        Returns a ArangoDatabase instance for the _system database.
        Returns:
        database handler
      • db

        C8Database db​(String tenant,
                      String name,
                      String spotDc,
                      String dcList)
        Returns a ArangoDatabase instance for the given database name.
        Parameters:
        tenant - Name of the tenant
        name - Name of the database
        spotDc - The Edge Location (Datacenter) where on-spot operations for the given geofabric will be performed. By default a random datacenter is chosen from those which are capable.
        dcList - The list of Edge Locations (Datacenters) as a comma-separated string. The individual elements for this parameter are your Edge Location URL prefixes up to the first . character.
        Returns:
        database handler
      • db

        C8Database db​(String tenant,
                      String name)
        Returns a ArangoDatabase instance for the given database name and tenant.
        Parameters:
        tenant - Name of the tenant
        name - Name of the database
        Returns:
        database handler
      • db

        C8Database db​(String tenant,
                      String name,
                      Map<String,​String> headerParams)
        Returns a ArangoDatabase instance for the given database name and tenant.
        Parameters:
        tenant - Name of the tenant
        name - Name of the database
        headerParams - HTTP header parameters
        Returns:
        database handler
      • createGeoFabric

        Boolean createGeoFabric​(String tenant,
                                String name,
                                String spotDc,
                                String dcList,
                                String geoFabric)
                         throws C8DBException
        Creates a new database with the given name.
        Parameters:
        tenant - Name of the tenant
        name - Name of the database to create
        spotDc - The Edge Location (Datacenter) where on-spot operations for the given geofabric will be performed. By default a random datacenter is chosen from those which are capable.
        dcList - The list of Edge Locations (Datacenters) as a comma-separated string. The individual elements for this parameter are your Edge Location URL prefixes up to the first . character.
        geoFabric - The name of the new db/geofabric
        Returns:
        true if the database was created successfully.
        Throws:
        C8DBException
        See Also:
        API Documentation
      • getAccessibleGeoFabricsFor

        Collection<String> getAccessibleGeoFabricsFor​(String user)
                                               throws C8DBException
        List available database to the specified user
        Parameters:
        user - The name of the user for which you want to query the databases
        Returns:
        list of database names which are available for the specified user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • updateDataCentersForGeoFabric

        Boolean updateDataCentersForGeoFabric​(String tenant,
                                              String name,
                                              String dcList)
                                       throws C8DBException
        Updated the data centers for the specified database
        Parameters:
        tenant - Name of the tenant
        name - Name of the database for change
        dcList - The full list of Datacenters to be added to the GeoFabric including the new datacenters to be added, as a string. The Datacenter list cannot be empty. Each edge location in the string should be separated from the previous one with a comma character (‘,’)
        Returns:
        true if the operation was successful
        Throws:
        C8DBException
      • getGeoFabricInformation

        GeoFabricEntity getGeoFabricInformation​(String tenant,
                                                String name)
                                         throws C8DBException
        Parameters:
        tenant - Name of the tenant
        name - Name of the database for change
        Returns:
        Retrieves information about the current geo-fabric
        Throws:
        C8DBException
      • updateSpotRegionForGeoFabric

        Boolean updateSpotRegionForGeoFabric​(String tenant,
                                             String name,
                                             String spotDc)
                                      throws C8DBException
        Updates the edge location where on-spot operations will be performed.
        Parameters:
        tenant - Name of the tenant
        name - Name of the database for change
        spotDc - The Edge Location (Datacenter) where on-spot operations for the given geofabric will be performed. By default a random datacenter is chosen from those which are capable.
        Returns:
        true if successful
        Throws:
        C8DBException
      • getEdgeLocations

        List<DataCenterEntity> getEdgeLocations​(String tenant)
                                         throws C8DBException
        Lists Edge Location (AKA Datacenter) details for specified tenant
        Parameters:
        tenant - Name of the tenant
        Returns:
        Edge Location (AKA Datacenter) details for specified tenant
        Throws:
        C8DBException
      • getAllEdgeLocations

        List<DcInfoEntity> getAllEdgeLocations()
                                        throws C8DBException
        Return a list of all Edge Locations (AKA Datacenters) deployed in the Macrometa Fabric.
        Returns:
        all Edge Locations (AKA Datacenters) deployed in the Macrometa Fabric.
        Throws:
        C8DBException
      • getEdgeLocation

        DcInfoEntity getEdgeLocation​(String dcName)
                              throws C8DBException
        Fetches data about the specified Edge Location.
        Parameters:
        dcName - datacenter name for which you want details
        Returns:
        the specified edge location details
        Throws:
        C8DBException
      • updateSpotStatus

        Boolean updateSpotStatus​(String dcName,
                                 boolean isSpot)
        Change whether an edge location (Datacenter) is capable of being on-spot.
        Parameters:
        dcName - The target edge location
        isSpot - Whether the edge location is capable of being on-spot
        Returns:
      • createUser

        UserEntity createUser​(String user,
                              String passwd)
                       throws C8DBException
        Create a new user. This user will not have access to any database. You need permission to the _system database in order to execute this call.
        Parameters:
        user - The name of the user
        passwd - The user password
        Returns:
        information about the user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • createUser

        UserEntity createUser​(String user,
                              String passwd,
                              UserCreateOptions options)
                       throws C8DBException
        Create a new user. This user will not have access to any database. You need permission to the _system database in order to execute this call.
        Parameters:
        user - The name of the user
        passwd - The user password
        options - Additional options, can be null
        Returns:
        information about the user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • getUser

        UserEntity getUser​(String user)
                    throws C8DBException
        Fetches data about the specified user. You can fetch information about yourself or you need permission to the _system database in order to execute this call.
        Parameters:
        user - The name of the user
        Returns:
        information about the user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • getUser

        UserEntity getUser​(String user,
                           String tenant)
                    throws C8DBException
        Fetches data about the specified user for a given tenant. You can fetch information about yourself or you need permission to the _system database in order to execute this call.
        Parameters:
        user - The name of the user
        tenant - The tenant of the user
        Returns:
        information about the user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • updateUser

        UserEntity updateUser​(String user,
                              UserUpdateOptions options)
                       throws C8DBException
        Partially updates the data of an existing user. The name of an existing user must be specified in user. You can only change the password of your self. You need access to the _system database to change the active flag.
        Parameters:
        user - The name of the user
        options - Properties of the user to be changed
        Returns:
        information about the user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • replaceUser

        UserEntity replaceUser​(String user,
                               UserUpdateOptions options)
                        throws C8DBException
        Replaces the data of an existing user. The name of an existing user must be specified in user. You can only change the password of your self. You need access to the _system database to change the active flag.
        Parameters:
        user - The name of the user
        options - Additional properties of the user, can be null
        Returns:
        information about the user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • grantDefaultDatabaseAccess

        void grantDefaultDatabaseAccess​(String user,
                                        Permissions permissions)
                                 throws C8DBException
        Sets the default access level for databases for the user user. You need permission to the _system database in order to execute this call.
        Parameters:
        user - The name of the user
        permissions - The permissions the user grant
        Throws:
        C8DBException
        Since:
        ArangoDB 3.2.0
      • grantDefaultCollectionAccess

        void grantDefaultCollectionAccess​(String user,
                                          Permissions permissions)
                                   throws C8DBException
        Sets the default access level for collections for the user user. You need permission to the _system database in order to execute this call.
        Parameters:
        user - The name of the user
        permissions - The permissions the user grant
        Throws:
        C8DBException
        Since:
        ArangoDB 3.2.0
      • execute

        Response execute​(Request request)
                  throws C8DBException
        Generic Execute. Use this method to execute custom FOXX services.
        Parameters:
        request - VelocyStream request
        Returns:
        VelocyStream response
        Throws:
        C8DBException
      • getLogLevel

        LogLevelEntity getLogLevel()
                            throws C8DBException
        Returns the server's current loglevel settings.
        Returns:
        the server's current loglevel settings
        Throws:
        C8DBException
        Since:
        ArangoDB 3.1.0
      • setLogLevel

        LogLevelEntity setLogLevel​(LogLevelEntity entity)
                            throws C8DBException
        Modifies and returns the server's current loglevel settings.
        Parameters:
        entity - loglevel settings
        Returns:
        the server's current loglevel settings
        Throws:
        C8DBException
        Since:
        ArangoDB 3.1.0
      • _setCursorInitializer

        C8DB _setCursorInitializer​(C8CursorInitializer cursorInitializer)
        Attention: Please do not use!
        Parameters:
        cursorInitializer -
        Returns:
        ArangoDB