Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
Public Member Functions
qmf::engine::Agent Class Reference

Agent - Protocol engine for the QMF agent. More...

#include <qmf/engine/Agent.h>

List of all members.

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 ObjectIdaddObject (Object &obj, uint64_t persistId)
 Give an object to the Agent for storage and management.
const ObjectIdallocObjectId (uint64_t persistId)
 Allocate an object-id for an object that will be managed by the application.
const ObjectIdallocObjectId (uint32_t persistIdLo, uint32_t persistIdHi)
void raiseEvent (Event &event)
 Raise an event into the QMF network.

Detailed Description

Agent - Protocol engine for the QMF agent.

Definition at line 73 of file Agent.h.


Constructor & Destructor Documentation

qmf::engine::Agent::Agent ( char *  label,
bool  internalStore = true 
)
qmf::engine::Agent::~Agent ( )

Member Function Documentation

const ObjectId* qmf::engine::Agent::addObject ( Object obj,
uint64_t  persistId 
)

Give an object to the Agent for storage and management.

Once added, the agent takes responsibility for the life cycle of the object.

Parameters:
objThe object to be managed by the Agent.
persistIdA unique non-zero value if the object-id is to be persistent.
Returns:
The objectId of the managed object.
const ObjectId* qmf::engine::Agent::allocObjectId ( uint64_t  persistId)

Allocate an object-id for an object that will be managed by the application.

Parameters:
persistIdA unique non-zero value if the object-id is to be persistent.
Returns:
The objectId structure for the allocated ID.
const ObjectId* qmf::engine::Agent::allocObjectId ( uint32_t  persistIdLo,
uint32_t  persistIdHi 
)
bool qmf::engine::Agent::getEvent ( AgentEvent event) const

Get the next application event from the agent engine.

Parameters:
eventThe event iff the return value is true
Returns:
true if event is valid, false if there are no events to process
bool qmf::engine::Agent::getXmtMessage ( Message item) const

Get the next message to be sent to the AMQP network.

Parameters:
itemThe Message structure describing the message to be produced.
Returns:
true if the Message is valid, false if there are no messages to send.
void qmf::engine::Agent::handleRcvMessage ( Message message)

Pass messages received from the AMQP session to the Agent engine.

Parameters:
messageAMQP 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.

Parameters:
sequenceThe sequence number from the method request event.
statusThe method's completion status.
textStatus text ("OK" or an error message)
argumentsThe 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.

Parameters:
sequenceThe 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).

Parameters:
sequenceThe sequence number of the GET request or the SYNC_START request.
objectThe object (annotated with "changed" flags) for publication.
propIf true, changed object properties are transmitted.
statIf true, changed object statistics are transmitted.
void qmf::engine::Agent::raiseEvent ( Event event)

Raise an event into the QMF network.

Parameters:
eventThe event object for the event to be raised.
void qmf::engine::Agent::registerClass ( SchemaEventClass cls)

Register a schema class with the Agent.

Parameters:
clsA SchemaEventClass object that defines events sent by the agent.
void qmf::engine::Agent::registerClass ( SchemaObjectClass cls)

Register a schema class with the Agent.

Parameters:
clsA SchemaObejctClass object that defines data managed by the agent.
void qmf::engine::Agent::setStoreDir ( const char *  path)

Configure the directory path for storing persistent data.

Parameters:
pathNull-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.

Parameters:
pathNull-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 ( )

Start the QMF Agent protocol.

This should be invoked after a SETUP_COMPLETE event is received from the Agent engine.


The documentation for this class was generated from the following file:

Qpid C++ API Reference
Generated on Mon Aug 22 2011 for Qpid C++ Client API by doxygen 1.7.4