TPTP 4.4.0 Platform Project
Public API Specification

org.eclipse.tptp.platform.execution.client.core
Interface IAgentController


public interface IAgentController

This interface represents the Agent Controller running on the target machine(either local or remote machine). The Agent Controller, provides services to launch new processes, and attach to agents that coexist within processes. It also provides extensible agent architecture for control capabilities and data collection. It provides capabilities for performing operations as described in this interface. Agent hosted within the Agent Controller may communicate data back to monitoring clients (e.g. TPTP workbench). Multiple agent controllers can reside on a target host (will service different ports) and a client can connect to multiple agent controllers on the target host. This interface is the source for instantiating IAgent and IProcess objects.

Since:
tptp 4.0

Method Summary
 int addEventListener(java.lang.String interfaceID, ICommandHandler eventHandler)
          Add the Event Listener to listen to the events (specified by the interfaceID) from the Agent Controller
 boolean authenticateUser(User user)
           
 IProcess createProcess()
          Create the Process object to store process related information
 IProcess createProcess(java.lang.String executable)
          Create the Process and set the executable attirbute of the process object
 IProcess createProcess(java.lang.String executable, java.lang.String parameters)
          Create the Process and set the executable attirbute of the process object, and parameters
 void disconnect()
          Disconnect from Agent Controller
 IAgent getAgent(java.lang.String agentName, long processId)
          Retrieve an Agent instance that is bound to the input process id of the target process.
 IAgent getAgent(java.lang.String agentName, java.lang.String agentClassName)
          Retrieve an existing Agent instance, This method will create a new instance if there is no existing agent instance available
 IAgent getAgent(java.lang.String agentName, java.lang.String agentClassName, long processId)
          Retrieve an Agent instance.
 IAgent getAgent(java.lang.String agentName, java.lang.String agentClassName, TPTPAgentAccess accessMode)
          Retrieve an Agent instance.
 IAgent getAgent(java.lang.String agentName, TPTPAgentAccess accessMode)
          Retrieve an agent instance
 ConnectionInfo getConnectionInfo()
          Get the Connection Infomation - protocol, port number, secured connection info( for secured connection)
 IFileTransferManager getFileTransferManager()
          Returns instance of File Transfer Manager that provides file transfer services like Get File, Put File and Delete File
 long getNextContextId()
          Get the Next Context ID for sending commands
 INode getNode()
          Retrieve the instance of INode associated with the Agent Controller
 IProcess getProcess(long processId)
          Retrieve a specific Process on this Node
 java.util.Enumeration listAgents()
          Enumerate all the active agents on this node.
 java.util.Enumeration listProcesses()
          Enumerate all the active processes on this node.
 java.lang.String[] queryAvailableAgents()
          Retrieve the list of available agents on the Agent Controller.
 java.lang.String[] queryAvailableAgents(java.lang.String[] interfaceID)
           
 IAgent[] queryRunningAgents()
          Returns the list of running agents
 IAgent[] queryRunningAgents(java.lang.String[] interfaceID)
          Returns the list of running agents filtered by interface ID
 IAgent[] queryRunningAgents(java.lang.String agentName, java.lang.String[] interfaceID, long pid)
          Query Agent by a processid, agent name and interface id.
 void removeEventListener(java.lang.String interfaceID, ICommandHandler eventHandler)
          Remove the Event Listener - Stop listening to the events (specified by interfaceID)
 

Method Detail

getNode

public INode getNode()
Retrieve the instance of INode associated with the Agent Controller

Returns:
INode

getNextContextId

public long getNextContextId()
Get the Next Context ID for sending commands

Returns:
long

disconnect

public void disconnect()
Disconnect from Agent Controller

Returns:
long

getAgent

public IAgent getAgent(java.lang.String agentName,
                       java.lang.String agentClassName)
                throws NotConnectedException
Retrieve an existing Agent instance, This method will create a new instance if there is no existing agent instance available

Parameters:
agentName -
agentClassName -
Returns:
IAgent
Throws:
NotConnectedException

getAgent

public IAgent getAgent(java.lang.String agentName,
                       java.lang.String agentClassName,
                       TPTPAgentAccess accessMode)
                throws NotConnectedException
Retrieve an Agent instance.

