Package com.ultikits.ultitools.utils
Class CloudSession.SessionAgentListener
java.lang.Object
com.ultikits.ultitools.utils.CloudSession.SessionAgentListener
- All Implemented Interfaces:
AgentConnection.Listener
- Enclosing class:
CloudSession
private final class CloudSession.SessionAgentListener
extends Object
implements AgentConnection.Listener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate AgentConnectionprivate booleanprivate booleanprivate booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidadoptRotation(String retiredId, String rotatedId) Re-points the credential a rejection of this connection deletes once acredential.rotateit carried is durable (called under this session's monitor byCloudSession.rotateCredential(java.lang.String, java.lang.String)).private booleanlive()voidonCredentialRejected(int code, String requestId) voidonOpened()The upgrade was accepted: a fresh protocol layer sendshello.voidonPlanLimited(UpgradeRejection notice) voidThewelcomenamed another server id; retrying stopped, credential kept.voidvoidToo many consecutive supersessions; retrying stopped, credential kept.voidHands the frame to the current protocol layer, outside the session monitor.voidonUpgradeRequired(String minFramework, String requestId) private StringThe bearer of the next attempt: the session's ownCloudSession.credential, the one owner of the current credential (plan 22-21 fix), so an attempt after a rotation authenticates with the rotated secret andattemptCredentialIdnames the credential this attempt really used.
-
Field Details
-
connection
-
attemptCredentialId
-
rejectionReported
private boolean rejectionReported -
upgradeReported
private boolean upgradeReported -
supersededReported
private boolean supersededReported -
mismatchReported
private boolean mismatchReported
-
-
Constructor Details
-
SessionAgentListener
private SessionAgentListener()
-
-
Method Details
-
live
private boolean live() -
adoptRotation
Re-points the credential a rejection of this connection deletes once acredential.rotateit carried is durable (called under this session's monitor byCloudSession.rotateCredential(java.lang.String, java.lang.String)). The gateway now knows this server by the rotated credential, so a later 4401 on this attempt rejects that one: deleting only the handshake-time id would find the rotated id on disk, skip the delete and leave a revoked credential that keepsstatus()linked and blocks/ulticloud login. An attempt id that is not the retired one (a newer credential saved meanwhile) is left as it is, so the compare-and-delete still never removes a credential this attempt did not hold.- Parameters:
retiredId- the id the rotation replacedrotatedId- the id now on disk and inCloudSession.credential
-
readBearer
The bearer of the next attempt: the session's ownCloudSession.credential, the one owner of the current credential (plan 22-21 fix), so an attempt after a rotation authenticates with the rotated secret andattemptCredentialIdnames the credential this attempt really used. -
onOpened
public void onOpened()The upgrade was accepted: a fresh protocol layer sendshello. The connection is established -- counters reset, heartbeat started, "connected" -- only when the protocol accepts the welcome (plan 22-20, D-12), not here.- Specified by:
onOpenedin interfaceAgentConnection.Listener
-
onCredentialRejected
- Specified by:
onCredentialRejectedin interfaceAgentConnection.Listener- Parameters:
code- 401 or 4401requestId- the refused response's request id
-
onUpgradeRequired
- Specified by:
onUpgradeRequiredin interfaceAgentConnection.Listener- Parameters:
minFramework- the minimum framework the gateway accepts, sanitisedrequestId- the refused response's request id
-
onSuperseded
public void onSuperseded()Description copied from interface:AgentConnection.ListenerToo many consecutive supersessions; retrying stopped, credential kept.- Specified by:
onSupersededin interfaceAgentConnection.Listener
-
onPlanLimited
- Specified by:
onPlanLimitedin interfaceAgentConnection.Listener- Parameters:
notice- the first 402 response of a plan-limit episode; once per episode
-
onServerIdMismatch
public void onServerIdMismatch()Description copied from interface:AgentConnection.ListenerThewelcomenamed another server id; retrying stopped, credential kept.- Specified by:
onServerIdMismatchin interfaceAgentConnection.Listener
-
onStateChanged
- Specified by:
onStateChangedin interfaceAgentConnection.Listener- Parameters:
state- the new state, once per real transition
-
onText
Hands the frame to the current protocol layer, outside the session monitor.- Specified by:
onTextin interfaceAgentConnection.Listener- Parameters:
text- an inbound text frame other than the heartbeat reply
-