Class AllowAllHubLicence
java.lang.Object
com.iizix.server.loadbalancer.AllowAllHubLicence
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCreates the stub without a server limit.AllowAllHubLicence(int maxServers) Creates the stub with a server limit, for a test of rule 5.Method Summary
Modifier and TypeMethodDescriptionintGets the number of members the hub's entitlement allows (R-6, rule 5 of section 2.4).intgetUserCount(String appID) Gets the number of distinct users signed in to an application, as counted.A successful sign-in, counted cluster-wide (section 9.1, B-7d'sLOGINevent).voidThe user's last AppSession of the application ended on the member (section 9.1).verifyMember(String memberID, byte[] document, byte[] challenge, String run, byte[] signature) Not called before B-9: there is no document to verify.
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:
verifyMemberin interfaceIHubLicence- Parameters:
memberID- The member ID the member claims.document- The member's licence document.challenge- Thepnof this connection'sCHALLENGE.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:IHubLicenceGets the number of members the hub's entitlement allows (R-6, rule 5 of section 2.4).- Specified by:
getMaxServersin interfaceIHubLicence- Returns:
- The count;
Integer.MAX_VALUEfor no limit.
onLogin
Description copied from interface:IHubLicenceA successful sign-in, counted cluster-wide (section 9.1, B-7d'sLOGINevent).- Specified by:
onLoginin interfaceIHubLicence- 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): auidalready counted answersALLOW.- Returns:
- The verdict.
onRelease
Description copied from interface:IHubLicenceThe user's last AppSession of the application ended on the member (section 9.1).- Specified by:
onReleasein interfaceIHubLicence- Parameters:
memberID- The member.uid- The user.appID- The application.
getUserCount
Gets the number of distinct users signed in to an application, as counted.- Parameters:
appID- The application.- Returns:
- The count.