public enum AsyncAgentController extends java.lang.Enum<AsyncAgentController>
Holder for Async agent processing
Modifier and Type | Class and Description |
---|---|
static class |
AsyncAgentController.AgentState
States that agent processing can be in
|
static class |
AsyncAgentController.AsyncAgentInfo
In-memory class for agent info
|
Enum Constant and Description |
---|
INSTANCE
Singleton to keep an eye on running agents
|
Modifier and Type | Field and Description |
---|---|
java.util.concurrent.atomic.AtomicBoolean |
isStarted
Track if the agent is started
|
java.util.concurrent.atomic.AtomicBoolean |
isStopping
Track if the agent has been asked to stop
|
Modifier and Type | Method and Description |
---|---|
void |
abortOne(java.lang.String uuid)
Allows a single agent to be cancelled
|
long |
count() |
static AsyncAgentController.AsyncAgentInfo |
createAsyncAgentInfoFromDoc(com.hcl.domino.data.Document doc) |
AsyncAgentController |
deregister(java.lang.String uuid)
Removes an AsyncAgentInfo object from the holder and the list of UUIDs aborted
|
void |
disposeQueued()
Removes any AsyncAgentInfo objects with state QUEUED.
|
void |
dump(java.io.PrintStream out,
boolean reportIfNothingHappened)
Outputs info of all AsyncAgentInfo objects held in memory Format for all AsyncAgentInfo objects: uuid, logDocUnid, state, username, runAsServer, dbPath, agentName, incoming, creation time
|
io.vertx.core.json.JsonArray |
dumpToJsonArray()
Outputs info of all AsyncAgentInfo objects held in memory as a JSON array
|
AsyncAgentController.AsyncAgentInfo |
getAgentInfoByKey(java.lang.String uuid)
Gets the AsyncAgentInfo object relating to a specific UUID
|
int |
getAgentRequestSize()
Gets the number of agents not yet disposed
|
boolean |
isCleared()
Checks if all AsyncAgentInfo objects have been disposed
|
boolean |
isOneAborted(java.lang.String uuid)
Check for whether a specific agent has been aborted
|
void |
register(AsyncAgentController.AsyncAgentInfo agentInfo) |
AsyncAgentController.AsyncAgentInfo |
register(java.lang.String uuid,
java.time.Instant startMoment,
java.lang.String logDocUnid,
java.lang.String dbPath,
java.lang.String agentName,
KeepUser user,
java.lang.Boolean runAsServer,
io.vertx.core.json.JsonObject payload)
Register an AsyncAgentInfo object into the holder
|
static AsyncAgentController |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static AsyncAgentController[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AsyncAgentController INSTANCE
public final java.util.concurrent.atomic.AtomicBoolean isStarted
Track if the agent is started
public final java.util.concurrent.atomic.AtomicBoolean isStopping
Track if the agent has been asked to stop
public static AsyncAgentController[] values()
for (AsyncAgentController c : AsyncAgentController.values()) System.out.println(c);
public static AsyncAgentController valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static AsyncAgentController.AsyncAgentInfo createAsyncAgentInfoFromDoc(com.hcl.domino.data.Document doc) throws KeepException
doc
- KeepException
public void abortOne(java.lang.String uuid)
Allows a single agent to be cancelled
uuid
- of the AsyncAgentInfo objectpublic long count()
public AsyncAgentController deregister(java.lang.String uuid)
Removes an AsyncAgentInfo object from the holder and the list of UUIDs aborted
uuid
- for the AsyncAgentInfo objectpublic void disposeQueued()
Removes any AsyncAgentInfo objects with state QUEUED. Used during shut-down to prevent starting of additional agents as we’re shutting down.
public void dump(java.io.PrintStream out, boolean reportIfNothingHappened)
Outputs info of all AsyncAgentInfo objects held in memory Format for all AsyncAgentInfo objects: uuid, logDocUnid, state, username, runAsServer, dbPath, agentName, incoming, creation time
out
- PrintStream to write toreportIfNothingHappened
- if true -> no output on empty agetndpublic io.vertx.core.json.JsonArray dumpToJsonArray()
Outputs info of all AsyncAgentInfo objects held in memory as a JSON array
public AsyncAgentController.AsyncAgentInfo getAgentInfoByKey(java.lang.String uuid)
Gets the AsyncAgentInfo object relating to a specific UUID
uuid
- of the AsyncAgentInfo objectpublic int getAgentRequestSize()
Gets the number of agents not yet disposed
public boolean isCleared()
Checks if all AsyncAgentInfo objects have been disposed
public boolean isOneAborted(java.lang.String uuid)
Check for whether a specific agent has been aborted
uuid
- of the AsyncAgentInfo objectpublic void register(AsyncAgentController.AsyncAgentInfo agentInfo)
agentInfo
- public AsyncAgentController.AsyncAgentInfo register(java.lang.String uuid, java.time.Instant startMoment, java.lang.String logDocUnid, java.lang.String dbPath, java.lang.String agentName, KeepUser user, java.lang.Boolean runAsServer, io.vertx.core.json.JsonObject payload)
Register an AsyncAgentInfo object into the holder
uuid
- passed in the messagesstartMoment
- Instant the object was constructedlogDocUnid
- for NotesDocument in AgentScheduler databasedbPath
- for the agent to runagentName
- to runuser
- the call was initiated byrunAsServer
- to override running as the user who initiated the callpayload
-