Class MongoClientSettingsFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClientSettings>
org.springframework.data.mongodb.core.MongoClientSettingsFactoryBean
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<com.mongodb.MongoClientSettings>
,InitializingBean
public class MongoClientSettingsFactoryBean
extends AbstractFactoryBean<com.mongodb.MongoClientSettings>
A factory bean for construction of a
MongoClientSettings
instance to be used with a MongoDB driver.- Since:
- 3.0
- Author:
- Christoph Strobl, Mark Paluch
-
Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.mongodb.MongoClientSettings
Class<?>
void
setApplicationName
(String applicationName) void
setAutoEncryptionSettings
(com.mongodb.AutoEncryptionSettings autoEncryptionSettings) void
setClusterConnectionMode
(com.mongodb.connection.ClusterConnectionMode clusterConnectionMode) ????void
setClusterHosts
(com.mongodb.ServerAddress[] clusterHosts) void
setClusterLocalThresholdMS
(long clusterLocalThresholdMS) void
setClusterRequiredReplicaSetName
(String clusterRequiredReplicaSetName) void
setClusterServerSelectionTimeoutMS
(long clusterServerSelectionTimeoutMS) void
setClusterSrvHost
(String clusterSrvHost) void
setCodecRegistry
(org.bson.codecs.configuration.CodecRegistry codecRegistry) void
setCusterRequiredClusterType
(com.mongodb.connection.ClusterType custerRequiredClusterType) void
setPoolMaintenanceFrequencyMS
(long poolMaintenanceFrequencyMS) void
setPoolMaintenanceInitialDelayMS
(long poolMaintenanceInitialDelayMS) void
setPoolMaxConnectionIdleTimeMS
(long poolMaxConnectionIdleTimeMS) void
setPoolMaxConnectionLifeTimeMS
(long poolMaxConnectionLifeTimeMS) void
setPoolMaxSize
(int poolMaxSize) void
setPoolMaxWaitTimeMS
(long poolMaxWaitTimeMS) void
setPoolMinSize
(int poolMinSize) void
setReadConcern
(com.mongodb.ReadConcern readConcern) void
setReadPreference
(com.mongodb.ReadPreference readPreference) void
setRetryReads
(Boolean retryReads) void
setRetryWrites
(Boolean retryWrites) void
setServerApi
(com.mongodb.ServerApi serverApi) void
setServerHeartbeatFrequencyMS
(long serverHeartbeatFrequencyMS) void
setServerMinHeartbeatFrequencyMS
(long serverMinHeartbeatFrequencyMS) void
setSocketConnectTimeoutMS
(int socketConnectTimeoutMS) void
setSocketReadTimeoutMS
(int socketReadTimeoutMS) void
setSocketReceiveBufferSize
(int socketReceiveBufferSize) void
setSocketSendBufferSize
(int socketSendBufferSize) void
setSslEnabled
(Boolean sslEnabled) void
setSslInvalidHostNameAllowed
(Boolean sslInvalidHostNameAllowed) void
setSslProvider
(String sslProvider) void
setStreamFactoryFactory
(Object streamFactoryFactory) Deprecated.void
setTransportSettings
(com.mongodb.connection.TransportSettings transportSettings) void
setuUidRepresentation
(org.bson.UuidRepresentation uUidRepresentation) void
setWriteConcern
(com.mongodb.WriteConcern writeConcern) Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Constructor Details
-
MongoClientSettingsFactoryBean
public MongoClientSettingsFactoryBean()
-
-
Method Details
-
setSocketConnectTimeoutMS
public void setSocketConnectTimeoutMS(int socketConnectTimeoutMS) - Parameters:
socketConnectTimeoutMS
- in msec- See Also:
-
SocketSettings.Builder.connectTimeout(int, TimeUnit)
-
setSocketReadTimeoutMS
public void setSocketReadTimeoutMS(int socketReadTimeoutMS) - Parameters:
socketReadTimeoutMS
- in msec- See Also:
-
SocketSettings.Builder.readTimeout(int, TimeUnit)
-
setSocketReceiveBufferSize
public void setSocketReceiveBufferSize(int socketReceiveBufferSize) - Parameters:
socketReceiveBufferSize
-- See Also:
-
SocketSettings.Builder.receiveBufferSize(int)
-
setSocketSendBufferSize
public void setSocketSendBufferSize(int socketSendBufferSize) - Parameters:
socketSendBufferSize
-- See Also:
-
SocketSettings.Builder.sendBufferSize(int)
-
setServerHeartbeatFrequencyMS
public void setServerHeartbeatFrequencyMS(long serverHeartbeatFrequencyMS) - Parameters:
serverHeartbeatFrequencyMS
- in msec- See Also:
-
ServerSettings.Builder.heartbeatFrequency(long, TimeUnit)
-
setServerMinHeartbeatFrequencyMS
public void setServerMinHeartbeatFrequencyMS(long serverMinHeartbeatFrequencyMS) - Parameters:
serverMinHeartbeatFrequencyMS
- in msec- See Also:
-
ServerSettings.Builder.minHeartbeatFrequency(long, TimeUnit)
-
setClusterSrvHost
- Parameters:
clusterSrvHost
-- See Also:
-
ClusterSettings.Builder.srvHost(String)
-
setClusterHosts
public void setClusterHosts(com.mongodb.ServerAddress[] clusterHosts) - Parameters:
clusterHosts
-- See Also:
-
ClusterSettings.Builder.hosts(List)
-
setClusterConnectionMode
public void setClusterConnectionMode(com.mongodb.connection.ClusterConnectionMode clusterConnectionMode) ????- Parameters:
clusterConnectionMode
-- See Also:
-
ClusterSettings.Builder.mode(ClusterConnectionMode)
-
setCusterRequiredClusterType
public void setCusterRequiredClusterType(com.mongodb.connection.ClusterType custerRequiredClusterType) - Parameters:
custerRequiredClusterType
-- See Also:
-
ClusterSettings.Builder.requiredClusterType(ClusterType)
-
setClusterRequiredReplicaSetName
- Parameters:
clusterRequiredReplicaSetName
-- See Also:
-
ClusterSettings.Builder.requiredReplicaSetName(String)
-
setClusterLocalThresholdMS
public void setClusterLocalThresholdMS(long clusterLocalThresholdMS) - Parameters:
clusterLocalThresholdMS
- in msec- See Also:
-
ClusterSettings.Builder.localThreshold(long, TimeUnit)
-
setClusterServerSelectionTimeoutMS
public void setClusterServerSelectionTimeoutMS(long clusterServerSelectionTimeoutMS) - Parameters:
clusterServerSelectionTimeoutMS
- in msec- See Also:
-
ClusterSettings.Builder.serverSelectionTimeout(long, TimeUnit)
-
setPoolMaxSize
public void setPoolMaxSize(int poolMaxSize) - Parameters:
poolMaxSize
-- See Also:
-
ConnectionPoolSettings.Builder.maxSize(int)
-
setPoolMinSize
public void setPoolMinSize(int poolMinSize) - Parameters:
poolMinSize
-- See Also:
-
ConnectionPoolSettings.Builder.minSize(int)
-
setPoolMaxWaitTimeMS
public void setPoolMaxWaitTimeMS(long poolMaxWaitTimeMS) - Parameters:
poolMaxWaitTimeMS
- in mesec- See Also:
-
ConnectionPoolSettings.Builder.maxWaitTime(long, TimeUnit)
-
setPoolMaxConnectionLifeTimeMS
public void setPoolMaxConnectionLifeTimeMS(long poolMaxConnectionLifeTimeMS) - Parameters:
poolMaxConnectionLifeTimeMS
- in msec- See Also:
-
ConnectionPoolSettings.Builder.maxConnectionLifeTime(long, TimeUnit)
-
setPoolMaxConnectionIdleTimeMS
public void setPoolMaxConnectionIdleTimeMS(long poolMaxConnectionIdleTimeMS) - Parameters:
poolMaxConnectionIdleTimeMS
- in msec- See Also:
-
ConnectionPoolSettings.Builder.maxConnectionIdleTime(long, TimeUnit)
-
setPoolMaintenanceInitialDelayMS
public void setPoolMaintenanceInitialDelayMS(long poolMaintenanceInitialDelayMS) - Parameters:
poolMaintenanceInitialDelayMS
- in msec- See Also:
-
ConnectionPoolSettings.Builder.maintenanceInitialDelay(long, TimeUnit)
-
setPoolMaintenanceFrequencyMS
public void setPoolMaintenanceFrequencyMS(long poolMaintenanceFrequencyMS) - Parameters:
poolMaintenanceFrequencyMS
- in msec- See Also:
-
ConnectionPoolSettings.Builder.maintenanceFrequency(long, TimeUnit)
-
setSslEnabled
- Parameters:
sslEnabled
-- See Also:
-
SslSettings.Builder.enabled(boolean)
-
setSslInvalidHostNameAllowed
- Parameters:
sslInvalidHostNameAllowed
-- See Also:
-
SslSettings.Builder.invalidHostNameAllowed(boolean)
-
setSslProvider
- Parameters:
sslProvider
-- See Also:
-
SslSettings.Builder.context(SSLContext)
SSLContext.getInstance(String)
-
setApplicationName
- Parameters:
applicationName
-- See Also:
-
MongoClientSettings.Builder.applicationName(String)
-
setRetryReads
- Parameters:
retryReads
-- See Also:
-
MongoClientSettings.Builder.retryReads(boolean)
-
setReadConcern
public void setReadConcern(com.mongodb.ReadConcern readConcern) - Parameters:
readConcern
-- See Also:
-
MongoClientSettings.Builder.readConcern(ReadConcern)
-
setWriteConcern
public void setWriteConcern(com.mongodb.WriteConcern writeConcern) - Parameters:
writeConcern
-- See Also:
-
MongoClientSettings.Builder.writeConcern(WriteConcern)
-
setRetryWrites
- Parameters:
retryWrites
-- See Also:
-
MongoClientSettings.Builder.retryWrites(boolean)
-
setReadPreference
public void setReadPreference(com.mongodb.ReadPreference readPreference) - Parameters:
readPreference
-- See Also:
-
MongoClientSettings.Builder.readPreference(ReadPreference)
-
setStreamFactoryFactory
Deprecated.since 4.3, will be removed in the MongoDB 5.0 driver in favor ofcom.mongodb.connection.TransportSettings
.- Parameters:
streamFactoryFactory
-
-
setTransportSettings
public void setTransportSettings(@Nullable com.mongodb.connection.TransportSettings transportSettings) -
setCodecRegistry
public void setCodecRegistry(org.bson.codecs.configuration.CodecRegistry codecRegistry) - Parameters:
codecRegistry
-- See Also:
-
MongoClientSettings.Builder.codecRegistry(CodecRegistry)
-
setuUidRepresentation
- Parameters:
uUidRepresentation
-
-
setAutoEncryptionSettings
public void setAutoEncryptionSettings(@Nullable com.mongodb.AutoEncryptionSettings autoEncryptionSettings) - Parameters:
autoEncryptionSettings
- can be null.- See Also:
-
MongoClientSettings.Builder.autoEncryptionSettings(AutoEncryptionSettings)
-
setServerApi
- Parameters:
serverApi
- can be null.- Since:
- 3.3
- See Also:
-
MongoClientSettings.Builder.serverApi(ServerApi)
-
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<com.mongodb.MongoClientSettings>
- Specified by:
getObjectType
in classAbstractFactoryBean<com.mongodb.MongoClientSettings>
-
createInstance
protected com.mongodb.MongoClientSettings createInstance()- Specified by:
createInstance
in classAbstractFactoryBean<com.mongodb.MongoClientSettings>
-
com.mongodb.connection.TransportSettings
.