Qpid C++ API Reference
Generated on Thu Apr 14 2011 18:21:10 for Qpid C++ Client API by doxygen 1.7.3
Public Member Functions | Protected Types | Protected Attributes

qmf::AgentSession Class Reference

#include <qmf/AgentSession.h>

List of all members.

Public Member Functions

 AgentSession (AgentSessionImpl *impl=0)
 AgentSession (const AgentSession &)
AgentSessionoperator= (const AgentSession &)
 ~AgentSession ()
 AgentSession (qpid::messaging::Connection &, const std::string &options="")
 AgentSession A session that runs over an AMQP connection for QMF agent operation.
void setDomain (const std::string &)
 setDomain - Change the QMF domain that this agent will operate in.
void setVendor (const std::string &)
 Set identifying attributes of this agent.
void setProduct (const std::string &)
void setInstance (const std::string &)
void setAttribute (const std::string &, const qpid::types::Variant &)
 setAttribute - Set an arbitrary attribute for this agent.
const std::string & getName () const
 Get the identifying name of the agent.
void open ()
 Open the agent session.
void close ()
 Close the session.
bool nextEvent (AgentEvent &, qpid::messaging::Duration timeout=qpid::messaging::Duration::FOREVER)
 Get the next event from the agent session.
void registerSchema (Schema &)
 Register a schema to be exposed by this agent.
DataAddr addData (Data &, const std::string &name="", bool persistent=false)
 Add data to be managed internally by the agent.
void delData (const DataAddr &)
 Delete data from internal agent management.
void authAccept (AgentEvent &)
 The following methods are used to respond to events received in nextEvent.
void authReject (AgentEvent &, const std::string &diag="")
void raiseException (AgentEvent &, const std::string &)
void raiseException (AgentEvent &, const Data &)
void response (AgentEvent &, const Data &)
void complete (AgentEvent &)
void methodSuccess (AgentEvent &)
void raiseEvent (const Data &data)
 Raise an event to be sent into the QMF network.
