public class MongoClientFactoryBean extends AbstractFactoryBean<com.mongodb.Mongo> implements PersistenceExceptionTranslator
logger| Constructor and Description |
|---|
MongoClientFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
protected com.mongodb.Mongo |
createInstance() |
protected void |
destroyInstance(com.mongodb.Mongo instance) |
Class<? extends com.mongodb.Mongo> |
getObjectType() |
void |
setCredentials(com.mongodb.MongoCredential[] credentials)
Set the list of credentials to be used when creating
MongoClient. |
void |
setExceptionTranslator(PersistenceExceptionTranslator exceptionTranslator)
Configures the
PersistenceExceptionTranslator to use. |
void |
setHost(String host)
Configures the host to connect to.
|
void |
setMongoClientOptions(com.mongodb.MongoClientOptions mongoClientOptions)
Set the
MongoClientOptions to be used when creating MongoClient. |
void |
setPort(int port)
Configures the port to connect to.
|
void |
setReplicaSetSeeds(com.mongodb.ServerAddress[] replicaSetSeeds)
Set the list of
ServerAddress to build up a replica set for. |
DataAccessException |
translateExceptionIfPossible(RuntimeException ex) |
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingletonpublic void setMongoClientOptions(com.mongodb.MongoClientOptions mongoClientOptions)
MongoClientOptions to be used when creating MongoClient.mongoClientOptions - public void setCredentials(com.mongodb.MongoCredential[] credentials)
MongoClient.credentials - can be null.public void setReplicaSetSeeds(com.mongodb.ServerAddress[] replicaSetSeeds)
ServerAddress to build up a replica set for.replicaSetSeeds - can be null.public void setHost(String host)
host - public void setPort(int port)
port - public void setExceptionTranslator(PersistenceExceptionTranslator exceptionTranslator)
PersistenceExceptionTranslator to use.exceptionTranslator - public Class<? extends com.mongodb.Mongo> getObjectType()
getObjectType in interface FactoryBean<com.mongodb.Mongo>getObjectType in class AbstractFactoryBean<com.mongodb.Mongo>public DataAccessException translateExceptionIfPossible(RuntimeException ex)
translateExceptionIfPossible in interface PersistenceExceptionTranslatorprotected com.mongodb.Mongo createInstance()
throws Exception
createInstance in class AbstractFactoryBean<com.mongodb.Mongo>Exceptionprotected void destroyInstance(com.mongodb.Mongo instance)
throws Exception
destroyInstance in class AbstractFactoryBean<com.mongodb.Mongo>ExceptionCopyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.