|
||||||||||
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.
The Java driver supports the following options (case insensitive):
Field Summary | |
---|---|
static String |
MONGODB_PREFIX
|
Constructor Summary | |
---|---|
MongoURI(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 |
String |
getCollection()
Gets the collection name |
String |
getDatabase()
Gets the database name |
List<String> |
getHosts()
Gets the list of hosts |
MongoOptions |
getOptions()
Gets the options |
char[] |
getPassword()
Gets the password |
String |
getUsername()
Gets the username |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String MONGODB_PREFIX
Constructor Detail |
---|
public MongoURI(String uri)
uri
- the URI
Method Detail |
---|
public String getUsername()
public char[] getPassword()
public List<String> getHosts()
public String getDatabase()
public String getCollection()
public MongoOptions getOptions()
public Mongo connect() throws MongoException, UnknownHostException
MongoException
UnknownHostException
public DB connectDB() throws MongoException, UnknownHostException
MongoException
UnknownHostException
public DB connectDB(Mongo m)
m
-
public DBCollection connectCollection(DB db)
db
-
public DBCollection connectCollection(Mongo m)
m
-
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |