Class C8DBImpl

    • Method Detail

      • shutdown

        public void shutdown()
                      throws C8DBException
        Description copied from interface: C8DB
        Releases all connections to the server and clear the connection pool.
        Specified by:
        shutdown in interface C8DB
        Throws:
        C8DBException
      • db

        public C8Database db()
        Description copied from interface: C8DB
        Returns a ArangoDatabase instance for the _system database.
        Specified by:
        db in interface C8DB
        Returns:
        database handler
      • db

        public C8Database db​(String tenant,
                             String name)
        Description copied from interface: C8DB
        Returns a ArangoDatabase instance for the given database name and tenant.
        Specified by:
        db in interface C8DB
        Parameters:
        tenant - Name of the tenant
        name - Name of the database
        Returns:
        database handler
      • db

        public C8Database db​(String tenant,
                             String name,
                             String spotDc,
                             String dcList)
        Description copied from interface: C8DB
        Returns a ArangoDatabase instance for the given database name.
        Specified by:
        db in interface C8DB
        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

        public C8Database db​(String tenant,
                             String name,
                             Map<String,​String> headerParams)
        Description copied from interface: C8DB
        Returns a ArangoDatabase instance for the given database name and tenant.
        Specified by:
        db in interface C8DB
        Parameters:
        tenant - Name of the tenant
        name - Name of the database
        headerParams - HTTP header parameters
        Returns:
        database handler
      • createGeoFabric

        public Boolean createGeoFabric​(String tenant,
                                       String name,
                                       String spotDc,
                                       String dcList,
                                       String geoFabric)
                                throws C8DBException
        Description copied from interface: C8DB
        Creates a new database with the given name.
        Specified by:
        createGeoFabric in interface C8DB
        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
      • updateDataCentersForGeoFabric

        public Boolean updateDataCentersForGeoFabric​(String tenant,
                                                     String name,
                                                     String dcList)
                                              throws C8DBException
        Description copied from interface: C8DB
        Updated the data centers for the specified database
        Specified by:
        updateDataCentersForGeoFabric in interface C8DB
        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
      • updateSpotRegionForGeoFabric

        public Boolean updateSpotRegionForGeoFabric​(String tenant,
                                                    String name,
                                                    String spotDc)
                                             throws C8DBException
        Description copied from interface: C8DB
        Updates the edge location where on-spot operations will be performed.
        Specified by:
        updateSpotRegionForGeoFabric in interface C8DB
        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
      • getAllEdgeLocations

        public List<DcInfoEntity> getAllEdgeLocations()
                                               throws C8DBException
        Description copied from interface: C8DB
        Return a list of all Edge Locations (AKA Datacenters) deployed in the Macrometa Fabric.
        Specified by:
        getAllEdgeLocations in interface C8DB
        Returns:
        all Edge Locations (AKA Datacenters) deployed in the Macrometa Fabric.
        Throws:
        C8DBException
      • getEdgeLocation

        public DcInfoEntity getEdgeLocation​(String dcName)
                                     throws C8DBException
        Description copied from interface: C8DB
        Fetches data about the specified Edge Location.
        Specified by:
        getEdgeLocation in interface C8DB
        Parameters:
        dcName - datacenter name for which you want details
        Returns:
        the specified edge location details
        Throws:
        C8DBException
      • updateSpotStatus

        public Boolean updateSpotStatus​(String dcName,
                                        boolean isSpot)
        Description copied from interface: C8DB
        Change whether an edge location (Datacenter) is capable of being on-spot.
        Specified by:
        updateSpotStatus in interface C8DB
        Parameters:
        dcName - The target edge location
        isSpot - Whether the edge location is capable of being on-spot
        Returns:
      • createUser

        public UserEntity createUser​(String user,
                                     String passwd)
                              throws C8DBException
        Description copied from interface: C8DB
        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.
        Specified by:
        createUser in interface C8DB
        Parameters:
        user - The name of the user
        passwd - The user password
        Returns:
        information about the user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • createUser

        public UserEntity createUser​(String user,
                                     String passwd,
                                     UserCreateOptions options)
                              throws C8DBException
        Description copied from interface: C8DB
        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.
        Specified by:
        createUser in interface C8DB
        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
      • deleteUser

        public void deleteUser​(String user)
                        throws C8DBException
        Description copied from interface: C8DB
        Removes an existing user, identified by user. You need access to the _system database.
        Specified by:
        deleteUser in interface C8DB
        Parameters:
        user - The name of the user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • getUser

        public UserEntity getUser​(String user)
                           throws C8DBException
        Description copied from interface: C8DB
        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.
        Specified by:
        getUser in interface C8DB
        Parameters:
        user - The name of the user
        Returns:
        information about the user
        Throws:
        C8DBException
        See Also:
        API Documentation
      • getUser

        public UserEntity getUser​(String user,
                                  String tenant)
                           throws C8DBException
        Description copied from interface: C8DB
        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.
        Specified by:
        getUser in interface C8DB
        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

        public UserEntity updateUser​(String user,
                                     UserUpdateOptions options)
                              throws C8DBException
        Description copied from interface: C8DB
        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.
        Specified by:
        updateUser in interface C8DB
        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

        public UserEntity replaceUser​(String user,
                                      UserUpdateOptions options)
                               throws C8DBException
        Description copied from interface: C8DB
        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.
        Specified by:
        replaceUser in interface C8DB
        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

        public void grantDefaultDatabaseAccess​(String user,
                                               Permissions permissions)
                                        throws C8DBException
        Description copied from interface: C8DB
        Sets the default access level for databases for the user user. You need permission to the _system database in order to execute this call.
        Specified by:
        grantDefaultDatabaseAccess in interface C8DB
        Parameters:
        user - The name of the user
        permissions - The permissions the user grant
        Throws:
        C8DBException
      • grantDefaultCollectionAccess

        public void grantDefaultCollectionAccess​(String user,
                                                 Permissions permissions)
                                          throws C8DBException
        Description copied from interface: C8DB
        Sets the default access level for collections for the user user. You need permission to the _system database in order to execute this call.
        Specified by:
        grantDefaultCollectionAccess in interface C8DB
        Parameters:
        user - The name of the user
        permissions - The permissions the user grant
        Throws:
        C8DBException
      • execute

        public Response execute​(Request request)
                         throws C8DBException
        Description copied from interface: C8DB
        Generic Execute. Use this method to execute custom FOXX services.
        Specified by:
        execute in interface C8DB
        Parameters:
        request - VelocyStream request
        Returns:
        VelocyStream response
        Throws:
        C8DBException