Record Class IP2LocationAdmin.Status

java.lang.Object
java.lang.Record
com.iizix.server.geo.ip2location.IP2LocationAdmin.Status
Record Components:
enabledSetting - The switch in the server settings.
configured - Whether the manager has a service (a disabled service counts).
ready - Whether at least one database is loaded.
shutdown - Whether the manager is shut down (the server is stopping).
description - The manager's status text (IP2LocationManager.getStatusDescription()).
nextUpdate - The next scheduled update check, null for none.
lastUpdateMonth - The month of the last successful download, null for never.
ipv4Date - The publication date of the loaded IPv4 database, null for none.
ipv6Date - The publication date of the loaded IPv6 database, null for none.
initFailures - The consecutive initialization failures of this session.
lookupErrors - The consecutive lookup errors of this session.
downloadFailures - The download failures of this session.
recoveryAttempts - The automatic recovery attempts made.
maxRecoveryAttempts - The configured maximum of automatic recovery attempts.
recoveryRecommended - Whether a recovery is recommended.
recoveryReason - Why, null when not recommended.
recoveryInProgress - Whether a recovery is running.
lastDownloadError - The message of the last download error since the last success or clearing, null for none.
Enclosing class:
IP2LocationAdmin

public static record IP2LocationAdmin.Status(boolean enabledSetting, boolean configured, boolean ready, boolean shutdown, String description, Instant nextUpdate, YearMonth lastUpdateMonth, LocalDate ipv4Date, LocalDate ipv6Date, int initFailures, int lookupErrors, int downloadFailures, int recoveryAttempts, int maxRecoveryAttempts, boolean recoveryRecommended, String recoveryReason, boolean recoveryInProgress, String lastDownloadError) extends Record
The status of the service at one moment, the fields of the Status section of the NetPhantom page: everything a UI shows, nothing it must compute.
Author:
Christopher Mindus
  • Constructor Details

    • Status

      public Status(boolean enabledSetting, boolean configured, boolean ready, boolean shutdown, String description, Instant nextUpdate, YearMonth lastUpdateMonth, LocalDate ipv4Date, LocalDate ipv6Date, int initFailures, int lookupErrors, int downloadFailures, int recoveryAttempts, int maxRecoveryAttempts, boolean recoveryRecommended, String recoveryReason, boolean recoveryInProgress, String lastDownloadError)
      Creates an instance of a Status record class.
      Parameters:
      enabledSetting - the value for the enabledSetting record component
      configured - the value for the configured record component
      ready - the value for the ready record component
      shutdown - the value for the shutdown record component
      description - the value for the description record component
      nextUpdate - the value for the nextUpdate record component
      lastUpdateMonth - the value for the lastUpdateMonth record component
      ipv4Date - the value for the ipv4Date record component
      ipv6Date - the value for the ipv6Date record component
      initFailures - the value for the initFailures record component
      lookupErrors - the value for the lookupErrors record component
      downloadFailures - the value for the downloadFailures record component
      recoveryAttempts - the value for the recoveryAttempts record component
      maxRecoveryAttempts - the value for the maxRecoveryAttempts record component
      recoveryRecommended - the value for the recoveryRecommended record component
      recoveryReason - the value for the recoveryReason record component
      recoveryInProgress - the value for the recoveryInProgress record component
      lastDownloadError - the value for the lastDownloadError record component
  • Method Details

    • getIndicator

      public IP2LocationAdmin.Status.Indicator getIndicator()
      Gets the state of the recovery indicator for the switch as the settings hold it.
      Returns:
      The state.
    • getIndicator

      public IP2LocationAdmin.Status.Indicator getIndicator(boolean switchOn)
      Gets the state of the recovery indicator for a switch position: a dialog shows the switch as the user has set it, before it is saved.
      Parameters:
      switchOn - The switch.
      Returns:
      The state.
    • getDownloadErrorSummary

      public String getDownloadErrorSummary()
      Summarizes the last download error for the indicator, as the NetPhantom page did.
      Returns:
      The short text, null when there is no download error.
    • 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.
    • enabledSetting

      public boolean enabledSetting()
      Returns the value of the enabledSetting record component.
      Returns:
      the value of the enabledSetting record component
    • configured

      public boolean configured()
      Returns the value of the configured record component.
      Returns:
      the value of the configured record component
    • ready

      public boolean ready()
      Returns the value of the ready record component.
      Returns:
      the value of the ready record component
    • shutdown

      public boolean shutdown()
      Returns the value of the shutdown record component.
      Returns:
      the value of the shutdown record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • nextUpdate

      public Instant nextUpdate()
      Returns the value of the nextUpdate record component.
      Returns:
      the value of the nextUpdate record component
    • lastUpdateMonth

      public YearMonth lastUpdateMonth()
      Returns the value of the lastUpdateMonth record component.
      Returns:
      the value of the lastUpdateMonth record component
    • ipv4Date

      public LocalDate ipv4Date()
      Returns the value of the ipv4Date record component.
      Returns:
      the value of the ipv4Date record component
    • ipv6Date

      public LocalDate ipv6Date()
      Returns the value of the ipv6Date record component.
      Returns:
      the value of the ipv6Date record component
    • initFailures

      public int initFailures()
      Returns the value of the initFailures record component.
      Returns:
      the value of the initFailures record component
    • lookupErrors

      public int lookupErrors()
      Returns the value of the lookupErrors record component.
      Returns:
      the value of the lookupErrors record component
    • downloadFailures

      public int downloadFailures()
      Returns the value of the downloadFailures record component.
      Returns:
      the value of the downloadFailures record component
    • recoveryAttempts

      public int recoveryAttempts()
      Returns the value of the recoveryAttempts record component.
      Returns:
      the value of the recoveryAttempts record component
    • maxRecoveryAttempts

      public int maxRecoveryAttempts()
      Returns the value of the maxRecoveryAttempts record component.
      Returns:
      the value of the maxRecoveryAttempts record component
    • recoveryRecommended

      public boolean recoveryRecommended()
      Returns the value of the recoveryRecommended record component.
      Returns:
      the value of the recoveryRecommended record component
    • recoveryReason

      public String recoveryReason()
      Returns the value of the recoveryReason record component.
      Returns:
      the value of the recoveryReason record component
    • recoveryInProgress

      public boolean recoveryInProgress()
      Returns the value of the recoveryInProgress record component.
      Returns:
      the value of the recoveryInProgress record component
    • lastDownloadError

      public String lastDownloadError()
      Returns the value of the lastDownloadError record component.
      Returns:
      the value of the lastDownloadError record component