public class MorphiumConfig extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MorphiumConfig.IndexCappedCheck |
| Constructor and Description |
|---|
MorphiumConfig() |
MorphiumConfig(Properties prop) |
MorphiumConfig(String db,
int maxConnections,
int globalCacheValidTime,
int housekeepingTimeout) |
MorphiumConfig(String prefix,
MorphiumConfigResolver resolver) |
MorphiumConfig(String prefix,
Properties prop) |
public MorphiumConfig(Properties prop)
public MorphiumConfig(String prefix, Properties prop)
public MorphiumConfig(String prefix, MorphiumConfigResolver resolver)
public MorphiumConfig()
public MorphiumConfig(String db, int maxConnections, int globalCacheValidTime, int housekeepingTimeout)
public static MorphiumConfig createFromJson(String json) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException, org.json.simple.parser.ParseException, NoSuchMethodException, InvocationTargetException
NoSuchFieldExceptionClassNotFoundExceptionIllegalAccessExceptionInstantiationExceptionorg.json.simple.parser.ParseExceptionNoSuchMethodExceptionInvocationTargetExceptionpublic int getMessagingWindowSize()
public void setMessagingWindowSize(int messagingWindowSize)
public static MorphiumConfig fromProperties(String prefix, Properties p)
public static MorphiumConfig fromProperties(Properties p)
public boolean isAtlas()
public String getAtlasUrl()
public void setAtlasUrl(String atlasUrl)
public boolean isReplicaset()
public MorphiumConfig setReplicasetMonitoring(boolean replicaset)
public Class<? extends EncryptionKeyProvider> getEncryptionKeyProviderClass()
public void setEncryptionKeyProviderClass(Class<? extends EncryptionKeyProvider> encryptionKeyProviderClass)
public String getDriverClass()
public MorphiumConfig setDriverClass(String driverClass)
public boolean isAutoIndexAndCappedCreationOnWrite()
public MorphiumConfig setAutoIndexAndCappedCreationOnWrite(boolean autoIndexAndCappedCreationOnWrite)
public boolean isWarnOnNoEntitySerialization()
public void setWarnOnNoEntitySerialization(boolean warnOnNoEntitySerialization)
public boolean isCheckForNew()
public MorphiumConfig setCheckForNew(boolean checkForNew)
checkForNew - boolean, check if object is really not stored yetpublic int getRetriesOnNetworkError()
public MorphiumConfig setRetriesOnNetworkError(int retriesOnNetworkError)
public int getSleepBetweenNetworkErrorRetries()
public MorphiumConfig setSleepBetweenNetworkErrorRetries(int sleepBetweenNetworkErrorRetries)
public int getReplicaSetMonitoringTimeout()
public MorphiumConfig setReplicaSetMonitoringTimeout(int replicaSetMonitoringTimeout)
public int getWriteBufferTimeGranularity()
public MorphiumConfig setWriteBufferTimeGranularity(int writeBufferTimeGranularity)
public MorphiumCache getCache()
public MorphiumConfig setCache(MorphiumCache cache)
public int getWriteBufferTime()
public MorphiumConfig setWriteBufferTime(int writeBufferTime)
public Class<? extends MorphiumObjectMapper> getOmClass()
public MorphiumConfig setOmClass(Class<? extends MorphiumObjectMapper> omClass)
public int getGlobalW()
public MorphiumConfig setGlobalW(int globalW)
public int getThreadConnectionMultiplier()
public void setThreadConnectionMultiplier(int threadConnectionMultiplier)
public boolean isGlobalJ()
public MorphiumConfig setGlobalJ(boolean globalJ)
public MorphiumConfig setQueryClass(Class<? extends Query> queryClass)
public QueryFactory getQueryFact()
public MorphiumConfig setQueryFact(QueryFactory queryFact)
public AggregatorFactory getAggregatorFactory()
public MorphiumConfig setAggregatorFactory(AggregatorFactory aggregatorFactory)
public Class<? extends Aggregator> getAggregatorClass()
public MorphiumConfig setAggregatorClass(Class<? extends Aggregator> aggregatorClass)
public boolean isGlobalFsync()
public MorphiumConfig setGlobalFsync(boolean globalFsync)
public MorphiumWriter getBufferedWriter()
public MorphiumConfig setBufferedWriter(MorphiumWriter bufferedWriter)
public MorphiumWriter getWriter()
public MorphiumConfig setWriter(MorphiumWriter writer)
public int getConnectionTimeout()
public MorphiumConfig setConnectionTimeout(int connectionTimeout)
public Class<? extends MongoField> getFieldImplClass()
public MorphiumConfig setFieldImplClass(Class<? extends MongoField> fieldImplClass)
public int getMaxWaitTime()
public MorphiumConfig setMaxWaitTime(int maxWaitTime)
maxWaitTime - the maximum wait time, in millisecondsthispublic int getServerSelectionTimeout()
public MorphiumConfig 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.
A value of 0 means that it will timeout immediately if no server is available. A negative value means to wait indefinitely.
serverSelectionTimeout - the server selection timeout, in millisecondsthispublic String getMongoLogin()
public MorphiumConfig setMongoLogin(String mongoLogin)
public String getMongoPassword()
public MorphiumConfig setMongoPassword(String mongoPassword)
public ReadPreference getDefaultReadPreference()
public MorphiumConfig setDefaultReadPreference(ReadPreference defaultReadPreference)
public String getDefaultReadPreferenceType()
public MorphiumConfig setDefaultReadPreferenceType(String stringDefaultReadPreference)
public String getMongoAdminUser()
public MorphiumConfig setMongoAdminUser(String mongoAdminUser)
public String getMongoAdminPwd()
public MorphiumConfig setMongoAdminPwd(String mongoAdminPwd)
public int getWriteCacheTimeout()
public MorphiumConfig setWriteCacheTimeout(int writeCacheTimeout)
public MorphiumConfig setHostSeed(List<String> str)
str - list of hosts, with or without portpublic MorphiumConfig setHostSeed(List<String> str, List<Integer> ports)
public MorphiumConfig setHostSeed(String... hostPorts)
public MorphiumConfig setHostSeed(String hostPorts)
public MorphiumConfig setHostSeed(String hosts, String ports)
public MorphiumConfig addHostToSeed(String host, int port)
public MorphiumConfig addHostToSeed(String host)
public int getMaxConnections()
public MorphiumConfig setMaxConnections(int maxConnections)
public int getGlobalCacheValidTime()
public MorphiumConfig setGlobalCacheValidTime(int globalCacheValidTime)
public String getDatabase()
public MorphiumConfig setDatabase(String database)
public int getHousekeepingTimeout()
public MorphiumConfig setHousekeepingTimeout(int housekeepingTimeout)
public long getValidTime()
public MorphiumConfig setValidTime(int tm)
public String toString()
public MorphiumWriter getAsyncWriter()
public MorphiumConfig setAsyncWriter(MorphiumWriter asyncWriter)
public int getMaximumRetriesBufferedWriter()
public MorphiumConfig setMaximumRetriesBufferedWriter(int maximumRetriesBufferedWriter)
public int getMaximumRetriesWriter()
public MorphiumConfig setMaximumRetriesWriter(int maximumRetriesWriter)
public int getMaximumRetriesAsyncWriter()
public MorphiumConfig setMaximumRetriesAsyncWriter(int maximumRetriesAsyncWriter)
public int getRetryWaitTimeBufferedWriter()
public MorphiumConfig setRetryWaitTimeBufferedWriter(int retryWaitTimeBufferedWriter)
public int getRetryWaitTimeWriter()
public MorphiumConfig setRetryWaitTimeWriter(int retryWaitTimeWriter)
public int getRetryWaitTimeAsyncWriter()
public MorphiumConfig setRetryWaitTimeAsyncWriter(int retryWaitTimeAsyncWriter)
public Properties asProperties()
public Properties asProperties(String prefix)
public Properties asProperties(String prefix, boolean effectiveConfig)
prefix - prefix to use in property keyseffectiveConfig - when true, use the current effective config, including overrides from Environmentpublic boolean isReadCacheEnabled()
public MorphiumConfig setReadCacheEnabled(boolean readCacheEnabled)
public MorphiumConfig disableReadCache()
public MorphiumConfig enableReadCache()
public boolean isAsyncWritesEnabled()
public MorphiumConfig setAsyncWritesEnabled(boolean asyncWritesEnabled)
public MorphiumConfig disableAsyncWrites()
public MorphiumConfig enableAsyncWrites()
public boolean isBufferedWritesEnabled()
public MorphiumConfig setBufferedWritesEnabled(boolean bufferedWritesEnabled)
public MorphiumConfig disableBufferedWrites()
public MorphiumConfig enableBufferedWrites()
public boolean isAutoValuesEnabled()
public MorphiumConfig setAutoValuesEnabled(boolean enabled)
public MorphiumConfig enableAutoValues()
public MorphiumConfig disableAutoValues()
public boolean isCamelCaseConversionEnabled()
public MorphiumConfig setCamelCaseConversionEnabled(boolean camelCaseConversionEnabled)
public int getThreadPoolMessagingCoreSize()
public MorphiumConfig setThreadPoolMessagingCoreSize(int threadPoolMessagingCoreSize)
public int getThreadPoolMessagingMaxSize()
public MorphiumConfig setThreadPoolMessagingMaxSize(int threadPoolMessagingMaxSize)
public long getThreadPoolMessagingKeepAliveTime()
public MorphiumConfig setThreadPoolMessagingKeepAliveTime(long threadPoolMessagingKeepAliveTime)
public int getThreadPoolAsyncOpCoreSize()
public MorphiumConfig setThreadPoolAsyncOpCoreSize(int threadPoolAsyncOpCoreSize)
public int getThreadPoolAsyncOpMaxSize()
public MorphiumConfig setThreadPoolAsyncOpMaxSize(int threadPoolAsyncOpMaxSize)
public long getThreadPoolAsyncOpKeepAliveTime()
public MorphiumConfig setThreadPoolAsyncOpKeepAliveTime(long threadPoolAsyncOpKeepAliveTime)
public boolean isObjectSerializationEnabled()
public MorphiumConfig setObjectSerializationEnabled(boolean objectSerializationEnabled)
public int getHeartbeatFrequency()
public MorphiumConfig setHeartbeatFrequency(int heartbeatFrequency)
public int getMinConnectionsHost()
public MorphiumConfig setMinConnections(int minConnections)
public int getLocalThreshold()
public MorphiumConfig setLocalThreshold(int localThreshold)
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.
public int getMaxConnectionIdleTime()
public MorphiumConfig setMaxConnectionIdleTime(int maxConnectionIdleTime)
public int getMaxConnectionLifeTime()
public MorphiumConfig setMaxConnectionLifeTime(int maxConnectionLifeTime)
public String getRequiredReplicaSetName()
public MorphiumConfig setRequiredReplicaSetName(String requiredReplicaSetName)
public String getDefaultTags()
public MorphiumConfig addDefaultTag(String name, String value)
public int getCursorBatchSize()
public MorphiumConfig setCursorBatchSize(int cursorBatchSize)
public SSLContext getSslContext()
public void setSslContext(SSLContext sslContext)
public boolean isUseSSL()
public void setUseSSL(boolean useSSL)
public boolean isSslInvalidHostNameAllowed()
public void setSslInvalidHostNameAllowed(boolean sslInvalidHostNameAllowed)
public int getReadTimeout()
public void setReadTimeout(int readTimeout)
public boolean isRetryReads()
public void setRetryReads(boolean retryReads)
public boolean isRetryWrites()
public void setRetryWrites(boolean retryWrites)
public String getUuidRepresentation()
public void setUuidRepresentation(String uuidRepresentation)
UUID and 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.
uuidRepresentation - the UUID representationpublic MorphiumConfig.IndexCappedCheck getIndexCappedCheck()
public void setIndexCappedCheck(MorphiumConfig.IndexCappedCheck indexCappedCheck)
Copyright © 2022. All rights reserved.