Record Class AgenorProperties.Directory

java.lang.Object
java.lang.Record
dev.agenor.autoconfigure.AgenorProperties.Directory
Record Components:
provider - agent directory implementation: local (default), inmemory, or jdbc
presence - presence implementation: inmemory (default) or jdbc. Independent of provider, because presence is written far more often than the rest of the directory is and may reasonably live elsewhere (ADR-028)
heartbeatInterval - how often the runtime reports its agents alive, for example 30s. Absent means no heartbeats are sent at all
stalenessWindow - how long an agent may go unseen before its status reads UNKNOWN. Absent means three times heartbeatInterval, or — when nothing is heartbeating — no expiry at all, which is what the in-memory backend does
jdbc - JDBC-specific configuration; only read when provider=jdbc
Enclosing class:
AgenorProperties

public static record AgenorProperties.Directory(String provider, String presence, Duration heartbeatInterval, Duration stalenessWindow, AgenorProperties.Directory.Jdbc jdbc) extends Record
Directory

JDBC provider example:


 agenor:
   directory:
     provider: jdbc
     presence: jdbc
     heartbeat-interval: 30s
     jdbc:
       url: jdbc:postgresql://localhost:5432/mydb
       username: agenor
       password: ${DB_PASSWORD}
       pool-size: 10
 
  • Constructor Details

    • Directory

      public Directory(@DefaultValue("local") String provider, @DefaultValue("inmemory") String presence, Duration heartbeatInterval, Duration stalenessWindow, AgenorProperties.Directory.Jdbc jdbc)
      Creates an instance of a Directory record class.
      Parameters:
      provider - the value for the provider record component
      presence - the value for the presence record component
      heartbeatInterval - the value for the heartbeatInterval record component
      stalenessWindow - the value for the stalenessWindow record component
      jdbc - the value for the jdbc record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • provider

      public String provider()
      Returns the value of the provider record component.
      Returns:
      the value of the provider record component
    • presence

      public String presence()
      Returns the value of the presence record component.
      Returns:
      the value of the presence record component
    • heartbeatInterval

      public Duration heartbeatInterval()
      Returns the value of the heartbeatInterval record component.
      Returns:
      the value of the heartbeatInterval record component
    • stalenessWindow

      public Duration stalenessWindow()
      Returns the value of the stalenessWindow record component.
      Returns:
      the value of the stalenessWindow record component
    • jdbc

      Returns the value of the jdbc record component.
      Returns:
      the value of the jdbc record component