Class BaseMongoDbProperties

java.lang.Object
org.apereo.cas.configuration.model.support.mongo.BaseMongoDbProperties
All Implemented Interfaces:
Serializable, CasFeatureModule
Direct Known Subclasses:
MongoDbMonitorProperties, MongoDbTicketRegistryProperties, SingleCollectionMongoDbProperties

@RequiresModule(name="cas-server-support-mongo-core") public abstract class BaseMongoDbProperties extends Object implements CasFeatureModule, Serializable
Since:
5.1.0
See Also:
  • Constructor Details

    • BaseMongoDbProperties

      public BaseMongoDbProperties()
  • Method Details

    • getPool

      core connection-related settings.
    • getClientUri

      public String getClientUri()
      The connection uri to the mongodb instance. This typically takes on the form of mongodb://user:[email protected]:35522/db. If not specified, will fallback onto other individual settings. If specified, takes over all other settings where applicable.
    • getPort

      public int getPort()
      MongoDb database port.
    • getUserId

      public String getUserId()
      MongoDb database user for authentication.
    • getPassword

      public String getPassword()
      MongoDb database password for authentication.
    • getHost

      public String getHost()
      MongoDb database host for authentication. Multiple host addresses may be defined, separated by comma. If more than one host is defined, it is assumed that each host contains the port as well, if any. Otherwise the configuration may fallback onto the port defined.
    • getTimeout

      public String getTimeout()
      MongoDb database connection timeout.
    • getWriteConcern

      public String getWriteConcern()
      Write concern describes the level of acknowledgement requested from MongoDB for write operations to a standalone mongo db or to replica sets or to sharded clusters. In sharded clusters, mongo db instances will pass the write concern on to the shards.
    • getReadConcern

      public String getReadConcern()
      Read concern. Accepted values are:
      • LOCAL
      • MAJORITY
      • LINEARIZABLE
      • SNAPSHOT
      • AVAILABLE
    • getReadPreference

      public String getReadPreference()
      Read preference. Accepted values are:
      • PRIMARY
      • SECONDARY
      • SECONDARY_PREFERRED
      • PRIMARY_PREFERRED
      • NEAREST
    • getDatabaseName

      public String getDatabaseName()
      MongoDb database instance name.
    • isSocketKeepAlive

      public boolean isSocketKeepAlive()
      Whether the database socket connection should be tagged with keep-alive.
    • isRetryWrites

      public boolean isRetryWrites()
      Sets whether writes should be retried if they fail due to a network error.
    • getAuthenticationDatabaseName

      public String getAuthenticationDatabaseName()
      Name of the database to use for authentication.
    • isSslEnabled

      public boolean isSslEnabled()
      Whether connections require SSL.
    • getReplicaSet

      public String getReplicaSet()
      A replica set in MongoDB is a group of mongod processes that maintain the same data set. Replica sets provide redundancy and high availability, and are the basis for all production deployments.
    • setPool

      core connection-related settings.
      Returns:
      this.
    • setClientUri

      public BaseMongoDbProperties setClientUri(String clientUri)
      The connection uri to the mongodb instance. This typically takes on the form of mongodb://user:[email protected]:35522/db. If not specified, will fallback onto other individual settings. If specified, takes over all other settings where applicable.
      Returns:
      this.
    • setPort

      public BaseMongoDbProperties setPort(int port)
      MongoDb database port.
      Returns:
      this.
    • setUserId

      public BaseMongoDbProperties setUserId(String userId)
      MongoDb database user for authentication.
      Returns:
      this.
    • setPassword

      public BaseMongoDbProperties setPassword(String password)
      MongoDb database password for authentication.
      Returns:
      this.
    • setHost

      public BaseMongoDbProperties setHost(String host)
      MongoDb database host for authentication. Multiple host addresses may be defined, separated by comma. If more than one host is defined, it is assumed that each host contains the port as well, if any. Otherwise the configuration may fallback onto the port defined.
      Returns:
      this.
    • setTimeout

      public BaseMongoDbProperties setTimeout(String timeout)
      MongoDb database connection timeout.
      Returns:
      this.
    • setWriteConcern

      public BaseMongoDbProperties setWriteConcern(String writeConcern)
      Write concern describes the level of acknowledgement requested from MongoDB for write operations to a standalone mongo db or to replica sets or to sharded clusters. In sharded clusters, mongo db instances will pass the write concern on to the shards.
      Returns:
      this.
    • setReadConcern

      public BaseMongoDbProperties setReadConcern(String readConcern)
      Read concern. Accepted values are:
      • LOCAL
      • MAJORITY
      • LINEARIZABLE
      • SNAPSHOT
      • AVAILABLE
      Returns:
      this.
    • setReadPreference

      public BaseMongoDbProperties setReadPreference(String readPreference)
      Read preference. Accepted values are:
      • PRIMARY
      • SECONDARY
      • SECONDARY_PREFERRED
      • PRIMARY_PREFERRED
      • NEAREST
      Returns:
      this.
    • setDatabaseName

      public BaseMongoDbProperties setDatabaseName(String databaseName)
      MongoDb database instance name.
      Returns:
      this.
    • setSocketKeepAlive

      public BaseMongoDbProperties setSocketKeepAlive(boolean socketKeepAlive)
      Whether the database socket connection should be tagged with keep-alive.
      Returns:
      this.
    • setRetryWrites

      public BaseMongoDbProperties setRetryWrites(boolean retryWrites)
      Sets whether writes should be retried if they fail due to a network error.
      Returns:
      this.
    • setAuthenticationDatabaseName

      public BaseMongoDbProperties setAuthenticationDatabaseName(String authenticationDatabaseName)
      Name of the database to use for authentication.
      Returns:
      this.
    • setSslEnabled

      public BaseMongoDbProperties setSslEnabled(boolean sslEnabled)
      Whether connections require SSL.
      Returns:
      this.
    • setReplicaSet

      public BaseMongoDbProperties setReplicaSet(String replicaSet)
      A replica set in MongoDB is a group of mongod processes that maintain the same data set. Replica sets provide redundancy and high availability, and are the basis for all production deployments.
      Returns:
      this.