00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef SEMAINE_CMS_RECEIVER_BYTESRECEIVER_H
00011 #define SEMAINE_CMS_RECEIVER_BYTESRECEIVER_H
00012
00013 #include <semaine/config.h>
00014
00015 #include <cms/CMSException.h>
00016
00017 #include <semaine/cms/receiver/Receiver.h>
00018 #include <semaine/cms/exceptions/MessageFormatException.h>
00019 #include <semaine/cms/message/SEMAINEBytesMessage.h>
00020
00021
00022 using namespace cms;
00023 using namespace semaine::cms::exceptions;
00024 using namespace semaine::cms::message;
00025
00026 namespace semaine {
00027 namespace cms {
00028 namespace receiver {
00029
00035 class BytesReceiver : public Receiver
00036 {
00037 public:
00049 BytesReceiver(const std::string & topicName) throw(CMSException) :
00050 Receiver(topicName)
00051 {}
00052
00067 BytesReceiver(const std::string & topicName, const std::string & messageSelector)
00068 throw(CMSException) :
00069 Receiver(topicName, messageSelector)
00070 {}
00071
00080 BytesReceiver(const std::string & cmsUrl, const std::string & cmsUser, const std::string & cmsPassword,
00081 const std::string & topicName)
00082 throw (CMSException) :
00083 Receiver(cmsUrl, cmsUser, cmsPassword, topicName)
00084 {}
00085
00097 BytesReceiver(const std::string & cmsUrl, const std::string & cmsUser, const std::string & cmsPassword,
00098 const std::string & topicName, const std::string & messageSelector)
00099 throw (CMSException) :
00100 Receiver(cmsUrl, cmsUser, cmsPassword, topicName, messageSelector)
00101 {}
00102
00103
00104 protected:
00105 virtual SEMAINEMessage * createSEMAINEMessage(const Message * message)
00106 throw(MessageFormatException)
00107 {
00108 return new SEMAINEBytesMessage(message);
00109 }
00110
00111
00112
00113 };
00114
00115 }
00116 }
00117 }
00118
00119
00120 #endif
00121