public class DirectoryMessageListStore<K,M extends PMessage<M,F>,F extends PField> extends Object implements MessageListStore<K,M,F>, Closeable
Note that the directory store is not parallel compatible between instances, as all of them would be able to read, write etc all the files all the time.
TL;DR Each directory can only have one
DirectoryMessageListStore instance active at a time.
| Constructor and Description |
|---|
DirectoryMessageListStore(File directory,
Function<K,String> keyBuilder,
Function<String,K> keyParser,
PMessageDescriptor<M,F> descriptor,
Serializer serializer) |
DirectoryMessageListStore(FileManager<K> manager,
PMessageDescriptor<M,F> descriptor,
Serializer serializer) |
DirectoryMessageListStore(Path directory,
Function<K,String> keyBuilder,
Function<String,K> keyParser,
PMessageDescriptor<M,F> descriptor,
Serializer serializer) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
containsKey(K key) |
Map<K,List<M>> |
getAll(Collection<K> keys)
Look up a set of keys from the storage.
|
Collection<K> |
keys()
Get a collection of all the keys in the store.
|
Map<K,List<M>> |
putAll(Map<K,List<M>> values) |
Map<K,List<M>> |
removeAll(Collection<K> keys)
Remove the values for the given keys.
|
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitputAllBuilders, putBuildersgetAllBuilders, getBuildersput, removegetpublic DirectoryMessageListStore(@Nonnull File directory, @Nonnull Function<K,String> keyBuilder, @Nonnull Function<String,K> keyParser, @Nonnull PMessageDescriptor<M,F> descriptor, @Nonnull Serializer serializer)
public DirectoryMessageListStore(@Nonnull Path directory, @Nonnull Function<K,String> keyBuilder, @Nonnull Function<String,K> keyParser, @Nonnull PMessageDescriptor<M,F> descriptor, @Nonnull Serializer serializer)
public DirectoryMessageListStore(@Nonnull FileManager<K> manager, @Nonnull PMessageDescriptor<M,F> descriptor, @Nonnull Serializer serializer)
public boolean containsKey(@Nonnull K key)
containsKey in interface ReadOnlyStore<K,List<M extends PMessage<M,F>>>key - The key to look up.@Nonnull public Collection<K> keys()
ReadOnlyStorepublic int size()
@Nonnull public Map<K,List<M>> getAll(@Nonnull Collection<K> keys)
ReadOnlyStore@Nonnull public Map<K,List<M>> removeAll(Collection<K> keys)
ReadWriteStorepublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2015–2019 morimekta.net. All rights reserved.