Record Class IServerLicenseSystem.CounterState
java.lang.Object
java.lang.Record
com.iizix.license.IServerLicenseSystem.CounterState
- Record Components:
graceEpisodeStart- When the last grace episode started, milliseconds since the epoch (wall-clock UTC, a local deadline, 2b.11), 0 for none (6.3).unlicensedSince- Since when the licence has not been valid, milliseconds since the epoch, 0 while it is valid (8.4, RB-9).pendingDays- The days not yet reported to the license server, oldest first (6.5).
- Enclosing interface:
IServerLicenseSystem
public static record IServerLicenseSystem.CounterState(long graceEpisodeStart, long unlicensedSince, List<IServerLicenseSystem.UsageDay> pendingDays) extends Record
The counting state an iiziServer keeps in its license file (
LICENSE-V2-DESIGN.md sections 6.3, 6.5 and 8.4): written by the server's licence counter (B-5d) and read back when the server starts again, so that a restart neither opens a second grace episode nor starts the 14 days of an unlicensed server again, and the days not yet reported are reported after a restart.- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IServerLicenseSystem.CounterStateNo state: nothing stored yet, or a server that keeps no license file.Constructor Summary
ConstructorsConstructorDescriptionCounterState(long graceEpisodeStart, long unlicensedSince, List<IServerLicenseSystem.UsageDay> pendingDays) Copies the days, so that a state cannot change after it is made.Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of thegraceEpisodeStartrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thependingDaysrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of theunlicensedSincerecord component.
Field Details
NONE
No state: nothing stored yet, or a server that keeps no license file.
Constructor Details
CounterState
public CounterState(long graceEpisodeStart, long unlicensedSince, List<IServerLicenseSystem.UsageDay> pendingDays) Copies the days, so that a state cannot change after it is made.- Throws:
NullPointerException- IfpendingDaysis null or holds null.
Method Details
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.graceEpisodeStart
public long graceEpisodeStart()Returns the value of thegraceEpisodeStartrecord component.- Returns:
- the value of the
graceEpisodeStartrecord component
unlicensedSince
public long unlicensedSince()Returns the value of theunlicensedSincerecord component.- Returns:
- the value of the
unlicensedSincerecord component
pendingDays
Returns the value of thependingDaysrecord component.- Returns:
- the value of the
pendingDaysrecord component