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

org.randombits.confluence.metadata.indexing.graph.IndexDatabase Maven / Gradle / Ivy

There is a newer version: 7.4.1
Show newest version
package org.randombits.confluence.metadata.indexing.graph;

import com.tinkerpop.blueprints.impls.orient.OrientGraph;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;

/**
 * An interface to interact with the index database.
 *
 * @author longyc
 * @since 7.2.0.20150414
 */
public interface IndexDatabase {

    /**
     * Interface required to be executed by DatabaseBean#executeTransaction().
     *
     * @param 
     */
    interface Transaction {
        /**
         * Logic to be executed within a database transaction.
         *
         * @param graph A connection to the index database which will be released after execution.
         * @return T
         * @throws Exception
         */
        T execute(OrientGraph graph) throws Exception;
    }

    /**
     * Execute and commit the transaction, rollback on exception.
     *
     * @param transaction
     * @param 
     * @return T
     */
     T executeTransaction(Transaction transaction);

    /**
     * Initialize OrientDB factory with default settings.
     *
     * @return OrientGraphFactory
     */
    OrientGraphFactory initializeFactory();

    /**
     * Stop all connections to the database.
     */
    void shutdownFactory();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy