Search in sources :

Example 1 with RepositoryFactoryImpl

use of org.apache.jackrabbit.core.RepositoryFactoryImpl in project jackrabbit by apache.

the class DataStoreAPITest method testDataStoreGarbageCollection.

/**
     * Test data store garbage collection.
     */
public void testDataStoreGarbageCollection() throws RepositoryException {
    JackrabbitRepositoryFactory rf = new RepositoryFactoryImpl();
    Properties prop = new Properties();
    prop.setProperty("org.apache.jackrabbit.repository.home", TEST_DIR);
    prop.setProperty("org.apache.jackrabbit.repository.conf", TEST_DIR + "/repository.xml");
    JackrabbitRepository rep = (JackrabbitRepository) rf.getRepository(prop);
    RepositoryManager rm = rf.getRepositoryManager(rep);
    // need to login to start the repository
    Session session = rep.login();
    DataStoreGarbageCollector gc = rm.createDataStoreGarbageCollector();
    try {
        gc.mark();
        gc.sweep();
    } finally {
        gc.close();
    }
    session.logout();
    rm.stop();
}
Also used : RepositoryFactoryImpl(org.apache.jackrabbit.core.RepositoryFactoryImpl) RepositoryManager(org.apache.jackrabbit.api.management.RepositoryManager) Properties(java.util.Properties) JackrabbitRepository(org.apache.jackrabbit.api.JackrabbitRepository) JackrabbitRepositoryFactory(org.apache.jackrabbit.api.JackrabbitRepositoryFactory) Session(javax.jcr.Session) DataStoreGarbageCollector(org.apache.jackrabbit.api.management.DataStoreGarbageCollector)

Example 2 with RepositoryFactoryImpl

use of org.apache.jackrabbit.core.RepositoryFactoryImpl in project jackrabbit by apache.

the class GCSubtreeMoveTest method setupRepository.

private void setupRepository() {
    JackrabbitRepositoryFactory repositoryFactory = new RepositoryFactoryImpl();
    createRepository(repositoryFactory);
    login();
}
Also used : RepositoryFactoryImpl(org.apache.jackrabbit.core.RepositoryFactoryImpl) JackrabbitRepositoryFactory(org.apache.jackrabbit.api.JackrabbitRepositoryFactory)

Aggregations

JackrabbitRepositoryFactory (org.apache.jackrabbit.api.JackrabbitRepositoryFactory)2 RepositoryFactoryImpl (org.apache.jackrabbit.core.RepositoryFactoryImpl)2 Properties (java.util.Properties)1 Session (javax.jcr.Session)1 JackrabbitRepository (org.apache.jackrabbit.api.JackrabbitRepository)1 DataStoreGarbageCollector (org.apache.jackrabbit.api.management.DataStoreGarbageCollector)1 RepositoryManager (org.apache.jackrabbit.api.management.RepositoryManager)1