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.BuilderC8DB arango = new C8DB.Builder().build(); C8DB arango = new C8DB.Builder().host("127.0.0.1", 8529).build();
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classC8DB.BuilderBuilder class to build an instance ofC8DB.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description C8DB_setCursorInitializer(C8CursorInitializer cursorInitializer)Attention: Please do not use!AlertEntitycreateAlerts(AlertEntity entity)Creates an AlertBooleancreateGeoFabric(String tenant, String name, String spotDc, String dcList, String geoFabric)Creates a new database with the given name.UserEntitycreateUser(String user, String passwd)Create a new user.UserEntitycreateUser(String user, String passwd, UserCreateOptions options)Create a new user.C8Databasedb()Returns aArangoDatabaseinstance for the_systemdatabase.C8Databasedb(String tenant, String name)Returns aArangoDatabaseinstance for the given database name and tenant.C8Databasedb(String tenant, String name, String spotDc, String dcList)Returns aArangoDatabaseinstance for the given database name.C8Databasedb(String tenant, String name, Map<String,String> headerParams)Returns aArangoDatabaseinstance for the given database name and tenant.voiddeleteUser(String user)Removes an existing user, identified by user.Responseexecute(Request request)Generic Execute.Responseexecute(Request request, HostHandle hostHandle)Generic Execute.Collection<String>getAccessibleGeoFabrics()Retrieves a list of all databases the current user can accessCollection<String>getAccessibleGeoFabricsFor(String user)List available database to the specified userCollection<AlertEntity>getAlerts(Map<String,String> queryParamMap)Gets AlertsList<DcInfoEntity>getAllEdgeLocations()Return a list of all Edge Locations (AKA Datacenters) deployed in the Macrometa Fabric.DcInfoEntitygetEdgeLocation(String dcName)Fetches data about the specified Edge Location.List<DataCenterEntity>getEdgeLocations(String tenant)Lists Edge Location (AKA Datacenter) details for specified tenantGeoFabricEntitygetGeoFabricInformation(String tenant, String name)Collection<String>getGeoFabrics()Retrieves a list of all existing databasesDcInfoEntitygetLocalEdgeLocation()List details of Local Edge LocationLogLevelEntitygetLogLevel()Returns the server's current loglevel settings.LogEntitygetLogs(LogOptions options)Returns fatal, error, warning or info log messages from the server's global log.ServerRolegetRole()Returns the server role.UserEntitygetUser(String user)Fetches data about the specified user.UserEntitygetUser(String user, String tenant)Fetches data about the specified user for a given tenant.Collection<UserEntity>getUsers()Fetches data about all users.C8DBVersiongetVersion()Returns the server name and version number.voidgrantDefaultCollectionAccess(String user, Permissions permissions)Sets the default access level for collections for the useruser.voidgrantDefaultDatabaseAccess(String user, Permissions permissions)Sets the default access level for databases for the useruser.UserEntityreplaceUser(String user, UserUpdateOptions options)Replaces the data of an existing user.LogLevelEntitysetLogLevel(LogLevelEntity entity)Modifies and returns the server's current loglevel settings.voidshutdown()Releases all connections to the server and clear the connection pool.AlertEntityupdateAlerts(String updateParam, Map<String,String> queryParamMap)Acknowledges or Resolves an alertBooleanupdateDataCentersForGeoFabric(String tenant, String name, String dcList)Updated the data centers for the specified databaseBooleanupdateSpotRegionForGeoFabric(String tenant, String name, String spotDc)Updates the edge location where on-spot operations will be performed.BooleanupdateSpotStatus(String dcName, boolean isSpot)Change whether an edge location (Datacenter) is capable of being on-spot.UserEntityupdateUser(String user, UserUpdateOptions options)Partially updates the data of an existing user.-
Methods inherited from interface com.c8db.C8SerializationAccessor
util, util
-
-
-
-
Method Detail
-
shutdown
void shutdown() throws C8DBExceptionReleases all connections to the server and clear the connection pool.- Throws:
C8DBException
-
db
C8Database db()
Returns aArangoDatabaseinstance for the_systemdatabase.- Returns:
- database handler
-
db
C8Database db(String tenant, String name, String spotDc, String dcList)
Returns aArangoDatabaseinstance for the given database name.- Parameters:
tenant- Name of the tenantname- Name of the databasespotDc- 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 aArangoDatabaseinstance for the given database name and tenant.- Parameters:
tenant- Name of the tenantname- Name of the database- Returns:
- database handler
-
db
C8Database db(String tenant, String name, Map<String,String> headerParams)
Returns aArangoDatabaseinstance for the given database name and tenant.- Parameters:
tenant- Name of the tenantname- Name of the databaseheaderParams- 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 tenantname- Name of the database to createspotDc- 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
-
getGeoFabrics
Collection<String> getGeoFabrics() throws C8DBException
Retrieves a list of all existing databases- Returns:
- a list of all existing databases
- Throws:
C8DBException- See Also:
- API Documentation
-
getAccessibleGeoFabrics
Collection<String> getAccessibleGeoFabrics() throws C8DBException
Retrieves a list of all databases the current user can access- Returns:
- a list of all databases the current user can access
- 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 tenantname- Name of the database for changedcList- 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 tenantname- 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 tenantname- Name of the database for changespotDc- 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
-
getLocalEdgeLocation
DcInfoEntity getLocalEdgeLocation() throws C8DBException
List details of Local Edge Location- Returns:
- details of Local Edge Location
- 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 locationisSpot- Whether the edge location is capable of being on-spot- Returns:
-
getVersion
C8DBVersion getVersion() throws C8DBException
Returns the server name and version number.- Returns:
- the server version, number
- Throws:
C8DBException- See Also:
- API Documentation
-
getRole
ServerRole getRole() throws C8DBException
Returns the server role.- Returns:
- the server role
- Throws:
C8DBException
-
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 userpasswd- 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 userpasswd- The user passwordoptions- Additional options, can be null- Returns:
- information about the user
- Throws:
C8DBException- See Also:
- API Documentation
-
deleteUser
void deleteUser(String user) throws C8DBException
Removes an existing user, identified by user. You need access to the _system database.- Parameters:
user- The name of 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 usertenant- The tenant of the user- Returns:
- information about the user
- Throws:
C8DBException- See Also:
- API Documentation
-
getUsers
Collection<UserEntity> getUsers() throws C8DBException
Fetches data about all users. You can only execute this call if you have access to the _system database.- Returns:
- informations about all users
- 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 useroptions- 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 useroptions- 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 useruser. You need permission to the _system database in order to execute this call.- Parameters:
user- The name of the userpermissions- 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 useruser. You need permission to the _system database in order to execute this call.- Parameters:
user- The name of the userpermissions- 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
-
execute
Response execute(Request request, HostHandle hostHandle) throws C8DBException
Generic Execute. Use this method to execute custom FOXX services.- Parameters:
request- VelocyStream requesthostHandle- Used to stick to a specific host when usingLoadBalancingStrategy.ROUND_ROBIN- Returns:
- VelocyStream response
- Throws:
C8DBException
-
getLogs
LogEntity getLogs(LogOptions options) throws C8DBException
Returns fatal, error, warning or info log messages from the server's global log.- Parameters:
options- Additional options, can be null- Returns:
- the log messages
- Throws:
C8DBException- See Also:
- API Documentation
-
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
-
getAlerts
Collection<AlertEntity> getAlerts(Map<String,String> queryParamMap) throws C8DBException
Gets Alerts- Parameters:
queryParamMap-- Returns:
- Throws:
C8DBException
-
updateAlerts
AlertEntity updateAlerts(String updateParam, Map<String,String> queryParamMap) throws C8DBException
Acknowledges or Resolves an alert- Parameters:
updateParam-queryParamMap-- Returns:
- Throws:
C8DBException
-
createAlerts
AlertEntity createAlerts(AlertEntity entity) throws C8DBException
Creates an Alert- Parameters:
entity-- Returns:
- Throws:
C8DBException
-
-