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
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe state of the recovery indicator, in the NetPhantom page's order of precedence.Constructor Summary
ConstructorsConstructorDescriptionStatus(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 aStatusrecord class.Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theconfiguredrecord component.Returns the value of thedescriptionrecord component.intReturns the value of thedownloadFailuresrecord component.booleanReturns the value of theenabledSettingrecord component.final booleanIndicates whether some other object is "equal to" this one.Summarizes the last download error for the indicator, as the NetPhantom page did.Gets the state of the recovery indicator for the switch as the settings hold it.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.final inthashCode()Returns a hash code value for this object.intReturns the value of theinitFailuresrecord component.ipv4Date()Returns the value of theipv4Daterecord component.ipv6Date()Returns the value of theipv6Daterecord component.Returns the value of thelastDownloadErrorrecord component.Returns the value of thelastUpdateMonthrecord component.intReturns the value of thelookupErrorsrecord component.intReturns the value of themaxRecoveryAttemptsrecord component.Returns the value of thenextUpdaterecord component.booleanready()Returns the value of thereadyrecord component.intReturns the value of therecoveryAttemptsrecord component.booleanReturns the value of therecoveryInProgressrecord component.Returns the value of therecoveryReasonrecord component.booleanReturns the value of therecoveryRecommendedrecord component.booleanshutdown()Returns the value of theshutdownrecord component.final StringtoString()Returns a string representation of this record class.
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 aStatusrecord class.- Parameters:
enabledSetting- the value for theenabledSettingrecord componentconfigured- the value for theconfiguredrecord componentready- the value for thereadyrecord componentshutdown- the value for theshutdownrecord componentdescription- the value for thedescriptionrecord componentnextUpdate- the value for thenextUpdaterecord componentlastUpdateMonth- the value for thelastUpdateMonthrecord componentipv4Date- the value for theipv4Daterecord componentipv6Date- the value for theipv6Daterecord componentinitFailures- the value for theinitFailuresrecord componentlookupErrors- the value for thelookupErrorsrecord componentdownloadFailures- the value for thedownloadFailuresrecord componentrecoveryAttempts- the value for therecoveryAttemptsrecord componentmaxRecoveryAttempts- the value for themaxRecoveryAttemptsrecord componentrecoveryRecommended- the value for therecoveryRecommendedrecord componentrecoveryReason- the value for therecoveryReasonrecord componentrecoveryInProgress- the value for therecoveryInProgressrecord componentlastDownloadError- the value for thelastDownloadErrorrecord component
Method Details
getIndicator
Gets the state of the recovery indicator for the switch as the settings hold it.- Returns:
- The state.
getIndicator
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
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
hashCode
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes.enabledSetting
public boolean enabledSetting()Returns the value of theenabledSettingrecord component.- Returns:
- the value of the
enabledSettingrecord component
configured
public boolean configured()Returns the value of theconfiguredrecord component.- Returns:
- the value of the
configuredrecord component
ready
shutdown
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
nextUpdate
Returns the value of thenextUpdaterecord component.- Returns:
- the value of the
nextUpdaterecord component
lastUpdateMonth
Returns the value of thelastUpdateMonthrecord component.- Returns:
- the value of the
lastUpdateMonthrecord component
ipv4Date
ipv6Date
initFailures
public int initFailures()Returns the value of theinitFailuresrecord component.- Returns:
- the value of the
initFailuresrecord component
lookupErrors
public int lookupErrors()Returns the value of thelookupErrorsrecord component.- Returns:
- the value of the
lookupErrorsrecord component
downloadFailures
public int downloadFailures()Returns the value of thedownloadFailuresrecord component.- Returns:
- the value of the
downloadFailuresrecord component
recoveryAttempts
public int recoveryAttempts()Returns the value of therecoveryAttemptsrecord component.- Returns:
- the value of the
recoveryAttemptsrecord component
maxRecoveryAttempts
public int maxRecoveryAttempts()Returns the value of themaxRecoveryAttemptsrecord component.- Returns:
- the value of the
maxRecoveryAttemptsrecord component
recoveryRecommended
public boolean recoveryRecommended()Returns the value of therecoveryRecommendedrecord component.- Returns:
- the value of the
recoveryRecommendedrecord component
recoveryReason
Returns the value of therecoveryReasonrecord component.- Returns:
- the value of the
recoveryReasonrecord component
recoveryInProgress
public boolean recoveryInProgress()Returns the value of therecoveryInProgressrecord component.- Returns:
- the value of the
recoveryInProgressrecord component
lastDownloadError
Returns the value of thelastDownloadErrorrecord component.- Returns:
- the value of the
lastDownloadErrorrecord component