Class DefaultPersistenceConfig

java.lang.Object
org.eclipse.ditto.internal.utils.health.config.DefaultPersistenceConfig
All Implemented Interfaces:
PersistenceConfig

@Immutable public final class DefaultPersistenceConfig extends Object implements PersistenceConfig
This class is the default implementation of the health check persistence config.
  • Method Details

    • of

      public static DefaultPersistenceConfig of(com.typesafe.config.Config config)
      Returns an instance of DefaultPersistenceConfig based on the settings of the specified Config.
      Parameters:
      config - is supposed to provide the settings of the persistence config at "persistence".
      Returns:
      the instance.
      Throws:
      DittoConfigError - if config is invalid.
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: PersistenceConfig
      Indicates whether the persistence health check should be enabled.
      Specified by:
      isEnabled in interface PersistenceConfig
      Returns:
      true if the persistence health check should be enabled, false else.
    • getTimeout

      public Duration getTimeout()
      Description copied from interface: PersistenceConfig
      Returns the timeout of the health check for persistence. If the persistence takes longer than that to respond, it is considered "DOWN".
      Specified by:
      getTimeout in interface PersistenceConfig
      Returns:
      the timeout of the health check for persistence.
      See Also:
    • getMetricsReporterConfig

      public MetricsReporterConfig getMetricsReporterConfig()
      Description copied from interface: PersistenceConfig
      Returns the configuration settings of the metrics reporter.
      Specified by:
      getMetricsReporterConfig in interface PersistenceConfig
      Returns:
      the config.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object