CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/EventFilter/StorageManager/interface/ConsumerUtils.h

Go to the documentation of this file.
00001 // $Id: ConsumerUtils.h,v 1.10 2011/08/22 14:20:16 mommsen Exp $
00003 
00004 #ifndef EventFilter_StorageManager_ConsumerUtils_h
00005 #define EventFilter_StorageManager_ConsumerUtils_h
00006 
00007 #include "EventFilter/StorageManager/interface/AlarmHandler.h"
00008 #include "EventFilter/StorageManager/interface/DQMEventConsumerRegistrationInfo.h"
00009 #include "EventFilter/StorageManager/interface/EnquingPolicyTag.h"
00010 #include "EventFilter/StorageManager/interface/EventConsumerRegistrationInfo.h"
00011 #include "EventFilter/StorageManager/interface/InitMsgCollection.h"
00012 #include "EventFilter/StorageManager/interface/RegistrationCollection.h"
00013 #include "EventFilter/StorageManager/interface/StatisticsReporter.h"
00014 #include "EventFilter/StorageManager/interface/Utils.h"
00015 
00016 #include "IOPool/Streamer/interface/DQMEventMessage.h"
00017 
00018 #include <boost/shared_ptr.hpp>
00019 
00020 namespace xgi
00021 {
00022   class Input;
00023   class Output;
00024 }
00025 
00026 namespace smproxy
00027 {
00028   class EventMsg;
00029 }
00030 
00031 namespace stor
00032 {
00033   class ConsumerID;
00034 
00035 
00044   template<typename Configuration_t, typename EventQueueCollection_t>
00045   class ConsumerUtils
00046   {
00047     
00048   public:
00049 
00050     ConsumerUtils
00051     (
00052       boost::shared_ptr<Configuration_t>,
00053       RegistrationCollectionPtr,
00054       RegistrationQueuePtr,
00055       InitMsgCollectionPtr,
00056       boost::shared_ptr<EventQueueCollection_t>,
00057       DQMEventQueueCollectionPtr,
00058       AlarmHandlerPtr
00059     );
00060 
00064     void processConsumerRegistrationRequest(xgi::Input*, xgi::Output*) const;
00065 
00069     void processConsumerHeaderRequest(xgi::Input*, xgi::Output*) const;
00070 
00074     void processConsumerEventRequest(xgi::Input*, xgi::Output*) const;
00075 
00079     void processDQMConsumerRegistrationRequest(xgi::Input*, xgi::Output*) const;
00080 
00084     void processDQMConsumerEventRequest(xgi::Input*, xgi::Output*) const;
00085 
00086 
00087   private:
00088 
00092     EventConsRegPtr createEventConsumerRegistrationInfo(xgi::Input*, xgi::Output*) const;
00093 
00097     EventConsRegPtr parseEventConsumerRegistration(xgi::Input*) const;
00098 
00102     bool createEventConsumerQueue(EventConsRegPtr) const;
00103 
00107     DQMEventConsRegPtr createDQMEventConsumerRegistrationInfo(xgi::Input*, xgi::Output*) const;
00108 
00112     DQMEventConsRegPtr parseDQMEventConsumerRegistration(xgi::Input*) const;
00113 
00117     bool createDQMEventConsumerQueue(DQMEventConsRegPtr) const;
00118 
00123     bool addRegistrationInfo(const RegPtr) const;
00124 
00128     void writeConsumerRegistration(xgi::Output*, const ConsumerID) const;
00129 
00133     void writeNotReady(xgi::Output*) const;
00134 
00138     void writeEmptyBuffer(xgi::Output*) const;
00139 
00143     void writeDone(xgi::Output*) const;
00144 
00148     void writeErrorString(xgi::Output*, const std::string) const;
00149 
00153     void writeHTTPHeaders(xgi::Output*) const;
00154 
00158     ConsumerID getConsumerId(xgi::Input*) const;
00159 
00163     void writeConsumerHeader(xgi::Output*, const InitMsgSharedPtr) const;
00164 
00168     void writeConsumerEvent(xgi::Output*, const stor::I2OChain&) const;
00169     void writeConsumerEvent(xgi::Output*, const smproxy::EventMsg&) const;
00170 
00174     void writeDQMConsumerEvent(xgi::Output*, const DQMEventMsgView&) const;
00175 
00176 
00177     boost::shared_ptr<Configuration_t> configuration_;
00178     RegistrationCollectionPtr registrationCollection_;
00179     RegistrationQueuePtr registrationQueue_;
00180     InitMsgCollectionPtr initMsgCollection_;
00181     boost::shared_ptr<EventQueueCollection_t> eventQueueCollection_;
00182     DQMEventQueueCollectionPtr dqmEventQueueCollection_;
00183     AlarmHandlerPtr alarmHandler_;
00184   };
00185 
00186 } // namespace stor
00187 
00188 #endif // EventFilter_StorageManager_ConsumerUtils_h
00189 
00190