|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mongodb.MongoURI
public class MongoURI
Represents a URI which can be used to create a Mongo instance. The URI describes the hosts to be used and options.
Field Summary | |
---|---|
static java.lang.String |
MONGODB_PREFIX
|
Constructor Summary | |
---|---|
MongoURI(java.lang.String uri)
Creates a MongoURI described by a String. |
Method Summary | |
---|---|
Mongo |
connect()
creates a Mongo instance based on the URI |
DBCollection |
connectCollection(DB db)
returns the URI's Collection from a given DB object |
DBCollection |
connectCollection(Mongo m)
returns the URI's Collection from a given Mongo instance |
DB |
connectDB()
returns the DB object from a newly created Mongo instance based on this URI |
DB |
connectDB(Mongo m)
returns the URI's DB object from a given Mongo instance |
java.lang.String |
getCollection()
Gets the collection name |
java.lang.String |
getDatabase()
Gets the database name |
java.util.List<java.lang.String> |
getHosts()
Gets the list of hosts |
MongoOptions |
getOptions()
Gets the options |
char[] |
getPassword()
Gets the password |
java.lang.String |
getUsername()
Gets the username |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MONGODB_PREFIX
Constructor Detail |
---|
public MongoURI(java.lang.String uri)
uri
- the URI
Method Detail |
---|
public java.lang.String getUsername()
public char[] getPassword()
public java.util.List<java.lang.String> getHosts()
public java.lang.String getDatabase()
public java.lang.String getCollection()
public MongoOptions getOptions()
public Mongo connect() throws MongoException, java.net.UnknownHostException
MongoException
java.net.UnknownHostException
public DB connectDB() throws MongoException, java.net.UnknownHostException
MongoException
java.net.UnknownHostException
public DB connectDB(Mongo m)
m
-
public DBCollection connectCollection(DB db)
db
-
public DBCollection connectCollection(Mongo m)
m
-
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |