AMPS C/C++ Client Class Reference
AMPS C/C++ Client Version 5.3.0.2
AMPS::Command Class Reference

Command is an encapsulation of a single AMPS command sent by the client. More...

#include <ampsplusplus.hpp>

Public Member Functions

 Command (const std::string &command_)
 Creates an object to represent the given AMPS command, such as "sow" or "subscribe". More...
 
 Command (Message::Command::Type command_)
 Creates an object to represent the given AMPS command, such as "sow" or "subscribe". More...
 
Commandreset (const std::string &command_)
 Resets the fields of self, and sets the command to command_. More...
 
Commandreset (Message::Command::Type command_)
 Resets the fields of self, and sets the command to command_. More...
 
CommandsetSowKey (const std::string &sowKey_)
 
CommandsetSowKeys (const std::string &sowKeys_)
 
CommandsetCommandId (const std::string &v_)
 
CommandsetTopic (const std::string &v_)
 
CommandsetFilter (const std::string &v_)
 
CommandsetOrderBy (const std::string &v_)
 
CommandsetSubId (const std::string &v_)
 
CommandsetBookmark (const std::string &v_)
 
CommandsetCorrelationId (const std::string &v_)
 
CommandsetOptions (const std::string &v_)
 
CommandsetData (const std::string &v_)
 
CommandsetData (const char *v_, size_t length_)
 
CommandsetTimeout (unsigned v_)
 
CommandsetTopN (unsigned v_)
 
CommandsetBatchSize (unsigned v_)
 
CommandsetExpiration (unsigned v_)
 
CommandaddAckType (const std::string &v_)
 

Detailed Description

Command is an encapsulation of a single AMPS command sent by the client.

Using Command you can build valid commands to be executed to process messages synchronously or asynchronously via the Client execute() and executeAsync() methods. Command is designed to be used as a "builder" enabling AMPS commands to be built easily, for example:


Client client(...);
for(Message m : client.execute(Command("sow").setTopic("topic"))) { ... }

Constructor & Destructor Documentation

AMPS::Command::Command ( const std::string &  command_)
inline

Creates an object to represent the given AMPS command, such as "sow" or "subscribe".

Parameters
command_The AMPS command to be created.
AMPS::Command::Command ( Message::Command::Type  command_)
inline

Creates an object to represent the given AMPS command, such as "sow" or "subscribe".

Parameters
command_The AMPS command to be created.

Member Function Documentation

Command& AMPS::Command::addAckType ( const std::string &  v_)
inline
Parameters
v_add an ack type to this command, such as "stats" or "completed". Additional acks are returned in the message stream.
Command& AMPS::Command::reset ( const std::string &  command_)
inline

Resets the fields of self, and sets the command to command_.

Parameters
command_The new AMPS command to be created.
Command& AMPS::Command::reset ( Message::Command::Type  command_)
inline

Resets the fields of self, and sets the command to command_.

Parameters
command_The new AMPS command to be created.
Command& AMPS::Command::setBatchSize ( unsigned  v_)
inline
Parameters
v_the batch size for this command. This value controls how many records are sent together in a SOW result set.
Command& AMPS::Command::setBookmark ( const std::string &  v_)
inline
Parameters
v_the bookmark for this command.
Command& AMPS::Command::setCommandId ( const std::string &  v_)
inline
Parameters
v_the command ID for this command. For relevant commands, one is generated for you if you do not supply one.
Command& AMPS::Command::setCorrelationId ( const std::string &  v_)
inline
Parameters
v_the correlation ID for this command.
Command& AMPS::Command::setData ( const std::string &  v_)
inline
Parameters
v_the data for this command.
Command& AMPS::Command::setData ( const char *  v_,
size_t  length_ 
)
inline
Parameters
v_the data for this command.
length_the length, in bytes, of your data (excluding any null-terminator)
Command& AMPS::Command::setExpiration ( unsigned  v_)
inline
Parameters
v_the expiration time for this command. For publishes, this controls how many seconds the message is retained on the server, if expirations are enabled.
Command& AMPS::Command::setFilter ( const std::string &  v_)
inline
Parameters
v_the filter for this command.
Command& AMPS::Command::setOptions ( const std::string &  v_)
inline
Parameters
v_the options string for this command.
Command& AMPS::Command::setOrderBy ( const std::string &  v_)
inline
Parameters
v_the order by clause for this command.
Command& AMPS::Command::setSowKey ( const std::string &  sowKey_)
inline
Parameters
sowKey_the SOWKey field of this command.
Command& AMPS::Command::setSowKeys ( const std::string &  sowKeys_)
inline
Parameters
sowKeys_the SOWKeys field of this command.
Command& AMPS::Command::setSubId ( const std::string &  v_)
inline
Parameters
v_the subscription ID for this command. For relevant commands, one is generated for you if you do not supply one.
Command& AMPS::Command::setTimeout ( unsigned  v_)
inline
Parameters
v_the timeout for this command. By default, this command will block until a "processed" ack is returned. 0 indicates no timeout.
Command& AMPS::Command::setTopic ( const std::string &  v_)
inline
Parameters
v_the topic for this command.
Command& AMPS::Command::setTopN ( unsigned  v_)
inline
Parameters
v_the "top N" field for this command. This value limits the number of records returned from a SOW query to the first N records.

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