Record Class LicenseCounter.Status

java.lang.Object
java.lang.Record
com.iizix.server.user.LicenseCounter.Status
Record Components:
reply - The licence system's validation, null when the server has no license system.
users - The users counted now.
maxUsers - The document's maxUsers, -1 for no limit.
ceiling - The ceiling, -1 for no limit.
graceUntil - The end of the running grace episode, 0 for none.
refuseFrom - When new sign-ins of an unlicensed server are to be refused, 0 while licensed.
refusing - true when a new user's sign-in now would be refused (ServerAdmin excepted).
enforcing - true when the enforcement switch is on.
Enclosing class:
LicenseCounter

public static record LicenseCounter.Status(ValidateReply reply, int users, int maxUsers, int ceiling, long graceUntil, long refuseFrom, boolean refusing, boolean enforcing) extends Record
What ServerAdmin shows (T1-154): the licence state, the users against maxUsers, the grace and what a new sign-in would meet now.
Author:
Christopher Mindus
  • Constructor Details

    • Status

      public Status(ValidateReply reply, int users, int maxUsers, int ceiling, long graceUntil, long refuseFrom, boolean refusing, boolean enforcing)
      Creates an instance of a Status record class.
      Parameters:
      reply - the value for the reply record component
      users - the value for the users record component
      maxUsers - the value for the maxUsers record component
      ceiling - the value for the ceiling record component
      graceUntil - the value for the graceUntil record component
      refuseFrom - the value for the refuseFrom record component
      refusing - the value for the refusing record component
      enforcing - the value for the enforcing record component
  • Method Details

    • isOverLimit

      public boolean isOverLimit()
      Tells whether more users are counted than the licence allows.
      Returns:
      true when over maxUsers.
    • 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.
    • reply

      public ValidateReply reply()
      Returns the value of the reply record component.
      Returns:
      the value of the reply record component
    • users

      public int users()
      Returns the value of the users record component.
      Returns:
      the value of the users record component
    • maxUsers

      public int maxUsers()
      Returns the value of the maxUsers record component.
      Returns:
      the value of the maxUsers record component
    • ceiling

      public int ceiling()
      Returns the value of the ceiling record component.
      Returns:
      the value of the ceiling record component
    • graceUntil

      public long graceUntil()
      Returns the value of the graceUntil record component.
      Returns:
      the value of the graceUntil record component
    • refuseFrom

      public long refuseFrom()
      Returns the value of the refuseFrom record component.
      Returns:
      the value of the refuseFrom record component
    • refusing

      public boolean refusing()
      Returns the value of the refusing record component.
      Returns:
      the value of the refusing record component
    • enforcing

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