// Path: src/main/java/de/fhg/igd/mongomvcc/VDatabase.java
// public interface VDatabase {
// 	/**
// 	 * Connect to a database
// 	 * @param name the database name
// 	 * @throws VException if connection failed
// 	 */
// 	void connect(String name);
// 	
// 	/**
// 	 * Connect to a database
// 	 * @param name the database name
// 	 * @param port the port the database listens to
// 	 * @throws VException if connection failed
// 	 */
// 	void connect(String name, int port);
// 	
// 	/**
// 	 * Connect to a database running on a given host and port
// 	 * @param name the database name
// 	 * @param host the host the database is running on
// 	 * @param port the port the database listens to
// 	 * @throws VException if connection failed
// 	 */
// 	void connect(String name, String host, int port);
// 	
// 	/**
// 	 * Checks out a named branch from the database
// 	 * @param name the branch's name
// 	 * @return the branch
// 	 * @throws VException if the branch does not exist yet
// 	 */
// 	VBranch checkout(String name);
// 	
// 	/**
// 	 * Checks out an unnamed branch from the database
// 	 * @param cid the CID of the commit which should be the branch's root
// 	 * @return the branch
// 	 * @throws VException if there is not commit with the given CID
// 	 */
// 	VBranch checkout(long cid);
// 	
// 	/**
// 	 * Creates a new named branch whose head is set to the given CID
// 	 * @param name the branch's name
// 	 * @param headCID the branch's head CID
// 	 * @return the branch
// 	 * @throws VException if there already is a branch with the given name or
// 	 * if the given head CID could not be resolved to an existing commit
// 	 */
// 	VBranch createBranch(String name, long headCID);
// 	
// 	/**
// 	 * Deletes the whole database. Be very careful with this method!
// 	 */
// 	void drop();
// 	
// 	/**
// 	 * @return a counter which generates unique IDs for the database
// 	 */
// 	VCounter getCounter();
// 	
// 	/**
// 	 * @return the database's history
// 	 */
// 	VHistory getHistory();
// 	
// 	/**
// 	 * @return a maintenance object
// 	 */
// 	VMaintenance getMaintenance();
// }
// 
// Path: src/main/java/de/fhg/igd/mongomvcc/VFactory.java
// public interface VFactory {
// 	/**
// 	 * @return a new MVCC database
// 	 */
// 	VDatabase createDatabase();
// 	
// 	/**
// 	 * @return a new empty document
// 	 */
// 	Map<String, Object> createDocument();
// 	
// 	/**
// 	 * Convenience method to create a new document with exactly one element
// 	 * @param key the element's key
// 	 * @param value the element's value
// 	 * @return the new document
// 	 */
// 	Map<String, Object> createDocument(String key, Object value);
// 	
// 	/**
// 	 * @return a new list
// 	 */
// 	List<Object> createList();
// }


import java.util.List;
import java.util.Map;
import com.mongodb.BasicDBList;
import com.mongodb.BasicDBObject;
import de.fhg.igd.mongomvcc.VDatabase;
import de.fhg.igd.mongomvcc.VFactory;
// This file is part of MongoMVCC.
//
// Copyright (c) 2012 Fraunhofer IGD
//
// MongoMVCC is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// MongoMVCC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with MongoMVCC. If not, see <http://www.gnu.org/licenses/>.

package de.fhg.igd.mongomvcc.impl;




/**
 * Creates MongoDB implementation-specific objects of the MVCC model
 * @author Michel Kraemer
 */
public class MongoDBVFactory implements VFactory {
	@Override
// Path: src/main/java/de/fhg/igd/mongomvcc/VDatabase.java
// public interface VDatabase {
// 	/**
// 	 * Connect to a database
// 	 * @param name the database name
// 	 * @throws VException if connection failed
// 	 */
// 	void connect(String name);
// 	
// 	/**
// 	 * Connect to a database
// 	 * @param name the database name
// 	 * @param port the port the database listens to
// 	 * @throws VException if connection failed
// 	 */
// 	void connect(String name, int port);
// 	
// 	/**
// 	 * Connect to a database running on a given host and port
// 	 * @param name the database name
// 	 * @param host the host the database is running on
// 	 * @param port the port the database listens to
// 	 * @throws VException if connection failed
// 	 */
// 	void connect(String name, String host, int port);
// 	
// 	/**
// 	 * Checks out a named branch from the database
// 	 * @param name the branch's name
// 	 * @return the branch
// 	 * @throws VException if the branch does not exist yet
// 	 */
// 	VBranch checkout(String name);
// 	
// 	/**
// 	 * Checks out an unnamed branch from the database
// 	 * @param cid the CID of the commit which should be the branch's root
// 	 * @return the branch
// 	 * @throws VException if there is not commit with the given CID
// 	 */
// 	VBranch checkout(long cid);
// 	
// 	/**
// 	 * Creates a new named branch whose head is set to the given CID
// 	 * @param name the branch's name
// 	 * @param headCID the branch's head CID
// 	 * @return the branch
// 	 * @throws VException if there already is a branch with the given name or
// 	 * if the given head CID could not be resolved to an existing commit
// 	 */
// 	VBranch createBranch(String name, long headCID);
// 	
// 	/**
// 	 * Deletes the whole database. Be very careful with this method!
// 	 */
// 	void drop();
// 	
// 	/**
// 	 * @return a counter which generates unique IDs for the database
// 	 */
// 	VCounter getCounter();
// 	
// 	/**
// 	 * @return the database's history
// 	 */
// 	VHistory getHistory();
// 	
// 	/**
// 	 * @return a maintenance object
// 	 */
// 	VMaintenance getMaintenance();
// }
// 
// Path: src/main/java/de/fhg/igd/mongomvcc/VFactory.java
// public interface VFactory {
// 	/**
// 	 * @return a new MVCC database
// 	 */
// 	VDatabase createDatabase();
// 	
// 	/**
// 	 * @return a new empty document
// 	 */
// 	Map<String, Object> createDocument();
// 	
// 	/**
// 	 * Convenience method to create a new document with exactly one element
// 	 * @param key the element's key
// 	 * @param value the element's value
// 	 * @return the new document
// 	 */
// 	Map<String, Object> createDocument(String key, Object value);
// 	
// 	/**
// 	 * @return a new list
// 	 */
// 	List<Object> createList();
// }


// Path: src/main/java/de/fhg/igd/mongomvcc/impl/MongoDBVFactory.java
import java.util.List;
import java.util.Map;
import com.mongodb.BasicDBList;
import com.mongodb.BasicDBObject;
import de.fhg.igd.mongomvcc.VDatabase;
import de.fhg.igd.mongomvcc.VFactory;

// This file is part of MongoMVCC.
//
// Copyright (c) 2012 Fraunhofer IGD
//
// MongoMVCC is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// MongoMVCC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with MongoMVCC. If not, see <http://www.gnu.org/licenses/>.

package de.fhg.igd.mongomvcc.impl;




/**
 * Creates MongoDB implementation-specific objects of the MVCC model
 * @author Michel Kraemer
 */
public class MongoDBVFactory implements VFactory {
	@Override
	public VDatabase createDatabase() {