Package io.jenkins.plugins.har.cli
Class HarnessCliLoginTracker
java.lang.Object
hudson.model.InvisibleAction
io.jenkins.plugins.har.cli.HarnessCliLoginTracker
- All Implemented Interfaces:
Action,ModelObject
Build action that records which agents have already run
hc auth login
for this build.
Auth state for the Harness CLI lives on each agent (e.g. ~/.harness/auth.json),
so login must be tracked per node — not once for the whole Run.
Also stores the binary path and workspace used on each agent so logout can run on every agent that logged in.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classLogin details captured for one agent. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanClaims the logout responsibility.booleanneedsLogin(String nodeName) voidrecordLogin(String hcBinaryPath, String workspacePath, String nodeName) Records a successful login on the given agent.Methods inherited from class hudson.model.InvisibleAction
getDisplayName, getIconFileName, getUrlName
-
Constructor Details
-
HarnessCliLoginTracker
public HarnessCliLoginTracker()
-
-
Method Details
-
needsLogin
- Returns:
trueif this agent has not yet logged in for this build
-
recordLogin
Records a successful login on the given agent. -
getSessions
- Returns:
- immutable snapshot of agents that logged in during this build
-
markLoggedOut
public boolean markLoggedOut()Claims the logout responsibility. Returnstrueexactly once; subsequent calls returnfalseso that neither the Disposer nor the RunListener runs logout twice on the same build.
-