class FileDbProvider implements SchematicDbProvider<FileDb> {

    @Override
    public FileDb getDB( String type, Document configuration ) {
        if (TYPE_MEM.equalsIgnoreCase(type)) {
            LOGGER.debug("Returning new in-memory schematic DB...");
            return FileDb.inMemory(configuration.getBoolean(COMPRESS_FIELD, false));
        } else if (TYPE_FILE.equalsIgnoreCase(type)) {
            boolean compress = configuration.getBoolean(COMPRESS_FIELD, true);
            String path = configuration.getString(PATH_FIELD, null);
            LOGGER.debug("Returning new disk schematic DB at {0}...", path);
            return FileDb.onDisk(compress, path);
        }
        return null;
    }

}