All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.onyx.application.impl.AbstractDatabaseServer.kt Maven / Gradle / Ivy

Go to download

Onyx Database is a graph database that is written in Kotlin and supports Java and Android. It is designed to be lightweight and easy to use. Features include in memory database, embedded, and remote server. It leverages its own ORM and storage.

The newest version!
package com.onyx.application.impl


/**
 * Created by Tim Osborn on 2/13/17.
 *
 * This class is to abstract out the basic properties and functions of a server
 */
abstract class AbstractDatabaseServer(open val databaseLocation: String) {

    // Server Port
    var port = 8080

    // Cluster instance unique identifier
    var instance = DEFAULT_INSTANCE

    protected var user = "admin"
    protected var password = "admin"

    /**
     * Flag to indicate whether the database is running or not
     *
     * @return Boolean flag running
     * @since 1.0.0
     */
    var isRunning: Boolean = false

    /**
     * Set User Credentials
     *
     * @param user     Username
     * @param password Password
     * @since 1.0.0
     */
    fun setCredentials(user: String, password: String) {
        this.user = user
        this.password = password
    }

    companion object {
        private val DEFAULT_INSTANCE = "ONYX_DATABASE"
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy