All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.permazen.kv.simple.XMLKVImplementation Maven / Gradle / Ivy

There is a newer version: 5.1.0
Show newest version

/*
 * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
 */

package io.permazen.kv.simple;

import io.permazen.kv.KVDatabase;
import io.permazen.kv.KVImplementation;
import io.permazen.kv.mvcc.AtomicKVStore;

import java.io.File;
import java.util.ArrayDeque;

public class XMLKVImplementation extends KVImplementation {

    @Override
    public String[][] getCommandLineOptions() {
        return new String[][] {
            { "--xml file", "Use the specified XML flat file key/value database" }
        };
    }

    @Override
    public File parseCommandLineOptions(ArrayDeque options) {
        final String arg = this.parseCommandLineOption(options, "--xml");
        return arg != null ? new File(arg) : null;
    }

    @Override
    public XMLKVDatabase createKVDatabase(Object configuration, KVDatabase kvdb, AtomicKVStore kvstore) {
        return new XMLKVDatabase((File)configuration);
    }

    @Override
    public String getDescription(Object configuration) {
        return "XML DB " + ((File)configuration).getName();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy