Class AllowAllHubLicence

java.lang.Object
com.iizix.server.loadbalancer.AllowAllHubLicence
All Implemented Interfaces:
IHubLicence

public final class AllowAllHubLicence extends Object implements IHubLicence
The hub's licence until B-9 (HUB-DESIGN.md section 9.2, LICENSE-V2-DESIGN.md section 13): admits every member the interim cluster key authenticates, allows every sign-in, and COUNTS - the distinct users signed in per application, cluster-wide, so that B-9 inherits the numbers and replaces the verdicts.
Author:
Christopher Mindus
  • Constructor Details

    • AllowAllHubLicence

      public AllowAllHubLicence()
      Creates the stub without a server limit.
    • AllowAllHubLicence

      public AllowAllHubLicence(int maxServers)
      Creates the stub with a server limit, for a test of rule 5.
      Parameters:
      maxServers - The limit.
  • Method Details

    • verifyMember

      public MemberLicence verifyMember(String memberID, byte[] document, byte[] challenge, String run, byte[] signature)
      Not called before B-9: there is no document to verify. Answers null, refusing, so that a caller that reaches it by mistake admits nothing.
      Specified by:
      verifyMember in interface IHubLicence
      Parameters:
      memberID - The member ID the member claims.
      document - The member's licence document.
      challenge - The pn of this connection's CHALLENGE.
      run - The member's run UUID.
      signature - The signature.
      Returns:
      The member's licence, or null to refuse it.
    • getMaxServers

      public int getMaxServers()
      Description copied from interface: IHubLicence
      Gets the number of members the hub's entitlement allows (R-6, rule 5 of section 2.4).
      Specified by:
      getMaxServers in interface IHubLicence
      Returns:
      The count; Integer.MAX_VALUE for no limit.
    • onLogin

      public LoginVerdict onLogin(String memberID, long uid, String appID, boolean transfer)
      Description copied from interface: IHubLicence
      A successful sign-in, counted cluster-wide (section 9.1, B-7d's LOGIN event).
      Specified by:
      onLogin in interface IHubLicence
      Parameters:
      memberID - The member the user signed in on.
      uid - The user.
      appID - The application.
      transfer - true when the sign-in moves a client (section 7.6): a uid already counted answers ALLOW.
      Returns:
      The verdict.
    • onRelease

      public void onRelease(String memberID, long uid, String appID)
      Description copied from interface: IHubLicence
      The user's last AppSession of the application ended on the member (section 9.1).
      Specified by:
      onRelease in interface IHubLicence
      Parameters:
      memberID - The member.
      uid - The user.
      appID - The application.
    • getUserCount

      public int getUserCount(String appID)
      Gets the number of distinct users signed in to an application, as counted.
      Parameters:
      appID - The application.
      Returns:
      The count.