Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
Agent - Protocol engine for the QMF agent. More...
#include <qmf/engine/Agent.h>
Public Member Functions | |
Agent (char *label, bool internalStore=true) | |
~Agent () | |
void | setStoreDir (const char *path) |
Configure the directory path for storing persistent data. | |
void | setTransferDir (const char *path) |
Configure the directory path for files transferred over QMF. | |
void | handleRcvMessage (Message &message) |
Pass messages received from the AMQP session to the Agent engine. | |
bool | getXmtMessage (Message &item) const |
Get the next message to be sent to the AMQP network. | |
void | popXmt () |
Remove and discard one message from the head of the transmit queue. | |
bool | getEvent (AgentEvent &event) const |
Get the next application event from the agent engine. | |
void | popEvent () |
Remove and discard one event from the head of the event queue. | |
void | newSession () |
A new AMQP session has been established for Agent communication. | |
void | startProtocol () |
Start the QMF Agent protocol. | |
void | heartbeat () |
This method is called periodically so the agent can supply a heartbeat. | |
void | methodResponse (uint32_t sequence, uint32_t status, char *text, const Value &arguments) |
Respond to a method request. | |
void | queryResponse (uint32_t sequence, Object &object, bool prop=true, bool stat=true) |
Send a content indication to the QMF bus. | |
void | queryComplete (uint32_t sequence) |
Indicate the completion of a query. | |
void | registerClass (SchemaObjectClass *cls) |
Register a schema class with the Agent. | |
void | registerClass (SchemaEventClass *cls) |
Register a schema class with the Agent. | |
const ObjectId * | addObject (Object &obj, uint64_t persistId) |
Give an object to the Agent for storage and management. | |
const ObjectId * | allocObjectId (uint64_t persistId) |
Allocate an object-id for an object that will be managed by the application. | |
const ObjectId * | allocObjectId (uint32_t persistIdLo, uint32_t persistIdHi) |
void | raiseEvent (Event &event) |
Raise an event into the QMF network. |
Agent - Protocol engine for the QMF agent.
qmf::engine::Agent::Agent | ( | char * | label, |
bool | internalStore = true |
||
) |
qmf::engine::Agent::~Agent | ( | ) |
Give an object to the Agent for storage and management.
Once added, the agent takes responsibility for the life cycle of the object.
obj | The object to be managed by the Agent. |
persistId | A unique non-zero value if the object-id is to be persistent. |
const ObjectId* qmf::engine::Agent::allocObjectId | ( | uint64_t | persistId | ) |
Allocate an object-id for an object that will be managed by the application.
persistId | A unique non-zero value if the object-id is to be persistent. |
bool qmf::engine::Agent::getEvent | ( | AgentEvent & | event | ) | const |
Get the next application event from the agent engine.
event | The event iff the return value is true |
bool qmf::engine::Agent::getXmtMessage | ( | Message & | item | ) | const |
void qmf::engine::Agent::handleRcvMessage | ( | Message & | message | ) |
Pass messages received from the AMQP session to the Agent engine.
message | AMQP messages received on the agent session. |
void qmf::engine::Agent::heartbeat | ( | ) |
This method is called periodically so the agent can supply a heartbeat.
void qmf::engine::Agent::methodResponse | ( | uint32_t | sequence, |
uint32_t | status, | ||
char * | text, | ||
const Value & | arguments | ||
) |
Respond to a method request.
sequence | The sequence number from the method request event. |
status | The method's completion status. |
text | Status text ("OK" or an error message) |
arguments | The list of output arguments from the method call. |
void qmf::engine::Agent::newSession | ( | ) |
A new AMQP session has been established for Agent communication.
void qmf::engine::Agent::popEvent | ( | ) |
Remove and discard one event from the head of the event queue.
void qmf::engine::Agent::popXmt | ( | ) |
Remove and discard one message from the head of the transmit queue.
void qmf::engine::Agent::queryComplete | ( | uint32_t | sequence | ) |
Indicate the completion of a query.
This is not used for SYNC_START requests.
sequence | The sequence number of the GET request. |
void qmf::engine::Agent::queryResponse | ( | uint32_t | sequence, |
Object & | object, | ||
bool | prop = true , |
||
bool | stat = true |
||
) |
Send a content indication to the QMF bus.
This is only needed for objects that are managed by the application. This is *NOT* needed for objects managed by the Agent (inserted using addObject).
sequence | The sequence number of the GET request or the SYNC_START request. |
object | The object (annotated with "changed" flags) for publication. |
prop | If true, changed object properties are transmitted. |
stat | If true, changed object statistics are transmitted. |
void qmf::engine::Agent::raiseEvent | ( | Event & | event | ) |
Raise an event into the QMF network.
event | The event object for the event to be raised. |
void qmf::engine::Agent::registerClass | ( | SchemaObjectClass * | cls | ) |
Register a schema class with the Agent.
cls | A SchemaObejctClass object that defines data managed by the agent. |
void qmf::engine::Agent::registerClass | ( | SchemaEventClass * | cls | ) |
Register a schema class with the Agent.
cls | A SchemaEventClass object that defines events sent by the agent. |
void qmf::engine::Agent::setStoreDir | ( | const char * | path | ) |
Configure the directory path for storing persistent data.
path | Null-terminated string containing a directory path where files can be created, written, and read. If NULL, no persistent storage will be attempted. |
void qmf::engine::Agent::setTransferDir | ( | const char * | path | ) |
Configure the directory path for files transferred over QMF.
path | Null-terminated string containing a directory path where files can be created, deleted, written, and read. If NULL, file transfers shall not be permitted. |
void qmf::engine::Agent::startProtocol | ( | ) |