Package io.permazen.kv.simple
Class XMLKVImplementation
java.lang.Object
io.permazen.kv.simple.XMLKVImplementation
- All Implemented Interfaces:
KVImplementation<XMLKVImplementation.Config>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOptions(joptsimple.OptionParser parser) Add implementation-specific command line options.protected voidaddSimpleOptions(joptsimple.OptionParser parser, joptsimple.OptionSpec<?> enablingOption, String prefix) protected voidapplySimpleOptions(joptsimple.OptionSet options, XMLKVImplementation.Config config) buildConfig(joptsimple.OptionSet options) Build a configuration from implementation-specific command line options, if any were given.createKVDatabase(XMLKVImplementation.Config config, KVDatabase kvdb, AtomicKVStore kvstore) Create anKVDatabaseusing the specified configuration.Generate a short, human-readable description of theKVDatabaseinstance configured as given.booleanDetermine whether thisKVImplementationincludes an implementation of theKVDatabaseinterface.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.permazen.kv.KVImplementation
createAtomicKVStore, getConfigType, providesAtomicKVStore, requiresAtomicKVStore, requiresKVDatabase
-
Constructor Details
-
XMLKVImplementation
public XMLKVImplementation()
-
-
Method Details
-
addOptions
public void addOptions(joptsimple.OptionParser parser) Description copied from interface:KVImplementationAdd implementation-specific command line options.All of the added options must be optional, because multiple key/value implementations will be available when the command line is parsed, and the presence of implementation-specific options determines which one(s) are chosen.
- Parameters:
parser- command line flag parser
-
buildConfig
Description copied from interface:KVImplementationBuild a configuration from implementation-specific command line options, if any were given.If none of this implementation's options were provided, then this method must return null.
- Parameters:
options- parsed command line options- Returns:
- corresponding configuration, or null if this implementation was not configured
-
providesKVDatabase
Description copied from interface:KVImplementationDetermine whether thisKVImplementationincludes an implementation of theKVDatabaseinterface.The implementation in
KVImplementationreturn false.- Parameters:
config- implementation configuration returned bybuildConfig()- Returns:
- true if this instance can create an
KVDatabase
-
createKVDatabase
public XMLKVDatabase createKVDatabase(XMLKVImplementation.Config config, KVDatabase kvdb, AtomicKVStore kvstore) Description copied from interface:KVImplementationCreate anKVDatabaseusing the specified configuration.The implementation in
KVImplementationalways throwsUnsupportedOperationException.- Parameters:
config- implementation configuration returned bybuildConfig()kvdb- requiredKVDatabase; will be null unlessKVImplementation.requiresKVDatabase(C)returned truekvstore- requiredAtomicKVStore; will be null unlessKVImplementation.requiresAtomicKVStore(C)returned true- Returns:
- new
KVDatabaseinstance
-
getDescription
Description copied from interface:KVImplementationGenerate a short, human-readable description of theKVDatabaseinstance configured as given.- Parameters:
config- implementation configuration returned bybuildConfig()- Returns:
- human-readable description
-
addSimpleOptions
protected void addSimpleOptions(joptsimple.OptionParser parser, joptsimple.OptionSpec<?> enablingOption, String prefix) -
applySimpleOptions
-