@ConfigurationProperties(prefix="spring.data.mongodb") public class MongoProperties extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT
Default port used when the configured port is
null . |
Constructor and Description |
---|
MongoProperties() |
Modifier and Type | Method and Description |
---|---|
void |
clearPassword() |
com.mongodb.MongoClient |
createMongoClient(com.mongodb.MongoClientOptions options)
Deprecated.
Since 1.3.0 in favour of
createMongoClient(MongoClientOptions, Environment) |
com.mongodb.MongoClient |
createMongoClient(com.mongodb.MongoClientOptions options,
Environment environment)
Creates a
MongoClient using the given options and
environment . |
String |
getAuthenticationDatabase() |
String |
getDatabase() |
Class<? extends org.springframework.data.mapping.model.FieldNamingStrategy> |
getFieldNamingStrategy() |
String |
getGridFsDatabase() |
String |
getHost() |
String |
getMongoClientDatabase() |
char[] |
getPassword() |
Integer |
getPort() |
String |
getUri() |
String |
getUsername() |
void |
setAuthenticationDatabase(String authenticationDatabase) |
void |
setDatabase(String database) |
void |
setFieldNamingStrategy(Class<? extends org.springframework.data.mapping.model.FieldNamingStrategy> fieldNamingStrategy) |
void |
setGridFsDatabase(String gridFsDatabase) |
void |
setHost(String host) |
void |
setPassword(char[] password) |
void |
setPort(Integer port) |
void |
setUri(String uri) |
void |
setUsername(String username) |
public static final int DEFAULT_PORT
null
.public String getHost()
public void setHost(String host)
public String getDatabase()
public void setDatabase(String database)
public String getAuthenticationDatabase()
public void setAuthenticationDatabase(String authenticationDatabase)
public String getUsername()
public void setUsername(String username)
public char[] getPassword()
public void setPassword(char[] password)
public Class<? extends org.springframework.data.mapping.model.FieldNamingStrategy> getFieldNamingStrategy()
public void setFieldNamingStrategy(Class<? extends org.springframework.data.mapping.model.FieldNamingStrategy> fieldNamingStrategy)
public void clearPassword()
public String getUri()
public void setUri(String uri)
public Integer getPort()
public void setPort(Integer port)
public String getGridFsDatabase()
public void setGridFsDatabase(String gridFsDatabase)
public String getMongoClientDatabase()
@Deprecated public com.mongodb.MongoClient createMongoClient(com.mongodb.MongoClientOptions options) throws UnknownHostException
createMongoClient(MongoClientOptions, Environment)
MongoClient
using the given options
options
- the optionsUnknownHostException
- if the configured host is unknownpublic com.mongodb.MongoClient createMongoClient(com.mongodb.MongoClientOptions options, Environment environment) throws UnknownHostException
MongoClient
using the given options
and
environment
. If the configured port is zero, the value of the
local.mongo.port
property retrieved from the environment
is used
to configure the client.options
- the optionsenvironment
- the environmentUnknownHostException
- if the configured host is unknownCopyright © 2015 Pivotal Software, Inc.. All rights reserved.