Klasse MorphiumConfig
- Autor:
- stephan
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic enumstatic enum -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungMorphiumConfig(String db, int maxConnections, int globalCacheValidTime, int housekeepingTimeout) MorphiumConfig(String prefix, MorphiumConfigResolver resolver) MorphiumConfig(String prefix, Properties prop) MorphiumConfig(Properties prop) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungaddDefaultTag(String name, String value) addHostToSeed(String host) addHostToSeed(String host, int port) returns a property set only containing non-default values setasProperties(String prefix) asProperties(String prefix, boolean effectiveConfig) static MorphiumConfigcreateFromJson(String json) static MorphiumConfigfromProperties(String prefix, Properties p) static MorphiumConfiggetCache()intintClass<? extends EncryptionKeyProvider>intfor future use - set Global Caching timeintintintintintintintintintintintintintgetPropertyNames(String prefix) intintintintintintintintintintlongintintlongintlongClass<? extends ValueEncryptionProvider>intintintbooleanbooleanisAtlas()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisUseSSL()booleansetAsyncWriter(MorphiumWriter asyncWriter) setAsyncWritesEnabled(boolean asyncWritesEnabled) voidsetAtlasUrl(String atlasUrl) setAutoIndexAndCappedCreationOnWrite(boolean autoIndexAndCappedCreationOnWrite) setAutoValuesEnabled(boolean enabled) setBufferedWriter(MorphiumWriter bufferedWriter) setBufferedWritesEnabled(boolean bufferedWritesEnabled) setCache(MorphiumCache cache) setCamelCaseConversionEnabled(boolean camelCaseConversionEnabled) setCappedCheck(MorphiumConfig.CappedCheck cappedCheck) setCheckForNew(boolean checkForNew) if set to false, all checks if an entity is new when CreationTime is used is switched off if set to true, only those, whose CreationTime settings use checkfornew will work default falsesetConnectionTimeout(int connectionTimeout) setCredentialsDecryptionKey(String credentialsDecryptionKey) setCredentialsEncrypted(Boolean credentialsEncrypted) setCredentialsEncryptionKey(String credentialsEncryptionKey) setCursorBatchSize(int cursorBatchSize) setDatabase(String database) setDefaultReadPreference(ReadPreference defaultReadPreference) setDefaultReadPreferenceType(String stringDefaultReadPreference) setDriverName(String driverName) voidsetEncryptionKeyProviderClass(Class<? extends EncryptionKeyProvider> encryptionKeyProviderClass) setGlobalCacheValidTime(int globalCacheValidTime) setGlobalFsync(boolean globalFsync) setGlobalJ(boolean globalJ) setGlobalW(int globalW) setHeartbeatFrequency(int heartbeatFrequency) setHostSeed(String hostPorts) setHostSeed(String... hostPorts) setHostSeed(String hosts, String ports) setHostSeed(List<String> str) setting hosts as Host:PortsetHostSeed(List<String> str, List<Integer> ports) setHousekeepingTimeout(int housekeepingTimeout) voidsetIndexCheck(MorphiumConfig.IndexCheck indexCheck) setLocalThreshold(int localThreshold) Sets the local threshold.setMaxConnectionIdleTime(int maxConnectionIdleTime) setMaxConnectionLifeTime(int maxConnectionLifeTime) setMaxConnections(int maxConnections) setMaximumRetriesAsyncWriter(int maximumRetriesAsyncWriter) setMaximumRetriesBufferedWriter(int maximumRetriesBufferedWriter) setMaximumRetriesWriter(int maximumRetriesWriter) setMaxWaitTime(int maxWaitTime) Sets the maximum time that a thread will block waiting for a connection.voidsetMessagingWindowSize(int messagingWindowSize) setMinConnections(int minConnections) setMongoAuthDb(String mongoAuthDb) setMongoLogin(String mongoLogin) setMongoPassword(String mongoPassword) setObjectSerializationEnabled(boolean objectSerializationEnabled) setReadCacheEnabled(boolean readCacheEnabled) voidsetReadTimeout(int readTimeout) setReplicasetMonitoring(boolean replicaset) setReplicaSetMonitoringTimeout(int replicaSetMonitoringTimeout) setRequiredReplicaSetName(String requiredReplicaSetName) setRetriesOnNetworkError(int retriesOnNetworkError) voidsetRetryReads(boolean retryReads) setRetryWaitTimeAsyncWriter(int retryWaitTimeAsyncWriter) setRetryWaitTimeBufferedWriter(int retryWaitTimeBufferedWriter) setRetryWaitTimeWriter(int retryWaitTimeWriter) voidsetRetryWrites(boolean retryWrites) setServerSelectionTimeout(int serverSelectionTimeout) Sets the server selection timeout in milliseconds, which defines how long the driver will wait for server selection to succeed before throwing an exception.setSleepBetweenNetworkErrorRetries(int sleepBetweenNetworkErrorRetries) voidsetSslContext(SSLContext sslContext) voidsetSslInvalidHostNameAllowed(boolean sslInvalidHostNameAllowed) voidsetThreadConnectionMultiplier(int threadConnectionMultiplier) setThreadPoolAsyncOpCoreSize(int threadPoolAsyncOpCoreSize) setThreadPoolAsyncOpKeepAliveTime(long threadPoolAsyncOpKeepAliveTime) setThreadPoolAsyncOpMaxSize(int threadPoolAsyncOpMaxSize) setThreadPoolMessagingCoreSize(int threadPoolMessagingCoreSize) setThreadPoolMessagingKeepAliveTime(long threadPoolMessagingKeepAliveTime) setThreadPoolMessagingMaxSize(int threadPoolMessagingMaxSize) voidsetUseSSL(boolean useSSL) voidsetUuidRepresentation(String uuidRepresentation) Sets the UUID representation to use when encoding instances ofUUIDand when decoding BSON binary values with subtype of 3.setValidTime(int tm) setValueEncryptionProviderClass(Class<? extends ValueEncryptionProvider> valueEncryptionProviderClass) voidsetWarnOnNoEntitySerialization(boolean warnOnNoEntitySerialization) setWriteBufferTime(int writeBufferTime) setWriteBufferTimeGranularity(int writeBufferTimeGranularity) setWriteCacheTimeout(int writeCacheTimeout) setWriter(MorphiumWriter writer) toString()returns json representation of this object containing all values
-
Konstruktordetails
-
MorphiumConfig
-
MorphiumConfig
-
MorphiumConfig
-
MorphiumConfig
public MorphiumConfig() -
MorphiumConfig
public MorphiumConfig(String db, int maxConnections, int globalCacheValidTime, int housekeepingTimeout)
-
-
Methodendetails
-
getPropertyNames
-
createFromJson
public static MorphiumConfig createFromJson(String json) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException, org.json.simple.parser.ParseException, NoSuchMethodException, InvocationTargetException - Löst aus:
NoSuchFieldExceptionClassNotFoundExceptionIllegalAccessExceptionInstantiationExceptionorg.json.simple.parser.ParseExceptionNoSuchMethodExceptionInvocationTargetException
-
getMessagingWindowSize
public int getMessagingWindowSize() -
setMessagingWindowSize
public void setMessagingWindowSize(int messagingWindowSize) -
fromProperties
-
fromProperties
-
isAtlas
public boolean isAtlas() -
getAtlasUrl
-
setAtlasUrl
-
isReplicaset
public boolean isReplicaset() -
setReplicasetMonitoring
-
getValueEncryptionProviderClass
-
setValueEncryptionProviderClass
public MorphiumConfig setValueEncryptionProviderClass(Class<? extends ValueEncryptionProvider> valueEncryptionProviderClass) -
getEncryptionKeyProviderClass
-
setEncryptionKeyProviderClass
public void setEncryptionKeyProviderClass(Class<? extends EncryptionKeyProvider> encryptionKeyProviderClass) -
getCredentialsEncryptionKey
-
setCredentialsEncryptionKey
-
getCredentialsDecryptionKey
-
setCredentialsDecryptionKey
-
getDriverName
-
setDriverName
-
isAutoIndexAndCappedCreationOnWrite
public boolean isAutoIndexAndCappedCreationOnWrite() -
setAutoIndexAndCappedCreationOnWrite
public MorphiumConfig setAutoIndexAndCappedCreationOnWrite(boolean autoIndexAndCappedCreationOnWrite) -
isWarnOnNoEntitySerialization
public boolean isWarnOnNoEntitySerialization() -
setWarnOnNoEntitySerialization
public void setWarnOnNoEntitySerialization(boolean warnOnNoEntitySerialization) -
isCheckForNew
public boolean isCheckForNew() -
setCheckForNew
if set to false, all checks if an entity is new when CreationTime is used is switched off if set to true, only those, whose CreationTime settings use checkfornew will work default false- Parameter:
checkForNew- boolean, check if object is really not stored yet
-
getRetriesOnNetworkError
public int getRetriesOnNetworkError() -
setRetriesOnNetworkError
-
getSleepBetweenNetworkErrorRetries
public int getSleepBetweenNetworkErrorRetries() -
setSleepBetweenNetworkErrorRetries
-
getReplicaSetMonitoringTimeout
public int getReplicaSetMonitoringTimeout() -
setReplicaSetMonitoringTimeout
-
getWriteBufferTimeGranularity
public int getWriteBufferTimeGranularity() -
setWriteBufferTimeGranularity
-
getCache
-
setCache
-
getWriteBufferTime
public int getWriteBufferTime() -
setWriteBufferTime
-
getGlobalW
public int getGlobalW() -
setGlobalW
-
getThreadConnectionMultiplier
public int getThreadConnectionMultiplier() -
setThreadConnectionMultiplier
public void setThreadConnectionMultiplier(int threadConnectionMultiplier) -
isGlobalJ
public boolean isGlobalJ() -
setGlobalJ
-
isGlobalFsync
public boolean isGlobalFsync() -
setGlobalFsync
-
getBufferedWriter
-
setBufferedWriter
-
getWriter
-
setWriter
-
getConnectionTimeout
public int getConnectionTimeout() -
setConnectionTimeout
-
getMaxWaitTime
public int getMaxWaitTime() -
setMaxWaitTime
Sets the maximum time that a thread will block waiting for a connection.- Parameter:
maxWaitTime- the maximum wait time, in milliseconds- Gibt zurück:
this
-
getServerSelectionTimeout
public int getServerSelectionTimeout() -
setServerSelectionTimeout
Sets the server selection timeout in milliseconds, which defines how long the driver will wait for server selection to succeed before throwing an exception.
A value of 0 means that it will timeout immediately if no server is available. A negative value means to wait indefinitely.
- Parameter:
serverSelectionTimeout- the server selection timeout, in milliseconds- Gibt zurück:
this
-
getCredentialsEncrypted
-
setCredentialsEncrypted
-
getMongoAuthDb
-
decryptAuthDb
-
decryptMongoLogin
-
decryptMongoPassword
-
setMongoAuthDb
-
getMongoLogin
-
setMongoLogin
-
getMongoPassword
-
setMongoPassword
-
getDefaultReadPreference
-
setDefaultReadPreference
-
getDefaultReadPreferenceType
-
setDefaultReadPreferenceType
-
getWriteCacheTimeout
public int getWriteCacheTimeout() -
setWriteCacheTimeout
-
setHostSeed
setting hosts as Host:Port- Parameter:
str- list of hosts, with or without port
-
setHostSeed
-
getHostSeed
-
setHostSeed
-
setHostSeed
-
setHostSeed
-
addHostToSeed
-
addHostToSeed
-
getMaxConnections
public int getMaxConnections() -
setMaxConnections
-
getGlobalCacheValidTime
public int getGlobalCacheValidTime()for future use - set Global Caching time- Gibt zurück:
- the global cache valid time
-
setGlobalCacheValidTime
-
getDatabase
-
setDatabase
-
getHousekeepingTimeout
public int getHousekeepingTimeout() -
setHousekeepingTimeout
-
getValidTime
public long getValidTime() -
setValidTime
-
toString
returns json representation of this object containing all values -
getAsyncWriter
-
setAsyncWriter
-
getMaximumRetriesBufferedWriter
public int getMaximumRetriesBufferedWriter() -
setMaximumRetriesBufferedWriter
-
getMaximumRetriesWriter
public int getMaximumRetriesWriter() -
setMaximumRetriesWriter
-
getMaximumRetriesAsyncWriter
public int getMaximumRetriesAsyncWriter() -
setMaximumRetriesAsyncWriter
-
getRetryWaitTimeBufferedWriter
public int getRetryWaitTimeBufferedWriter() -
setRetryWaitTimeBufferedWriter
-
getRetryWaitTimeWriter
public int getRetryWaitTimeWriter() -
setRetryWaitTimeWriter
-
getRetryWaitTimeAsyncWriter
public int getRetryWaitTimeAsyncWriter() -
setRetryWaitTimeAsyncWriter
-
asProperties
returns a property set only containing non-default values set- Gibt zurück:
- properties
-
asProperties
-
asProperties
- Parameter:
prefix- prefix to use in property keyseffectiveConfig- when true, use the current effective config, including overrides from Environment- Gibt zurück:
- the properties
-
isReadCacheEnabled
public boolean isReadCacheEnabled() -
setReadCacheEnabled
-
disableReadCache
-
enableReadCache
-
isAsyncWritesEnabled
public boolean isAsyncWritesEnabled() -
setAsyncWritesEnabled
-
disableAsyncWrites
-
enableAsyncWrites
-
isBufferedWritesEnabled
public boolean isBufferedWritesEnabled() -
setBufferedWritesEnabled
-
disableBufferedWrites
-
enableBufferedWrites
-
isAutoValuesEnabled
public boolean isAutoValuesEnabled() -
setAutoValuesEnabled
-
enableAutoValues
-
disableAutoValues
-
isCamelCaseConversionEnabled
public boolean isCamelCaseConversionEnabled() -
setCamelCaseConversionEnabled
-
getThreadPoolMessagingCoreSize
public int getThreadPoolMessagingCoreSize() -
setThreadPoolMessagingCoreSize
-
getThreadPoolMessagingMaxSize
public int getThreadPoolMessagingMaxSize() -
setThreadPoolMessagingMaxSize
-
getThreadPoolMessagingKeepAliveTime
public long getThreadPoolMessagingKeepAliveTime() -
setThreadPoolMessagingKeepAliveTime
-
getThreadPoolAsyncOpCoreSize
public int getThreadPoolAsyncOpCoreSize() -
setThreadPoolAsyncOpCoreSize
-
getThreadPoolAsyncOpMaxSize
public int getThreadPoolAsyncOpMaxSize() -
setThreadPoolAsyncOpMaxSize
-
getThreadPoolAsyncOpKeepAliveTime
public long getThreadPoolAsyncOpKeepAliveTime() -
setThreadPoolAsyncOpKeepAliveTime
-
isObjectSerializationEnabled
public boolean isObjectSerializationEnabled() -
setObjectSerializationEnabled
-
getHeartbeatFrequency
public int getHeartbeatFrequency() -
setHeartbeatFrequency
-
getMinConnectionsHost
public int getMinConnectionsHost() -
setMinConnections
-
getLocalThreshold
public int getLocalThreshold() -
setLocalThreshold
Sets the local threshold. When choosing among multiple MongoDB servers to send a request, the MongoClient will only send that request to a server whose ping time is less than or equal to the server with the fastest ping time plus the local threshold.
For example, let's say that the client is choosing a server to send a query when the read preference is
ReadPreference.secondary(), and that there are three secondaries, server1, server2, and server3, whose ping times are 10, 15, and 16 milliseconds, respectively. With a local threshold of 5 milliseconds, the client will send the query to either server1 or server2 (randomly selecting between the two).Default is 15 milliseconds.
- Gibt zurück:
- the local threshold, in milliseconds
- Seit:
- 2.13.0
-
getMaxConnectionIdleTime
public int getMaxConnectionIdleTime() -
setMaxConnectionIdleTime
-
getMaxConnectionLifeTime
public int getMaxConnectionLifeTime() -
setMaxConnectionLifeTime
-
getRequiredReplicaSetName
-
setRequiredReplicaSetName
-
getDefaultTags
-
addDefaultTag
-
getDefaultTagSet
-
getCursorBatchSize
public int getCursorBatchSize() -
setCursorBatchSize
-
getSslContext
-
setSslContext
-
isUseSSL
public boolean isUseSSL() -
setUseSSL
public void setUseSSL(boolean useSSL) -
isSslInvalidHostNameAllowed
public boolean isSslInvalidHostNameAllowed() -
setSslInvalidHostNameAllowed
public void setSslInvalidHostNameAllowed(boolean sslInvalidHostNameAllowed) -
getReadTimeout
public int getReadTimeout() -
setReadTimeout
public void setReadTimeout(int readTimeout) -
isRetryReads
public boolean isRetryReads() -
setRetryReads
public void setRetryReads(boolean retryReads) -
isRetryWrites
public boolean isRetryWrites() -
setRetryWrites
public void setRetryWrites(boolean retryWrites) -
getUuidRepresentation
-
setUuidRepresentation
Sets the UUID representation to use when encoding instances ofUUIDand when decoding BSON binary values with subtype of 3.The default is UNSPECIFIED, If your application stores UUID values in MongoDB, you must set this value to the desired representation. New applications should prefer STANDARD, while existing Java applications should prefer JAVA_LEGACY. Applications wishing to interoperate with existing Python or .NET applications should prefer PYTHON_LEGACY or C_SHARP_LEGACY, respectively. Applications that do not store UUID values in MongoDB don't need to set this value.
- Parameter:
uuidRepresentation- the UUID representation- Seit:
- 3.12
-
getIndexCheck
-
setIndexCheck
-
getCappedCheck
-
setCappedCheck
-