Class OrientDBUtil


  • public class OrientDBUtil
    extends Object
    A utility class to support development with OrientDB.
    Author:
    Phillip Ross
    • 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
    • Constructor Detail

      • OrientDBUtil

        protected OrientDBUtil()
        Non-public default constrictor.
    • 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 database
        engine - the engine to be used
        hostname - the hostname of the OrientDB server
        portRange - the port range of the OrientDB server
        databasePath - 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 server
        password - the password to be used in configuring the OrientDB server
        portRange - 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