Package com.mongodb
Class MongoURI
- java.lang.Object
 - 
- com.mongodb.MongoURI
 
 
- 
@Deprecated public class MongoURI extends Object
Deprecated.Replaced byMongoClientURIRepresents a URI which can be used to create a Mongo instance. The URI describes the hosts to be used and options.
This class has been superseded by
MongoClientURI, and may be removed in a future release.- See Also:
 MongoClientURI
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringMONGODB_PREFIXDeprecated.The prefix for mongodb URIs. 
- 
Constructor Summary
Constructors Constructor Description MongoURI(MongoClientURI proxied)Deprecated.MongoURI(String uri)Deprecated.Replaced byMongoClientURI(String) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Mongoconnect()Deprecated.Creates a Mongo instance based on the URI.DBCollectionconnectCollection(DB db)Deprecated.Returns the URI's Collection from a given DB object.DBCollectionconnectCollection(Mongo mongo)Deprecated.Returns the URI's Collection from a given Mongo instanceDBconnectDB()Deprecated.Returns the DB object from a newly created Mongo instance based on this URI.DBconnectDB(Mongo mongo)Deprecated.Returns the URI's DB object from a given Mongo instance.StringgetCollection()Deprecated.Gets the collection name.MongoCredentialgetCredentials()Deprecated.Gets the credentials.StringgetDatabase()Deprecated.Gets the database name.List<String>getHosts()Deprecated.Gets the list of hosts.MongoOptionsgetOptions()Deprecated.Gets the options.char[]getPassword()Deprecated.Gets the password.StringgetUsername()Deprecated.Gets the username.StringtoString()Deprecated. 
 - 
 
- 
- 
Field Detail
- 
MONGODB_PREFIX
public static final String MONGODB_PREFIX
Deprecated.The prefix for mongodb URIs.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
MongoURI
@Deprecated public MongoURI(String uri)
Deprecated.Replaced byMongoClientURI(String)Creates a MongoURI from a string.- Parameters:
 uri- the URI- MongoDB documentation
 - Connection String URI Format
 
 
- 
MongoURI
@Deprecated public MongoURI(MongoClientURI proxied)
Deprecated.Create a new MongoURI from a MongoClientURI. This class is deprecated, useMongoClientURI.- Parameters:
 proxied- the MongoClientURI to wrap with this deprecated class. * @deprecated Replaced byMongoClientURI)
 
 - 
 
- 
Method Detail
- 
getUsername
@Nullable public String getUsername()
Deprecated.Gets the username.- Returns:
 - the username
 
 
- 
getPassword
@Nullable public char[] getPassword()
Deprecated.Gets the password.- Returns:
 - the password
 
 
- 
getHosts
public List<String> getHosts()
Deprecated.Gets the list of hosts.- Returns:
 - the list of hosts
 
 
- 
getDatabase
@Nullable public String getDatabase()
Deprecated.Gets the database name.- Returns:
 - the database name
 
 
- 
getCollection
@Nullable public String getCollection()
Deprecated.Gets the collection name.- Returns:
 - the collection name
 
 
- 
getCredentials
@Nullable public MongoCredential getCredentials()
Deprecated.Gets the credentials.- Returns:
 - the MongoCredential for conneting to MongoDB servers.
 - Since:
 - 2.11.0
 
 
- 
getOptions
public MongoOptions getOptions()
Deprecated.Gets the options. This method will return the same instance ofMongoOptionsfor every call, so it's possible to mutate the returned instance to change the defaults.- Returns:
 - the mongo options
 
 
- 
connect
public Mongo connect()
Deprecated.Creates a Mongo instance based on the URI.- Returns:
 - a new Mongo instance. There is no caching, so each call will create a new instance, each of which must be closed manually.
 - Throws:
 MongoException- if there's a failure
 
- 
connectDB
public DB connectDB()
Deprecated.Returns the DB object from a newly created Mongo instance based on this URI.- Returns:
 - the database specified in the URI. This will implicitly create a new Mongo instance, which must be closed manually.
 - Throws:
 MongoException- if there's a failure
 
- 
connectDB
public DB connectDB(Mongo mongo)
Deprecated.Returns the URI's DB object from a given Mongo instance.- Parameters:
 mongo- the Mongo instance to get the database from.- Returns:
 - the database specified in this URI
 
 
- 
connectCollection
public DBCollection connectCollection(DB db)
Deprecated.Returns the URI's Collection from a given DB object.- Parameters:
 db- the database to get the collection from- Returns:
 - the collection specified in this URI
 
 
- 
connectCollection
public DBCollection connectCollection(Mongo mongo)
Deprecated.Returns the URI's Collection from a given Mongo instance- Parameters:
 mongo- the mongo instance to get the collection from- Returns:
 - the collection specified in this URI
 
 
 - 
 
 -