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| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
MONGODB_PREFIX
已过时。
The prefix for mongodb URIs.
|
| 构造器和说明 |
|---|
MongoURI(MongoClientURI proxied)
已过时。
|
MongoURI(java.lang.String uri)
已过时。
Replaced by
MongoClientURI.MongoClientURI(String) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 mongo)
已过时。
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 mongo)
已过时。
Returns the URI's DB object from a given Mongo instance.
|
java.lang.String |
getCollection()
已过时。
Gets the collection name.
|
MongoCredential |
getCredentials()
已过时。
Gets the credentials.
|
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()
已过时。
|
public static final java.lang.String MONGODB_PREFIX
@Deprecated public MongoURI(java.lang.String uri)
MongoClientURI.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 在类中 java.lang.Object