MongoClientURI
@Deprecated public class MongoURI extends 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 String |
MONGODB_PREFIX
Deprecated.
The prefix for mongodb URIs.
|
Constructor and Description |
---|
MongoURI(MongoClientURI proxied)
Deprecated.
|
MongoURI(String uri)
Deprecated.
Replaced by
MongoClientURI.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.
|
String |
getCollection()
Deprecated.
Gets the collection name.
|
MongoCredential |
getCredentials()
Deprecated.
Gets the credentials.
|
String |
getDatabase()
Deprecated.
Gets the database name.
|
List<String> |
getHosts()
Deprecated.
Gets the list of hosts.
|
MongoOptions |
getOptions()
Deprecated.
Gets the options.
|
char[] |
getPassword()
Deprecated.
Gets the password.
|
String |
getUsername()
Deprecated.
Gets the username.
|
String |
toString()
Deprecated.
|
public static final String MONGODB_PREFIX
@Deprecated public MongoURI(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 String getUsername()
public char[] getPassword()
public List<String> getHosts()
public String getDatabase()
public 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 from