Package com.mongodb
Class MongoURI
java.lang.Object
com.mongodb.MongoURI
Deprecated.
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.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMongoURI
(MongoClientURI proxied) Deprecated.Deprecated.Replaced byMongoClientURI(String)
-
Method Summary
Modifier and TypeMethodDescriptionconnect()
Deprecated.Creates a Mongo instance based on the URI.connectCollection
(DB db) Deprecated.Returns the URI's Collection from a given DB object.connectCollection
(Mongo mongo) Deprecated.Returns the URI's Collection from a given Mongo instanceDeprecated.Returns the DB object from a newly created Mongo instance based on this URI.Deprecated.Returns the URI's DB object from a given Mongo instance.Deprecated.Gets the collection name.Deprecated.Gets the credentials.Deprecated.Gets the database name.getHosts()
Deprecated.Gets the list of hosts.Deprecated.Gets the options.char[]
Deprecated.Gets the password.Deprecated.Gets the username.toString()
Deprecated.
-
Field Details
-
MONGODB_PREFIX
Deprecated.The prefix for mongodb URIs.- See Also:
-
-
Constructor Details
-
MongoURI
Deprecated.Replaced byMongoClientURI(String)
Creates a MongoURI from a string.- Parameters:
uri
- the URI
-
MongoURI
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 Details
-
getUsername
Deprecated.Gets the username.- Returns:
- the username
-
getPassword
@Nullable public char[] getPassword()Deprecated.Gets the password.- Returns:
- the password
-
getHosts
Deprecated.Gets the list of hosts.- Returns:
- the list of hosts
-
getDatabase
Deprecated.Gets the database name.- Returns:
- the database name
-
getCollection
Deprecated.Gets the collection name.- Returns:
- the collection name
-
getCredentials
Deprecated.Gets the credentials.- Returns:
- the MongoCredential for conneting to MongoDB servers.
- Since:
- 2.11.0
-
getOptions
Deprecated.Gets the options. This method will return the same instance ofMongoOptions
for every call, so it's possible to mutate the returned instance to change the defaults.- Returns:
- the mongo options
-
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
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
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
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
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
-
toString
Deprecated.
-
MongoClientURI