Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » how do I access data sent to an agent written in c++/java?
how do I access data sent to an agent written in c++/java? [message #97787] Fri, 04 May 2007 20:02 Go to next message
Natasha D'Silva is currently offline Natasha D'SilvaFriend
Messages: 25
Registered: July 2009
Junior Member
I am writing an agent using the new execution framework in Java and C++.
Using the examples, I get access to an agent and try to send it a command,
as follows:
agent.sendCommand("<some_command iid=\"\"><file>some more
text</file></dump>", handler);

When the agent recieves the command in its processCommand method,
The only information availalbe is the command name, i.e. "some_command"
Any additional data is not available via getCommandData()
In C++ it is a similar situation, I tried getting the data using the
parseCommand() function in TPTP utils, but I do not get back anything
In the example above, how do I get access to the <file> tag?
Any tips are appreciated.
Re: how do I access data sent to an agent written in c++/java? [message #98635 is a reply to message #97787] Tue, 15 May 2007 06:13 Go to previous message
Igor Alelekov is currently offline Igor AlelekovFriend
Messages: 139
Registered: July 2009
Senior Member
Hi Natasha,

You can transfer data to/from agents in two ways:
- Using control channel with custom commands (xml fragments).
- Using data channel - transparent binary channel, suitable for large data

Xml commands are parsed on arrival to CmdBlock command blocks.

To process custom commands you could:
- implement method processCommand(CmdBlock* cmd)
- let parent classes process their own commands by calling parent
- get command name via cmdBlock->getCommandName() method
- get command parameter list via cmdBlock->getParamList()
- get parameters values with getStringParam("parameter name", paramList,
&paramValue), getIntegerParam("parameter name", paramList, &paramValue)

and so on

You can find examples in FileTransferAgent/FileTransferAgent.cpp,
agentBase/BaseAgentImpl.cpp and agentBase/BaseCollectorImpl.cpp in
org.eclipse.tptp.platform.agentcontroller/src-native-new/src /agents

Example of processing paramList you can find in TPTPUtil.cpp

Previous Topic:NullPointerException when running more tests with tptp:execution ANT task
Next Topic:Datapool from standalone application
Goto Forum:

Current Time: Mon Aug 03 09:50:24 GMT 2020

Powered by FUDForum. Page generated in 0.01759 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top