MongoClientURI
@Deprecated
public class MongoURI
extends java.lang.Object
Represents 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.
MongoClientURI
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MONGODB_PREFIX
Deprecated.
The prefix for mongodb URIs.
|
Constructor and Description |
---|
MongoURI(MongoClientURI proxied)
Deprecated.
|
MongoURI(java.lang.String uri)
Deprecated.
Replaced by
MongoClientURI(String) |
Modifier and Type | Method and Description |
---|---|
Mongo |
connect()
Deprecated.
Creates a Mongo instance based on the URI.
|
DBCollection |
connectCollection(DB db)
Deprecated.
Returns the URI's Collection from a given DB object.
|
DBCollection |
connectCollection(Mongo mongo)
Deprecated.
Returns the URI's Collection from a given Mongo instance
|
DB |
connectDB()
Deprecated.
Returns the DB object from a newly created Mongo instance based on this URI.
|
DB |
connectDB(Mongo mongo)
Deprecated.
Returns the URI's DB object from a given Mongo instance.
|
java.lang.String |
getCollection()
Deprecated.
Gets the collection name.
|
MongoCredential |
getCredentials()
Deprecated.
Gets the credentials.
|
java.lang.String |
getDatabase()
Deprecated.
Gets the database name.
|
java.util.List<java.lang.String> |
getHosts()
Deprecated.
Gets the list of hosts.
|
MongoOptions |
getOptions()
Deprecated.
Gets the options.
|
char[] |
getPassword()
Deprecated.
Gets the password.
|
java.lang.String |
getUsername()
Deprecated.
Gets the username.
|
java.lang.String |
toString()
Deprecated.
|
public static final java.lang.String MONGODB_PREFIX
@Deprecated public MongoURI(java.lang.String uri)
MongoClientURI(String)
uri
- the URI@Deprecated public MongoURI(MongoClientURI proxied)
MongoClientURI
.proxied
- the MongoClientURI to wrap with this deprecated class. * @deprecated Replaced by MongoClientURI
)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 MongoCredential getCredentials()
public MongoOptions getOptions()
MongoOptions
for every call, so it's possible to mutate the
returned instance to change the defaults.public Mongo connect()
MongoException
- if there's a failurepublic DB connectDB()
MongoException
- if there's a failurepublic DB connectDB(Mongo mongo)
mongo
- the Mongo instance to get the database from.public DBCollection connectCollection(DB db)
db
- the database to get the collection frompublic DBCollection connectCollection(Mongo mongo)
mongo
- the mongo instance to get the collection frompublic java.lang.String toString()
toString
in class java.lang.Object