Package com.tnsai.agents.hierarchy
Interface AgentHierarchyManager.HierarchyContext
- All Known Implementing Classes:
Agent,ConfigurableAgent
- Enclosing class:
AgentHierarchyManager
public static interface AgentHierarchyManager.HierarchyContext
Interface for accessing Agent internals needed for hierarchy management.
Implemented by Agent to provide controlled access to its state.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddChildDirect(Agent child) Adds a child directly to the internal list.findChildById(String childId) Finds a child by ID.Returns the agent's unique identifier.Returns the agent reference itself.Returns an unmodifiable snapshot of the children list.Returns the communication manager for inter-agent messaging.Returns the current parent agent.booleanChecks if the given agent is a child.booleanremoveChildDirect(Agent child) Removes a child directly from the internal list.voidsetParentRef(Agent parent) Sets the parent agent reference directly (no bidirectional updates).
-
Method Details
-
getAgentId
String getAgentId()Returns the agent's unique identifier. -
getAgentRef
Agent getAgentRef()Returns the agent reference itself. -
getParentRef
Agent getParentRef()Returns the current parent agent. -
setParentRef
Sets the parent agent reference directly (no bidirectional updates). -
getChildrenSnapshot
Returns an unmodifiable snapshot of the children list. -
hasChild
Checks if the given agent is a child. -
addChildDirect
Adds a child directly to the internal list.- Returns:
- true if added, false if already present
-
removeChildDirect
Removes a child directly from the internal list.- Returns:
- true if removed, false if not present
-
findChildById
Finds a child by ID.- Returns:
- the child agent or null if not found
-
getCommunicationManager
AgentCommunicationManager getCommunicationManager()Returns the communication manager for inter-agent messaging.
-