Class HeartbeatConfiguration

  • All Implemented Interfaces:
    io.micronaut.core.util.Toggleable

    @ConfigurationProperties("micronaut.heartbeat")
    public class HeartbeatConfiguration
    extends java.lang.Object
    implements io.micronaut.core.util.Toggleable
    Configuration for heart beat.
    Since:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean DEFAULT_ENABLED
      The default enable value.
      static int DEFAULT_INTERVAL_SECONDS
      The default interval seconds.
      static java.lang.String ENABLED
      Whether the heartbeat is enabled.
      static java.lang.String PREFIX
      The prefix used for the heart beat configuration.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.time.Duration getInterval()  
      boolean isEnabled()  
      void setEnabled​(boolean enabled)
      Default value (true).
      void setInterval​(java.time.Duration interval)
      Default value (15 seconds).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_ENABLED

        public static final boolean DEFAULT_ENABLED
        The default enable value.
        See Also:
        Constant Field Values
      • DEFAULT_INTERVAL_SECONDS

        public static final int DEFAULT_INTERVAL_SECONDS
        The default interval seconds.
        See Also:
        Constant Field Values
      • PREFIX

        public static final java.lang.String PREFIX
        The prefix used for the heart beat configuration.
        See Also:
        Constant Field Values
      • ENABLED

        public static final java.lang.String ENABLED
        Whether the heartbeat is enabled.
        See Also:
        Constant Field Values
    • Constructor Detail

      • HeartbeatConfiguration

        public HeartbeatConfiguration()
    • Method Detail

      • getInterval

        public java.time.Duration getInterval()
        Returns:
        The interval with which to publish HeartbeatEvent instances
      • setInterval

        public void setInterval​(java.time.Duration interval)
        Default value (15 seconds).
        Parameters:
        interval - The interval to publish HeartbeatEvent instances
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface io.micronaut.core.util.Toggleable
        Returns:
        Whether HeartbeatEvent event instances should be published by the server
      • setEnabled

        public void setEnabled​(boolean enabled)
        Default value (true).
        Parameters:
        enabled - Enable the publish of HeartbeatEvent event instances