de.otto.edison.togglz.DefaultTogglzConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of edison-togglz Show documentation
Show all versions of edison-togglz Show documentation
Status library of the edison-microservice project.
package de.otto.edison.togglz;
import org.togglz.core.Feature;
import org.togglz.core.manager.TogglzConfig;
import org.togglz.core.repository.StateRepository;
import org.togglz.core.repository.cache.CachingStateRepository;
import org.togglz.core.user.UserProvider;
public class DefaultTogglzConfig implements TogglzConfig {
private StateRepository cachingStateRepository;
private UserProvider userProvider;
private FeatureClassProvider featureClassProvider;
public DefaultTogglzConfig(final long ttlMilliseconds,
final StateRepository stateRepository,
final UserProvider userProvider,
final FeatureClassProvider featureClassProvider) {
this.cachingStateRepository = new CachingStateRepository(stateRepository, ttlMilliseconds);
this.userProvider = userProvider;
this.featureClassProvider = featureClassProvider;
}
@Override
public Class extends Feature> getFeatureClass() {
return featureClassProvider.getFeatureClass();
}
@Override
public StateRepository getStateRepository() {
return cachingStateRepository;
}
@Override
public UserProvider getUserProvider() {
return userProvider;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy