Class NodeIIAR
java.lang.Object
com.scivicslab.pojoactor.core.ActorRef<NodeInterpreter>
com.scivicslab.pojoactor.workflow.IIActorRef<NodeInterpreter>
com.scivicslab.actoriac.NodeIIAR
- All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName, AutoCloseable
Interpreter-interfaced actor reference for
NodeInterpreter instances.
This class provides a concrete implementation of IIActorRef
specifically for NodeInterpreter objects. It handles action invocations
by name, supporting both workflow execution actions (inherited from Interpreter)
and infrastructure actions (SSH command execution).
Supported actions:
Workflow actions (from Interpreter):
execCode- Executes the loaded workflow codereadYaml- Reads a YAML workflow definition from a file pathreadJson- Reads a JSON workflow definition from a file pathreadXml- Reads an XML workflow definition from a file pathreset- Resets the interpreter state
Infrastructure actions (Node-specific):
executeCommand- Executes a command and reports to accumulator (default)executeCommandQuiet- Executes a command without reportingexecuteSudoCommand- Executes sudo command and reports to accumulator (default)executeSudoCommandQuiet- Executes sudo command without reporting
- Author:
- devteam@scivicslab.com
-
Field Summary
FieldsFields inherited from class com.scivicslab.pojoactor.core.ActorRef
actorName, actorSystem, object -
Constructor Summary
ConstructorsConstructorDescriptionNodeIIAR(String actorName, NodeInterpreter object) Constructs a new NodeIIAR with the specified actor name and node interpreter object.NodeIIAR(String actorName, NodeInterpreter object, com.scivicslab.pojoactor.workflow.IIActorSystem system) Constructs a new NodeIIAR with the specified actor name, node interpreter object, and actor system. -
Method Summary
Modifier and TypeMethodDescriptioncom.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultbuildChangedDocuments(String args) com.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultcloneChangedDocuments(String args) private StringcombineOutput(Node.CommandResult result) Combines stdout and stderr into a single output string.private Node.OutputCallbackcreateOutputCallback(String nodeName) Creates an OutputCallback that forwards output to the multiplexer accumulator.com.scivicslab.pojoactor.core.ActionResultdeployChangedDocuments(String args) com.scivicslab.pojoactor.core.ActionResultdetectDocumentChanges(String args) com.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultexecuteCommand(String args) com.scivicslab.pojoactor.core.ActionResultexecuteCommandQuiet(String args) com.scivicslab.pojoactor.core.ActionResultexecuteSudoCommand(String args) com.scivicslab.pojoactor.core.ActionResultprivate StringExtracts a command string from JSON array arguments.private StringExtracts a meaningful error message from an ExecutionException.private com.scivicslab.pojoactor.core.ActionResultHandles exceptions and returns an appropriate ActionResult.private intparseMaxIterations(String arg, int defaultValue) com.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultOutputs JSON State at the given path in pretty JSON format via outputMultiplexer.com.scivicslab.pojoactor.core.ActionResultOutputs JSON State at the given path in YAML format via outputMultiplexer.com.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultprivate voidreportOutputToMultiplexer(String nodeName, String message) Reports a message to the multiplexer accumulator.private voidReports command result to the multiplexer accumulator actor if available.com.scivicslab.pojoactor.core.ActionResultcom.scivicslab.pojoactor.core.ActionResultrunUntilEnd(String args) com.scivicslab.pojoactor.core.ActionResultrunWorkflow(String args) private voidsendToMultiplexer(String formatted) Sends formatted output to the outputMultiplexer, line by line.com.scivicslab.pojoactor.core.ActionResultMethods inherited from class com.scivicslab.pojoactor.workflow.IIActorRef
callByActionName, hasAnnotatedAction, invokeAnnotatedAction, parseFirstArgumentMethods inherited from class com.scivicslab.pojoactor.core.ActorRef
ask, ask, askNow, clearJsonState, clearPendingMessages, close, createChild, expandVariables, getJsonBoolean, getJsonInt, getJsonString, getJsonString, getLastResult, getName, getNamesOfChildren, getParentName, hasJson, hasJsonState, initLogger, isAlive, json, putJson, setLastResult, setParentName, system, tell, tell, tellNow, toStringOfJson, toStringOfYaml
-
Field Details
-
logger
-
-
Constructor Details
-
NodeIIAR
Constructs a new NodeIIAR with the specified actor name and node interpreter object.- Parameters:
actorName- the name of this actorobject- theNodeInterpreterinstance managed by this actor reference
-
NodeIIAR
public NodeIIAR(String actorName, NodeInterpreter object, com.scivicslab.pojoactor.workflow.IIActorSystem system) Constructs a new NodeIIAR with the specified actor name, node interpreter object, and actor system.- Parameters:
actorName- the name of this actorobject- theNodeInterpreterinstance managed by this actor referencesystem- the actor system managing this actor
-
-
Method Details
-
execCode
-
readYaml
-
readJson
-
readXml
-
reset
-
runUntilEnd
-
call
-
runWorkflow
-
apply
-
executeCommand
-
executeCommandQuiet
-
executeSudoCommand
-
executeSudoCommandQuiet
-
sleep
-
print
-
doNothing
-
detectDocumentChanges
-
cloneChangedDocuments
-
buildChangedDocuments
-
deployChangedDocuments
-
printJson
-
printYaml
-
sendToMultiplexer
Sends formatted output to the outputMultiplexer, line by line. -
handleException
Handles exceptions and returns an appropriate ActionResult. -
parseMaxIterations
-
createOutputCallback
Creates an OutputCallback that forwards output to the multiplexer accumulator. -
reportToAccumulator
Reports command result to the multiplexer accumulator actor if available. -
reportOutputToMultiplexer
Reports a message to the multiplexer accumulator. -
combineOutput
Combines stdout and stderr into a single output string. -
extractRootCauseMessage
Extracts a meaningful error message from an ExecutionException. -
extractCommandFromArgs
Extracts a command string from JSON array arguments.
-