Constructor and Description |
---|
MongoDBVDatabase() |
Modifier and Type | Method and Description |
---|---|
VBranch |
checkout(long cid)
Checks out an unnamed branch from the database
|
VBranch |
checkout(java.lang.String name)
Checks out a named branch from the database
|
void |
connect(java.lang.String name)
Connect to a database
|
void |
connect(java.lang.String name,
int port)
Connect to a database
|
void |
connect(java.lang.String name,
java.lang.String host,
int port)
Connect to a database running on a given host and port
|
void |
connectToReplicaSet(java.lang.String name,
java.util.List<com.mongodb.ServerAddress> seeds,
com.mongodb.ReadPreference readPreference)
Connect to a replica set.
|
VBranch |
createBranch(java.lang.String name,
long headCID)
Creates a new named branch whose head is set to the given CID
|
void |
drop()
Deletes the whole database.
|
BuildInfo |
getBuildInfo() |
VCounter |
getCounter() |
com.mongodb.DB |
getDB() |
VHistory |
getHistory() |
VMaintenance |
getMaintenance() |
public void connect(java.lang.String name) throws VException
VDatabase
connect
in interface VDatabase
name
- the database nameVException
- if connection failedpublic void connect(java.lang.String name, int port) throws VException
VDatabase
connect
in interface VDatabase
name
- the database nameport
- the port the database listens toVException
- if connection failedpublic void connect(java.lang.String name, java.lang.String host, int port) throws VException
VDatabase
connect
in interface VDatabase
name
- the database namehost
- the host the database is running onport
- the port the database listens toVException
- if connection failedpublic void connectToReplicaSet(java.lang.String name, java.util.List<com.mongodb.ServerAddress> seeds, com.mongodb.ReadPreference readPreference)
Connect to a replica set. This method does not appear in the
VDatabase
interface because replica sets are specific to
MongoDB. Other MVCC implementations might not have replica sets.
Besides we can use ServerAddress
and ReadPreference
here which is not possible in the generic interface.
name
- the database nameseeds
- a list of replica set membersreadPreference
- the read preference for this database (can be
null if the default should be used)public com.mongodb.DB getDB()
public BuildInfo getBuildInfo()
public void drop()
VDatabase
public VBranch checkout(java.lang.String name)
VDatabase
public VBranch checkout(long cid)
VDatabase
public VBranch createBranch(java.lang.String name, long headCID)
VDatabase
createBranch
in interface VDatabase
name
- the branch's nameheadCID
- the branch's head CIDpublic VCounter getCounter()
getCounter
in interface VDatabase
public VHistory getHistory()
getHistory
in interface VDatabase
public VMaintenance getMaintenance()
getMaintenance
in interface VDatabase