com.bagri.server.hazelcast.store.system.LibraryCacheStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bagri-server-hazelcast Show documentation
Show all versions of bagri-server-hazelcast Show documentation
Bagri DB Cache: Hazelcast implementation
The newest version!
package com.bagri.server.hazelcast.store.system;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import com.bagri.core.system.Library;
import com.hazelcast.core.MapStore;
public class LibraryCacheStore extends ConfigCacheStore implements MapStore {
@SuppressWarnings("unchecked")
@Override
protected Map loadEntities() {
Collection libs = (Collection) cfg.getEntities(Library.class);
Map result = new HashMap(libs.size());
for (Library lib: libs) {
result.put(lib.getName(), lib);
}
return result;
}
@Override
protected void storeEntities(Map entities) {
cfg.setEntities(Library.class, entities.values());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy