~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/rabbitmq/rabbitmq_handler.h

  • Committer: Olaf van der Spek
  • Date: 2011-07-04 19:11:47 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110704191147-s99ojek811zi1fzj
Remove unused Name_resolution_context::error_reporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23
23
 */
24
24
 
25
 
#ifndef PLUGIN_RABBITMQ_RABBITMQ_HANDLER_H
26
 
#define PLUGIN_RABBITMQ_RABBITMQ_HANDLER_H
 
25
#pragma once
27
26
 
28
27
#include <exception>
29
28
#include <string>
67
66
  const std::string &username;
68
67
  const std::string &password;
69
68
  const std::string &virtualhost;
 
69
  const std::string &exchange;
 
70
  const std::string &routingKey;
 
71
  pthread_mutex_t publishLock;
70
72
public:
71
73
  /**
72
74
   * @brief
88
90
                  const in_port_t port, 
89
91
                  const std::string &username, 
90
92
                  const std::string &password, 
91
 
                  const std::string &virtualhost)
 
93
                  const std::string &virtualhost,
 
94
                  const std::string &exchange,
 
95
                  const std::string &routingKey)
92
96
    throw(rabbitmq_handler_exception);
93
97
 
94
98
  ~RabbitMQHandler();
102
106
   *
103
107
   * @param[in] message the message to send
104
108
   * @param[in] length the length of the message
105
 
   * @param[in] exchangeName name of the exchange to publish to
106
 
   * @param[in] routingKey the routing key to use
107
109
   * @throw exception if there is a problem publishing
108
110
   */
109
111
  void publish(void *message, 
110
 
               const int length, 
111
 
               const std::string &exchangeName, 
112
 
               const std::string &routingKey)
 
112
               const int length)
113
113
    throw(rabbitmq_handler_exception);
114
114
 
 
115
  void reconnect() throw(rabbitmq_handler_exception);
 
116
  void disconnect() throw(rabbitmq_handler_exception);
115
117
 
116
118
private:
117
119
  /**
127
129
   * @throw exception with the message unless the command was successful
128
130
   */
129
131
  void handleAMQPError(amqp_rpc_reply_t x, std::string context) throw(rabbitmq_handler_exception);
 
132
 
 
133
  void connect() throw(rabbitmq_handler_exception);
 
134
 
130
135
};
131
136
 
132
137
} /* namespace drizzle_plugin */
133
138
 
134
 
#endif /* PLUGIN_RABBITMQ_RABBITMQ_HANDLER_H */