Search in sources :

Example 1 with ContentCacheFactory

use of org.n52.iceland.cache.ctrl.ContentCacheFactory in project SOS by 52North.

the class ContentCacheControllerImplTest method createController.

private ContentCacheControllerImpl createController() throws ConfigurationError {
    ImmediatePersistenceStrategy persistenceStrategy = new ImmediatePersistenceStrategy();
    persistenceStrategy.setConfigLocationProvider(tempFolder.getRoot()::getAbsolutePath);
    persistenceStrategy.init();
    CompleteCacheUpdateFactoryImpl cacheUpdateFactory = new CompleteCacheUpdateFactoryImpl();
    CacheFeederHandler cacheFeederHandler = new NoOpCacheFeederHandler();
    cacheUpdateFactory.setCacheFeederHandler(cacheFeederHandler);
    ContentCacheFactory cacheFactory = InMemoryCacheImpl::new;
    ContentCacheControllerImpl ccc = new ContentCacheControllerImpl();
    ccc.setCacheFactory(cacheFactory);
    ccc.setPersistenceStrategy(persistenceStrategy);
    ccc.setCompleteCacheUpdateFactory(cacheUpdateFactory);
    ccc.setUpdateInterval(0);
    ccc.init();
    return ccc;
}
Also used : ImmediatePersistenceStrategy(org.n52.iceland.cache.ctrl.persistence.ImmediatePersistenceStrategy) CompleteCacheUpdateFactoryImpl(org.n52.sos.cache.ctrl.CompleteCacheUpdateFactoryImpl) ContentCacheControllerImpl(org.n52.iceland.cache.ctrl.ContentCacheControllerImpl) CacheFeederHandler(org.n52.sos.ds.CacheFeederHandler) ContentCacheFactory(org.n52.iceland.cache.ctrl.ContentCacheFactory)

Example 2 with ContentCacheFactory

use of org.n52.iceland.cache.ctrl.ContentCacheFactory in project SOS by 52North.

the class UpdateSchedulingTest method createController.

private ContentCacheControllerImpl createController() throws ConfigurationError {
    ContentCachePersistenceStrategy persistenceStrategy = new NoOpCachePersistenceStrategy();
    CompleteCacheUpdateFactoryImpl cacheUpdateFactory = new CompleteCacheUpdateFactoryImpl();
    CacheFeederHandler cacheFeederHandler = new NoOpCacheFeederHandler();
    cacheUpdateFactory.setCacheFeederHandler(cacheFeederHandler);
    ContentCacheFactory cacheFactory = InMemoryCacheImpl::new;
    ContentCacheControllerImpl ccc = new ContentCacheControllerImpl();
    ccc.setCacheFactory(cacheFactory);
    ccc.setPersistenceStrategy(persistenceStrategy);
    ccc.setCompleteCacheUpdateFactory(cacheUpdateFactory);
    ccc.setUpdateInterval(0);
    ccc.init();
    return ccc;
}
Also used : NoOpCachePersistenceStrategy(org.n52.iceland.cache.ctrl.persistence.NoOpCachePersistenceStrategy) ContentCachePersistenceStrategy(org.n52.iceland.cache.ContentCachePersistenceStrategy) CompleteCacheUpdateFactoryImpl(org.n52.sos.cache.ctrl.CompleteCacheUpdateFactoryImpl) ContentCacheControllerImpl(org.n52.iceland.cache.ctrl.ContentCacheControllerImpl) CacheFeederHandler(org.n52.sos.ds.CacheFeederHandler) ContentCacheFactory(org.n52.iceland.cache.ctrl.ContentCacheFactory)

Aggregations

ContentCacheControllerImpl (org.n52.iceland.cache.ctrl.ContentCacheControllerImpl)2 ContentCacheFactory (org.n52.iceland.cache.ctrl.ContentCacheFactory)2 CompleteCacheUpdateFactoryImpl (org.n52.sos.cache.ctrl.CompleteCacheUpdateFactoryImpl)2 CacheFeederHandler (org.n52.sos.ds.CacheFeederHandler)2 ContentCachePersistenceStrategy (org.n52.iceland.cache.ContentCachePersistenceStrategy)1 ImmediatePersistenceStrategy (org.n52.iceland.cache.ctrl.persistence.ImmediatePersistenceStrategy)1 NoOpCachePersistenceStrategy (org.n52.iceland.cache.ctrl.persistence.NoOpCachePersistenceStrategy)1