use of com.bakdata.conquery.io.storage.xodus.stores.SerializingStore in project conquery by bakdata.
the class TokenStorage method start.
@Override
public void start() {
String storeName = "api-token";
File tokenStore = new File(storageDir.toFile(), storeName);
environment = Environments.newInstance(tokenStore, storeConfig.createConfig());
final XodusStore data = new XodusStore(environment, "DATA", this::closeStoreHook, this::removeStoreHook);
dataStore = StoreMappings.cached(new SerializingStore<>(data, validator, objectMapper, ApiTokenHash.class, ApiTokenData.class, true, false, null));
openStoresInEnv.add(data);
final XodusStore meta = new XodusStore(environment, "META", this::closeStoreHook, this::removeStoreHook);
metaDataStore = StoreMappings.cached(new SerializingStore<>(meta, validator, objectMapper, UUID.class, ApiTokenData.MetaData.class, true, false, null));
openStoresInEnv.add(meta);
}
use of com.bakdata.conquery.io.storage.xodus.stores.SerializingStore in project conquery by bakdata.
the class LocalAuthenticationRealm method onInit.
@Override
protected void onInit() {
super.onInit();
// Open/create the database/store
File passwordStoreFile = new File(storageDir, storeName);
passwordEnvironment = Environments.newInstance(passwordStoreFile, passwordStoreConfig.createConfig());
passwordStore = StoreMappings.cached(new SerializingStore<>(new XodusStore(passwordEnvironment, "passwords", store -> store.getEnvironment().close(), store -> {
}), validator, mapper, UserId.class, PasswordHasher.HashedEntry.class, false, true, null));
}
Aggregations