Class BaseRedisProperties

java.lang.Object
org.apereo.cas.configuration.model.support.redis.BaseRedisProperties
All Implemented Interfaces:
Serializable, CasFeatureModule
Direct Known Subclasses:
AuditRedisProperties, RedisAcceptableUsagePolicyProperties, RedisAuthenticationProperties, RedisConsentProperties, RedisEventsProperties, RedisGoogleAuthenticatorMultifactorProperties, RedisPrincipalAttributesProperties, RedisSamlMetadataProperties, RedisServiceRegistryProperties, RedisTicketRegistryProperties, RedisTrustedDevicesMultifactorProperties, WebAuthnRedisMultifactorProperties, YubiKeyRedisMultifactorProperties

@RequiresModule(name="cas-server-support-redis-core") public class BaseRedisProperties extends Object implements Serializable, CasFeatureModule
Since:
5.2.0
See Also:
  • Constructor Details

    • BaseRedisProperties

      public BaseRedisProperties()
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Whether the module is enabled or not, defaults to true.
    • getUri

      public String getUri()
      Database URI.
    • getDatabase

      public int getDatabase()
      Database index used by the connection factory.
    • getHost

      public String getHost()
      Redis server host.
    • getUsername

      public String getUsername()
      Login username of the redis server.
    • getPassword

      public String getPassword()
      Login password of the redis server.
    • getPort

      public int getPort()
      Redis server port.
    • getTimeout

      public String getTimeout()
      Command timeout.
    • getPool

      public RedisPoolProperties getPool()
      Redis connection pool settings.
    • getSentinel

      public RedisSentinelProperties getSentinel()
      Redis Sentinel settings.
    • getCluster

      public RedisClusterProperties getCluster()
      Redis cluster settings.
    • getScanCount

      public long getScanCount()
      Redis scan count option. When and if specified, SCAN operations would be "counted" or limited by this setting. While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option. Basically with COUNT the user specified the amount of work that should be done at every call in order to retrieve elements from the collection. This is just a hint for the implementation, however generally speaking this is what you could expect most of the times from the implementation.
    • isUseSsl

      public boolean isUseSsl()
      Whether or not to use SSL for connection factory.
    • getShareNativeConnections

      public Boolean getShareNativeConnections()
      The shared native connection is never closed by Lettuce connection, therefore it is not validated by default when connections are retrieved. If this setting is true, a shared connection will be used for regular operations and a connection provider will be used to select a connection for blocking and tx operations only, which should not share a connection. If native connection sharing is disabled, new (or pooled) connections will be used for all operations. By default, multiple connections share a single thread-safe native connection. If you enable connection pooling, then native connection sharing will be disabled and the connection pool will be used for all operations. You may however explicitly control connection sharing via this setting as an override.
    • getProtocolVersion

      public String getProtocolVersion()
      Redis protocol version.
    • getConnectTimeout

      public String getConnectTimeout()
      Connection timeout.
    • getReadFrom

      Setting that describes how Lettuce routes read operations to replica nodes. Note that modes referencing MASTER/SLAVE are deprecated (but still supported) in the Lettuce redis client dependency so migrate config to UPSTREAM/REPLICA.
    • isVerifyPeer

      public boolean isVerifyPeer()
      Control how peer verification is handled with redis connections. Peer verification is a security feature that checks if the host you're connecting to is who it says it is. This is often done by checking a digital certificate.
    • isStartTls

      public boolean isStartTls()
      Start mutual TLS. In order to support TLS, Redis should be configured with a X.509 certificate and a private key. In addition, it is necessary to specify a CA certificate bundle file or path to be used as a trusted root when validating certificates.
    • getKeyCertificateChainFile

      public File getKeyCertificateChainFile()
      May be used when making SSL connections. Sets the certificate file to use for client authentication. This is typically an X.509 certificate file (or chain file) in PEM format.
    • getKeyFile

      public File getKeyFile()
      May be used when making SSL connections. Sets the key file for client authentication. The key is reloaded on each connection attempt that allows to replace certificates during runtime. This is typically a PKCS#8 private key file in PEM format.
    • getKeyPassword

      public String getKeyPassword()
      The password of the keyFile, or null if it's not password-protected.
    • setEnabled

      public BaseRedisProperties setEnabled(boolean enabled)
      Whether the module is enabled or not, defaults to true.
      Returns:
      this.
    • setUri

      public BaseRedisProperties setUri(String uri)
      Database URI.
      Returns:
      this.
    • setDatabase

      public BaseRedisProperties setDatabase(int database)
      Database index used by the connection factory.
      Returns:
      this.
    • setHost

      public BaseRedisProperties setHost(String host)
      Redis server host.
      Returns:
      this.
    • setUsername

      public BaseRedisProperties setUsername(String username)
      Login username of the redis server.
      Returns:
      this.
    • setPassword

      public BaseRedisProperties setPassword(String password)
      Login password of the redis server.
      Returns:
      this.
    • setPort

      public BaseRedisProperties setPort(int port)
      Redis server port.
      Returns:
      this.
    • setTimeout

      public BaseRedisProperties setTimeout(String timeout)
      Command timeout.
      Returns:
      this.
    • setPool

      Redis connection pool settings.
      Returns:
      this.
    • setSentinel

      public BaseRedisProperties setSentinel(RedisSentinelProperties sentinel)
      Redis Sentinel settings.
      Returns:
      this.
    • setCluster

      public BaseRedisProperties setCluster(RedisClusterProperties cluster)
      Redis cluster settings.
      Returns:
      this.
    • setScanCount

      public BaseRedisProperties setScanCount(long scanCount)
      Redis scan count option. When and if specified, SCAN operations would be "counted" or limited by this setting. While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option. Basically with COUNT the user specified the amount of work that should be done at every call in order to retrieve elements from the collection. This is just a hint for the implementation, however generally speaking this is what you could expect most of the times from the implementation.
      Returns:
      this.
    • setUseSsl

      public BaseRedisProperties setUseSsl(boolean useSsl)
      Whether or not to use SSL for connection factory.
      Returns:
      this.
    • setShareNativeConnections

      public BaseRedisProperties setShareNativeConnections(Boolean shareNativeConnections)
      The shared native connection is never closed by Lettuce connection, therefore it is not validated by default when connections are retrieved. If this setting is true, a shared connection will be used for regular operations and a connection provider will be used to select a connection for blocking and tx operations only, which should not share a connection. If native connection sharing is disabled, new (or pooled) connections will be used for all operations. By default, multiple connections share a single thread-safe native connection. If you enable connection pooling, then native connection sharing will be disabled and the connection pool will be used for all operations. You may however explicitly control connection sharing via this setting as an override.
      Returns:
      this.
    • setProtocolVersion

      public BaseRedisProperties setProtocolVersion(String protocolVersion)
      Redis protocol version.
      Returns:
      this.
    • setConnectTimeout

      public BaseRedisProperties setConnectTimeout(String connectTimeout)
      Connection timeout.
      Returns:
      this.
    • setReadFrom

      Setting that describes how Lettuce routes read operations to replica nodes. Note that modes referencing MASTER/SLAVE are deprecated (but still supported) in the Lettuce redis client dependency so migrate config to UPSTREAM/REPLICA.
      Returns:
      this.
    • setVerifyPeer

      public BaseRedisProperties setVerifyPeer(boolean verifyPeer)
      Control how peer verification is handled with redis connections. Peer verification is a security feature that checks if the host you're connecting to is who it says it is. This is often done by checking a digital certificate.
      Returns:
      this.
    • setStartTls

      public BaseRedisProperties setStartTls(boolean startTls)
      Start mutual TLS. In order to support TLS, Redis should be configured with a X.509 certificate and a private key. In addition, it is necessary to specify a CA certificate bundle file or path to be used as a trusted root when validating certificates.
      Returns:
      this.
    • setKeyCertificateChainFile

      public BaseRedisProperties setKeyCertificateChainFile(File keyCertificateChainFile)
      May be used when making SSL connections. Sets the certificate file to use for client authentication. This is typically an X.509 certificate file (or chain file) in PEM format.
      Returns:
      this.
    • setKeyFile

      public BaseRedisProperties setKeyFile(File keyFile)
      May be used when making SSL connections. Sets the key file for client authentication. The key is reloaded on each connection attempt that allows to replace certificates during runtime. This is typically a PKCS#8 private key file in PEM format.
      Returns:
      this.
    • setKeyPassword

      public BaseRedisProperties setKeyPassword(String keyPassword)
      The password of the keyFile, or null if it's not password-protected.
      Returns:
      this.