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

io.sirix.access.xml.LocalXmlDatabaseFactory Maven / Gradle / Ivy

Go to download

SirixDB is a hybrid on-disk and in-memory document oriented, versioned database system. It has a lightweight buffer manager, stores everything in a huge persistent and durable tree and allows efficient reconstruction of every revision. Furthermore, SirixDB implements change tracking, diffing and supports time travel queries.

There is a newer version: 0.11.0
Show newest version
package io.sirix.access.xml;

import io.sirix.access.LocalDatabaseFactory;
import io.sirix.access.User;
import io.sirix.access.DatabaseConfiguration;
import io.sirix.api.Database;
import io.sirix.api.xml.XmlResourceSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;

/**
 * A database session factory for Json databases.
 *
 * @author Joao Sousa
 */
@Singleton
public class LocalXmlDatabaseFactory implements LocalDatabaseFactory {

    /**
     * Logger for {@link LocalXmlDatabaseFactory}.
     */
    private static final Logger logger = LoggerFactory.getLogger(LocalXmlDatabaseFactory.class);

    private final Provider subcomponentBuilder;

    @Inject
    LocalXmlDatabaseFactory(final Provider subcomponentBuilder) {

        this.subcomponentBuilder = subcomponentBuilder;
    }

    @Override
    public Database createDatabase(final DatabaseConfiguration configuration, final User user) {
        logger.trace("Creating new local XML database instance (open)");

        return this.subcomponentBuilder.get()
                .databaseConfiguration(configuration)
                .user(user)
                .build()
                .database();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy