Package co.luminositylabs.utils.orientdb
Class OrientDBUtil
- java.lang.Object
-
- co.luminositylabs.utils.orientdb.OrientDBUtil
-
public class OrientDBUtil extends Object
A utility class to support development with OrientDB.- Author:
- Phillip Ross
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOrientDBUtil.EngineEnumerates the supported OrientDB engines.
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_BINARY_PROTOCOL_PORTRANGEThe default port range of the OrientDB server's binary protocol listener.static StringPROPERTY_NAME_ODB_DATABASE_NAMEProperty name constant for specification of the OrientDB database name.static StringPROPERTY_NAME_ODB_DATABASE_PATHProperty name constant for specification of the OrientDB database path.static StringPROPERTY_NAME_ODB_EMBEDDEDProperty name constant for specification of embedded OrientDB server.static StringPROPERTY_NAME_ODB_PASSWORDProperty name constant for specification of the password for the OrientDB server.static StringPROPERTY_NAME_ODB_SERVER_ENGINEProperty name constant for specification of the OrientDB server engine.static StringPROPERTY_NAME_ODB_SERVER_REMOTE_HOSTNAMEProperty name constant for specification of the hostname of the remote OrientDB server.static StringPROPERTY_NAME_ODB_SERVER_REMOTE_PORT_RANGEProperty name constant for specification of the port range of the remote OrientDB server.static StringPROPERTY_NAME_ODB_USERNAMEProperty name constant for specification of the username for the OrientDB server.
-
Constructor Summary
Constructors Modifier Constructor Description protectedOrientDBUtil()Non-public default constrictor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbuildDatabaseUrl(String databaseName, OrientDBUtil.Engine engine, String hostname, String portRange, String databasePath)Builds a database url that can be used to connect to OrientDB.static com.orientechnologies.orient.server.OServerstartEmbeddedServer(String username, String password, String portRange)Starts an embedded OrientDB server.
-
-
-
Field Detail
-
PROPERTY_NAME_ODB_EMBEDDED
public static final String PROPERTY_NAME_ODB_EMBEDDED
Property name constant for specification of embedded OrientDB server.- See Also:
- Constant Field Values
-
PROPERTY_NAME_ODB_SERVER_ENGINE
public static final String PROPERTY_NAME_ODB_SERVER_ENGINE
Property name constant for specification of the OrientDB server engine.- See Also:
- Constant Field Values
-
PROPERTY_NAME_ODB_SERVER_REMOTE_HOSTNAME
public static final String PROPERTY_NAME_ODB_SERVER_REMOTE_HOSTNAME
Property name constant for specification of the hostname of the remote OrientDB server.- See Also:
- Constant Field Values
-
PROPERTY_NAME_ODB_SERVER_REMOTE_PORT_RANGE
public static final String PROPERTY_NAME_ODB_SERVER_REMOTE_PORT_RANGE
Property name constant for specification of the port range of the remote OrientDB server.- See Also:
- Constant Field Values
-
PROPERTY_NAME_ODB_DATABASE_PATH
public static final String PROPERTY_NAME_ODB_DATABASE_PATH
Property name constant for specification of the OrientDB database path.- See Also:
- Constant Field Values
-
PROPERTY_NAME_ODB_DATABASE_NAME
public static final String PROPERTY_NAME_ODB_DATABASE_NAME
Property name constant for specification of the OrientDB database name.- See Also:
- Constant Field Values
-
PROPERTY_NAME_ODB_USERNAME
public static final String PROPERTY_NAME_ODB_USERNAME
Property name constant for specification of the username for the OrientDB server.- See Also:
- Constant Field Values
-
PROPERTY_NAME_ODB_PASSWORD
public static final String PROPERTY_NAME_ODB_PASSWORD
Property name constant for specification of the password for the OrientDB server.- See Also:
- Constant Field Values
-
DEFAULT_BINARY_PROTOCOL_PORTRANGE
public static final String DEFAULT_BINARY_PROTOCOL_PORTRANGE
The default port range of the OrientDB server's binary protocol listener.- See Also:
- Constant Field Values
-
-
Method Detail
-
buildDatabaseUrl
public static String buildDatabaseUrl(String databaseName, OrientDBUtil.Engine engine, String hostname, String portRange, String databasePath)
Builds a database url that can be used to connect to OrientDB.- Parameters:
databaseName- the name of the databaseengine- the engine to be usedhostname- the hostname of the OrientDB serverportRange- the port range of the OrientDB serverdatabasePath- the path of the database- Returns:
- the properly formatted url to use for connecting to OrientDB
-
startEmbeddedServer
public static com.orientechnologies.orient.server.OServer startEmbeddedServer(String username, String password, String portRange) throws Exception
Starts an embedded OrientDB server.- Parameters:
username- the username to be used in configuring the OrientDB serverpassword- the password to be used in configuring the OrientDB serverportRange- the port range the OrientDB server will listen on- Returns:
- a reference to the embedded server
- Throws:
Exception- when server is unable to be configured or activated
-
-