Parameters:
agentName -
agentClassName -
accessMode - see TPTPAgentAccess
Returns:
IAgent
Throws:
NotConnectedException

getAgent

public IAgent getAgent(java.lang.String agentName,
                       long processId)
                throws NotConnectedException
Retrieve an Agent instance that is bound to the input process id of the target process.

Parameters:
agentName -
processId -
Returns:
IAgent
Throws:
NotConnectedException

getAgent

public IAgent getAgent(java.lang.String agentName,
                       java.lang.String agentClassName,
                       long processId)
                throws NotConnectedException
Retrieve an Agent instance.

Parameters:
agentName -
agentClassName -
processId -
Returns:
IAgent
Throws:
NotConnectedException

listProcesses

public java.util.Enumeration listProcesses()
                                    throws NotConnectedException
Enumerate all the active processes on this node.

Returns:
Enumeration
Throws:
NotConnectedException

listAgents

public java.util.Enumeration listAgents()
                                 throws NotConnectedException
Enumerate all the active agents on this node.

Returns:
Enumeration
Throws:
NotConnectedException

getProcess

public IProcess getProcess(long processId)
                    throws NotConnectedException
Retrieve a specific Process on this Node

Parameters:
processId -
Returns:
IProcess
Throws:
NotConnectedException

queryAvailableAgents

public java.lang.String[] queryAvailableAgents()
                                        throws NotConnectedException
Retrieve the list of available agents on the Agent Controller.

Returns:
Agent list
Throws:
NotConnectedException

queryAvailableAgents

public java.lang.String[] queryAvailableAgents(java.lang.String[] interfaceID)
                                        throws NotConnectedException
Parameters:
interfaceID -
Returns:
Agent list
Throws:
NotConnectedException

queryRunningAgents

public IAgent[] queryRunningAgents()
                            throws NotConnectedException
Returns the list of running agents

Returns:
list of running agents
Throws:
NotConnectedException

queryRunningAgents

public IAgent[] queryRunningAgents(java.lang.String[] interfaceID)
                            throws NotConnectedException
Returns the list of running agents filtered by interface ID

Returns:
list of running agents
Throws:
NotConnectedException

getFileTransferManager

public IFileTransferManager getFileTransferManager()
Returns instance of File Transfer Manager that provides file transfer services like Get File, Put File and Delete File

Returns:
IFileTransferManager

addEventListener

public int addEventListener(java.lang.String interfaceID,
                            ICommandHandler eventHandler)
Add the Event Listener to listen to the events (specified by the interfaceID) from the Agent Controller

Parameters:
interfaceID -
eventHandler -
Returns:
int

removeEventListener

public void removeEventListener(java.lang.String interfaceID,
                                ICommandHandler eventHandler)
Remove the Event Listener - Stop listening to the events (specified by interfaceID)

Parameters:
interfaceID -
eventHandler -

createProcess

public IProcess createProcess()
Create the Process object to store process related information

Returns:
IProcess

createProcess

public IProcess createProcess(java.lang.String executable)
Create the Process and set the executable attirbute of the process object

Parameters:
executable -

createProcess

public IProcess createProcess(java.lang.String executable,
                              java.lang.String parameters)
Create the Process and set the executable attirbute of the process object, and parameters

Parameters:
executable -
parameters -
Returns:
IProcess

getConnectionInfo

public ConnectionInfo getConnectionInfo()
Get the Connection Infomation - protocol, port number, secured connection info( for secured connection)


authenticateUser

public boolean authenticateUser(User user)
                         throws NotConnectedException
Throws:
NotConnectedException

getAgent

public IAgent getAgent(java.lang.String agentName,
                       TPTPAgentAccess accessMode)
                throws NotConnectedException
Retrieve an agent instance

Parameters:
agentName -
accessMode -
Returns:
IAgent
Throws:
NotConnectedException

queryRunningAgents

public IAgent[] queryRunningAgents(java.lang.String agentName,
                                   java.lang.String[] interfaceID,
                                   long pid)
                            throws NotConnectedException
Query Agent by a processid, agent name and interface id.

Parameters:
agentName -
pid -
Returns:
IAgent
Throws:
NotConnectedException

TPTP 4.4.0 Platform Project
Public API Specification