qmf::ConsoleSession Class Reference

Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Types | Protected Attributes
qmf::ConsoleSession Class Reference

`#include <qmf/ConsoleSession.h>`

List of all members.

## Public Member Functions
| ConsoleSession (ConsoleSessionImpl *impl=0)
| ConsoleSession (const ConsoleSession &)
ConsoleSession & | operator= (const ConsoleSession &)
| ~ConsoleSession ()
| ConsoleSession (qpid::messaging::Connection &conn, const std::string &options="")
| ConsoleSession A session that runs over an AMQP connection for QMF console operation.
void | setDomain (const std::string &domain)
| setDomain - Change the QMF domain that this console will operate in.
void | setAgentFilter (const std::string &filter)
void | open ()
| Open the console session.
void | close ()
| Close the session.
bool | nextEvent (ConsoleEvent &outEvent, qpid::messaging::Duration timeout=qpid::messaging::Duration::FOREVER)
| Get the next event from the console session.
int | pendingEvents () const
| Return the number of events pending for nextEvent.
uint32_t | getAgentCount () const
| getAgentCount, getAgent - Retrieve the set of agents that match the console session's agent filter.
Agent | getAgent (uint32_t agentIndex) const
Agent | getConnectedBrokerAgent () const
| Get the agent for the connected broker (i.e.
Subscription | subscribe (const Query &query, const std::string &agentFilter="", const std::string &options="")
| Create a subscription that involves a subset of the known agents.
Subscription | subscribe (const std::string &query, const std::string &agentFilter="", const std::string &options="")
QMF_INLINE_EXTERN bool | isValid () const
QMF_INLINE_EXTERN bool | isNull () const
QMF_INLINE_EXTERN | operator bool () const
| Conversion to bool supports idiom if (handle) { handle->...
QMF_INLINE_EXTERN bool | operator! () const
| Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.
void | swap (Handle< T > &h)
## Protected Types
typedef T | Impl
## Protected Attributes
Impl * | impl

## Member Typedef Documentation

typedef T qmf::Handle::Impl`[protected, inherited]`

Definition at line 56 of file Handle.h.

## Constructor & Destructor Documentation

qmf::ConsoleSession::ConsoleSession | ( | ConsoleSessionImpl * | impl = `0` | ) |

qmf::ConsoleSession::ConsoleSession | ( | const ConsoleSession & |  | ) |

qmf::ConsoleSession::~ConsoleSession | ( |  | ) |

qmf::ConsoleSession::ConsoleSession | ( | qpid::messaging::Connection & | conn,
|  | const std::string & | options = `""`
| ) |  |

ConsoleSession A session that runs over an AMQP connection for QMF console 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:

domain:NAME - QMF Domain to join [default: "default"] max-agent-age:N - Maximum time, in minutes, that we will tolerate not hearing from an agent before deleting it [default: 5] 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] max-thread-wait-time:N - Time (in seconds) the session thread will wait for messages from the network between periodic background processing passes. Must not be greater than 60. Larger numbers will cause fewer wake-ups but will increase the time it takes to shut down the process. [default: 5]

## Member Function Documentation

void qmf::ConsoleSession::close | ( |  | ) |

Close the session.

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

Agent qmf::ConsoleSession::getAgent | ( | uint32_t | agentIndex | ) | const

uint32_t qmf::ConsoleSession::getAgentCount | ( |  | ) | const

getAgentCount, getAgent - Retrieve the set of agents that match the console session's agent filter.

Agent qmf::ConsoleSession::getConnectedBrokerAgent | ( |  | ) | const

Get the agent for the connected broker (i.e.

the agent embedded in the broker to which we have a connection).

QMF_INLINE_EXTERN bool qmf::Handle::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.

QMF_INLINE_EXTERN bool qmf::Handle::isValid | ( |  | ) | const`[inline, inherited]`

Returns:
  true if handle is valid, i.e. not null.

Definition at line 42 of file Handle.h.

bool qmf::ConsoleSession::nextEvent | ( | ConsoleEvent & | outEvent,
|  | qpid::messaging::Duration | timeout = `qpid::messaging::Duration::FOREVER`
| ) |  |

Get the next event from the console session.

Events represent actions that must be acted upon by the console 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 console application's main execution loop. If the timeout is set to Duration::IMMEDIATE, the call will not block.

void qmf::ConsoleSession::open | ( |  | ) |

Open the console session.

After opening the session, the domain cannot be changed.

QMF_INLINE_EXTERN qmf::Handle::operator bool | ( |  | ) | const`[inline, inherited]`

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

}

Definition at line 48 of file Handle.h.

QMF_INLINE_EXTERN bool qmf::Handle::operator! | ( |  | ) | const`[inline, inherited]`

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

Definition at line 51 of file Handle.h.

ConsoleSession& qmf::ConsoleSession::operator= | ( | const ConsoleSession & |  | ) |

int qmf::ConsoleSession::pendingEvents | ( |  | ) | const

Return the number of events pending for nextEvent.

This method will never block.

void qmf::ConsoleSession::setAgentFilter | ( | const std::string & | filter | ) |

void qmf::ConsoleSession::setDomain | ( | const std::string & | domain | ) |

setDomain - Change the QMF domain that this console 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 console session.

Subscription qmf::ConsoleSession::subscribe | ( | const Query & | query,
|  | const std::string & | agentFilter = `""`,
|  | const std::string & | options = `""`
| ) |  |

Create a subscription that involves a subset of the known agents.

The set of known agents is defined by the session's agent-filter (see setAgentFilter). The agentFilter argument to the subscribe method is used to further refine the set of agents. If agentFilter is the empty string (i.e. match-all) the subscription will involve all known agents. If agentFilter is non-empty, it will be applied only to the set of known agents. A subscription cannot be created that involves an agent not known by the session.

Subscription qmf::ConsoleSession::subscribe | ( | const std::string & | query,
|  | const std::string & | agentFilter = `""`,
|  | const std::string & | options = `""`
| ) |  |

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

Definition at line 53 of file Handle.h.

## Member Data Documentation

Impl* qmf::Handle::impl`[protected, inherited]`

Definition at line 63 of file Handle.h.

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

- qmf/ConsoleSession.h