void raiseEvent (const Data &data, int severity)
bool isValid () const
bool isNull () const
 operator bool () const
 Conversion to bool supports idiom if (handle) { handle->...
bool operator! () const
 Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.
void swap (Handle< AgentSessionImpl > &h)

Protected Types

typedef AgentSessionImpl Impl

Protected Attributes

Implimpl

Detailed Description

Definition at line 43 of file AgentSession.h.


Member Typedef Documentation

typedef AgentSessionImpl qmf::Handle< AgentSessionImpl >::Impl [protected, inherited]

Definition at line 56 of file Handle.h.


Constructor & Destructor Documentation

qmf::AgentSession::AgentSession ( AgentSessionImpl *  impl = 0)
qmf::AgentSession::AgentSession ( const AgentSession )
qmf::AgentSession::~AgentSession ( )
qmf::AgentSession::AgentSession ( qpid::messaging::Connection ,
const std::string &  options = "" 
)

AgentSession A session that runs over an AMQP connection for QMF agent operation.

Parameters:
connection- An opened qpid::messaging::Connection
options- An optional string containing options

The options string is of the form "{key:value,key:value}". The following keys are supported:

interval:N - Heartbeat interval in seconds [default: 60] external:{True,False} - Use external data storage (queries and subscriptions are pass-through) [default: False] allow-queries:{True,False} - If True: automatically allow all queries [default] If False: generate an AUTH_QUERY event to allow per-query authorization allow-methods:{True,False} - If True: automatically allow all methods [default] If False: generate an AUTH_METHOD event to allow per-method authorization max-subscriptions:N - Maximum number of concurrent subscription queries permitted [default: 64] min-sub-interval:N - Minimum publish interval (in milliseconds) permitted for a subscription [default: 3000] sub-lifetime:N - Lifetime (in seconds with no keepalive) for a subscription [default: 300] public-events:{True,False} - If True: QMF events are sent to the topic exchange [default] If False: QMF events are only sent to authorized subscribers listen-on-direct:{True,False} - If True: Listen on legacy direct-exchange address for backward compatibility [default] If False: Listen only on the routable direct address strict-security:{True,False} - If True: Cooperate with the broker to enforce strict access control to the network

  • If False: Operate more flexibly with regard to use of messaging facilities [default]

Member Function Documentation

DataAddr qmf::AgentSession::addData ( Data ,
const std::string &  name = "",
bool  persistent = false 
)

Add data to be managed internally by the agent.

If the option external:True is selected, this call should not be used.

Parameters:
data- The data object being managed by the agent.
name- A name unique to this object to be used to address the object. If left default, a unique name will be assigned by the agent.
persistent- Set this to true if the data object is to be considered persistent across different sessions. If persistent, it is the agent application's responsibility to ensure the name is the same each time it is added.
void qmf::AgentSession::authAccept ( AgentEvent )

The following methods are used to respond to events received in nextEvent.

authAccept - Accept an authorization request. authReject - Reject/forbid an authorization request. raiseException - indicate failure of an operation (i.e. query or method call). response - Provide data in response to a query (only for option: external:True) complete - Indicate that the response to a query is complete (external:True only) methodSuccess - Indicate the successful completion of a method call.

void qmf::AgentSession::authReject ( AgentEvent ,
const std::string &  diag = "" 
)
void qmf::AgentSession::close ( )

Close the session.

Once closed, the session no longer communicates on the messaging network.

void qmf::AgentSession::complete ( AgentEvent )
void qmf::AgentSession::delData ( const DataAddr )

Delete data from internal agent management.

const std::string& qmf::AgentSession::getName ( ) const

Get the identifying name of the agent.

bool qmf::Handle< AgentSessionImpl >::isNull ( ) const [inline, inherited]
Returns:
true if handle is null. It is an error to call any function on a null handle.

Definition at line 45 of file Handle.h.

bool qmf::Handle< AgentSessionImpl >::isValid ( ) const [inline, inherited]
Returns:
true if handle is valid, i.e. not null.

Definition at line 42 of file Handle.h.

void qmf::AgentSession::methodSuccess ( AgentEvent )
bool qmf::AgentSession::nextEvent ( AgentEvent ,
qpid::messaging::Duration  timeout = qpid::messaging::Duration::FOREVER 
)

Get the next event from the agent session.

Events represent actions that must be acted upon by the agent application. This method blocks for up to the timeout if there are no events to be handled. This method will typically be the focus of the agent application's main execution loop.

void qmf::AgentSession::open ( )

Open the agent session.

After opening the session, the domain, identifying strings, and attributes cannot be changed.

qmf::Handle< AgentSessionImpl >::operator bool ( ) const [inline, inherited]

Conversion to bool supports idiom if (handle) { handle->...

}

Definition at line 48 of file Handle.h.

bool qmf::Handle< AgentSessionImpl >::operator! ( ) const [inline, inherited]

Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.

Definition at line 51 of file Handle.h.

AgentSession& qmf::AgentSession::operator= ( const AgentSession )
void qmf::AgentSession::raiseEvent ( const Data data,
int  severity 
)
void qmf::AgentSession::raiseEvent ( const Data data)

Raise an event to be sent into the QMF network.

Parameters:
data- A data object that contains the event contents.
severity- Explicit severity (from qmf/SchemaTypes.h). If omitted, the severity is set to the default severity for the data's schema. If the data has no schema, the severity defaults to SEV_NOTICE.
void qmf::AgentSession::raiseException ( AgentEvent ,
const std::string &   
)
void qmf::AgentSession::raiseException ( AgentEvent ,
const Data  
)
void qmf::AgentSession::registerSchema ( Schema )

Register a schema to be exposed by this agent.

void qmf::AgentSession::response ( AgentEvent ,
const Data  
)
void qmf::AgentSession::setAttribute ( const std::string &  ,
const qpid::types::Variant  
)

setAttribute - Set an arbitrary attribute for this agent.

The attributes are not used to uniquely identify the agent but can be used as a search criteria when looking for agents. This must be called prior to opening the agent session.

void qmf::AgentSession::setDomain ( const std::string &  )

setDomain - Change the QMF domain that this agent will operate in.

If this is not called, the domain will be "default". Agents in a domain can be seen only by consoles in the same domain. This must be called prior to opening the agent session.

void qmf::AgentSession::setInstance ( const std::string &  )
void qmf::AgentSession::setProduct ( const std::string &  )
void qmf::AgentSession::setVendor ( const std::string &  )

Set identifying attributes of this agent.

setVendor - Set the vendor string setProduct - Set the product name string setInstance - Set the unique instance name (if not set, a UUID will be assigned) These must be called prior to opening the agent session.

void qmf::Handle< AgentSessionImpl >::swap ( Handle< AgentSessionImpl > &  h) [inline, inherited]

Definition at line 53 of file Handle.h.


Member Data Documentation

Impl* qmf::Handle< AgentSessionImpl >::impl [protected, inherited]

Definition at line 63 of file Handle.h.


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

Qpid C++ API Reference
Generated on Thu Apr 14 2011 18:21:10 for Qpid C++ Client API by doxygen 1.7.3