Qpid Management Framework  0.24
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
qmf::engine::Agent Class Reference

#include <Agent.h>

Public Member Functions

 Agent (char *label, bool internalStore=true)
 
 ~Agent ()
 
void setStoreDir (const char *path)
 
void setTransferDir (const char *path)
 
void handleRcvMessage (Message &message)
 
bool getXmtMessage (Message &item) const
 
void popXmt ()
 
bool getEvent (AgentEvent &event) const
 
void popEvent ()
 
void newSession ()
 
void startProtocol ()
 
void heartbeat ()
 
void methodResponse (uint32_t sequence, uint32_t status, char *text, const Value &arguments)
 
void queryResponse (uint32_t sequence, Object &object, bool prop=true, bool stat=true)
 
void queryComplete (uint32_t sequence)
 
void registerClass (SchemaObjectClass *cls)
 
void registerClass (SchemaEventClass *cls)
 
const ObjectIdaddObject (Object &obj, uint64_t persistId)
 
const ObjectIdallocObjectId (uint64_t persistId)
 
const ObjectIdallocObjectId (uint32_t persistIdLo, uint32_t persistIdHi)
 
void raiseEvent (Event &event)
 

Detailed Description

Agent - Protocol engine for the QMF agent

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 ( SchemaObjectClass cls)

Register a schema class with the Agent.

Parameters
clsA SchemaObejctClass object that defines data managed by the agent.
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::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: