com.hcl.domino.db Server API
This page describes Server API functions in detail. To navigate between sections, use the table of contents on the right.
Server class
createDatabase
Creates a database.
- If there is a names list in the "Create databases & templates" field on the Security tab, Server Access section of the Server document, a user must be included in the list to be able to create a database.
Parameters
options
accessToken
{Object
} Optional - An optional access token. See OptionalAccessToken for details.databasePath
{string
} REQUIRED - Database name with .nsf extension and path relative to the Domino data directory, for example, TestDatabase.nsf.databaseTitle
{string
} REQUIRED - Database title.templatePath
{string
} Optional - Database template path.
Return Value
{
ListenableFuture
<DBOperationResponse
>} A ListenableFuture resolved with DBOperationResponse.
Example
Server server = new Server('your.server.com', 3002,
new File("ca.crt"),
new File("user.crt"),
new File("user.key"),
"Key@1234", // key file passphrase
"ID@1234", // ID file password
EXECUTOR_SERVICE);
DBOperationResponse response = server.createDatabase("TestDatabase.nsf", "Test Database Title").get();
deleteDatabase
To delete a database, a user must have Manager access in the database ACL and access to the server.
Parameters
options
accessToken
{Object
} Optional - An optional access token. See OptionalAccessToken for details.databasePath
{string
} REQUIRED - Database name with .nsf extension and path relative to the Domino data directory, for example, TestDatabase.nsf.
Return Value
{
ListenableFuture
<DBOperationResponse
>} A ListenableFuture resolved with DBOperationResponse.
Example
Server server = new Server('your.server.com', 3002,
new File("ca.crt"),
new File("user.crt"),
new File("user.key"),
"Key@1234", // key file passphrase
"ID@1234", // ID file password
EXECUTOR_SERVICE);
DBOperationResponse response = server.deleteDatabase("TestDatabase.nsf").get();
DBOperationResponse class
getErrorCode
Returns error code related to success/failure operations.
Return Value
ErrorCode
{int
} Returns error code in int.
getErrorInfo
Returns error message specific to error code.
Return Value
{
String
} Returns error message based on code.
Example
Server server = new Server('your.server.com', 3002,
new File("ca.crt"),
new File("user.crt"),
new File("user.key"),
"Key@1234", // key file passphrase
"ID@1234", // ID file password
EXECUTOR_SERVICE);
DBOperationResponse response = server.createDatabase("TestDatabase.nsf", "Test Database Title").get();
System.out.println(response.getErrorCode());
System.out.println(response.getErrorInfo());