Record Class ScriptQuotasConfig

java.lang.Object
java.lang.Record
com.soulfiremc.server.script.ScriptQuotasConfig

public record ScriptQuotasConfig(long maxExecutionCount, Duration dataEdgeTimeout, Duration nodeExecutionTimeout, int maxConcurrentTriggers, long maxStateStoreEntries, boolean disableTimeouts) extends Record
Immutable configuration record for script execution quotas. Duration.ZERO means "no timeout" (timeouts disabled).
  • Field Details

    • DEFAULT_MAX_EXECUTION_COUNT

      public static final long DEFAULT_MAX_EXECUTION_COUNT
      See Also:
    • DEFAULT_DATA_EDGE_TIMEOUT

      public static final Duration DEFAULT_DATA_EDGE_TIMEOUT
    • DEFAULT_NODE_EXECUTION_TIMEOUT

      public static final Duration DEFAULT_NODE_EXECUTION_TIMEOUT
    • DEFAULT_MAX_CONCURRENT_TRIGGERS

      public static final int DEFAULT_MAX_CONCURRENT_TRIGGERS
      See Also:
    • DEFAULT_MAX_STATE_STORE_ENTRIES

      public static final long DEFAULT_MAX_STATE_STORE_ENTRIES
      See Also:
    • DEFAULTS

      public static final ScriptQuotasConfig DEFAULTS
  • Constructor Details

    • ScriptQuotasConfig

      public ScriptQuotasConfig(long maxExecutionCount, Duration dataEdgeTimeout, Duration nodeExecutionTimeout, int maxConcurrentTriggers, long maxStateStoreEntries, boolean disableTimeouts)
      Creates an instance of a ScriptQuotasConfig record class.
      Parameters:
      maxExecutionCount - the value for the maxExecutionCount record component
      dataEdgeTimeout - the value for the dataEdgeTimeout record component
      nodeExecutionTimeout - the value for the nodeExecutionTimeout record component
      maxConcurrentTriggers - the value for the maxConcurrentTriggers record component
      maxStateStoreEntries - the value for the maxStateStoreEntries record component
      disableTimeouts - the value for the disableTimeouts record component
  • Method Details

    • fromProto

      public static ScriptQuotasConfig fromProto(ScriptQuotas proto)
      Creates a ScriptQuotasConfig from a protobuf ScriptQuotas message. Unset fields use server defaults.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • maxExecutionCount

      public long maxExecutionCount()
      Returns the value of the maxExecutionCount record component.
      Returns:
      the value of the maxExecutionCount record component
    • dataEdgeTimeout

      public Duration dataEdgeTimeout()
      Returns the value of the dataEdgeTimeout record component.
      Returns:
      the value of the dataEdgeTimeout record component
    • nodeExecutionTimeout

      public Duration nodeExecutionTimeout()
      Returns the value of the nodeExecutionTimeout record component.
      Returns:
      the value of the nodeExecutionTimeout record component
    • maxConcurrentTriggers

      public int maxConcurrentTriggers()
      Returns the value of the maxConcurrentTriggers record component.
      Returns:
      the value of the maxConcurrentTriggers record component
    • maxStateStoreEntries

      public long maxStateStoreEntries()
      Returns the value of the maxStateStoreEntries record component.
      Returns:
      the value of the maxStateStoreEntries record component
    • disableTimeouts

      public boolean disableTimeouts()
      Returns the value of the disableTimeouts record component.
      Returns:
      the value of the disableTimeouts record component