#include <IOPool/Streamer/interface/ConsRegMessage.h>
Public Member Functions | |
uint32 | code () const |
ConsRegRequestView (void *buf) | |
Constructor for the consumer registration request viewer. | |
std::string | getConsumerName () |
std::string | getConsumerPriority () |
std::string | getRequestParameterSet () |
uint32 | size () const |
uint8 * | startAddress () |
Private Attributes | |
uint8 * | buf_ |
std::string | consumerName_ |
std::string | consumerPriority_ |
HeaderView | head_ |
std::string | requestParameterSet_ |
Definition at line 37 of file ConsRegMessage.h.
ConsRegRequestView::ConsRegRequestView | ( | void * | buf | ) |
Constructor for the consumer registration request viewer.
Definition at line 74 of file ConsRegMessage.cc.
References buf_, code(), Header::CONS_REG_REQUEST, consumerName_, consumerPriority_, convert32(), Exception, len, and requestParameterSet_.
00074 : 00075 buf_((uint8*)buf),head_(buf) 00076 { 00077 uint8* bufPtr; 00078 uint32 len; 00079 00080 // verify that the buffer actually contains a registration request 00081 if (this->code() != Header::CONS_REG_REQUEST) 00082 { 00083 throw cms::Exception("MessageDecoding","ConsRegRequestView") 00084 << "Invalid consumer registration request message code (" 00085 << this->code() << "). Should be " << Header::CONS_REG_REQUEST << "\n"; 00086 } 00087 00088 // update the buffer pointer to just beyond the header 00089 bufPtr = buf_ + sizeof(Header); 00090 00091 // determine the consumer name 00092 len = convert32(bufPtr); 00093 bufPtr += sizeof(uint32); 00094 if (len >= 0) 00095 { 00096 if (len <= 256) 00097 { 00098 consumerName_.append((char *) bufPtr, len); 00099 } 00100 bufPtr += len; 00101 } 00102 00103 // determine the consumer priority 00104 len = convert32(bufPtr); 00105 bufPtr += sizeof(uint32); 00106 if (len >= 0) 00107 { 00108 if (len <= 64) 00109 { 00110 consumerPriority_.append((char *) bufPtr, len); 00111 } 00112 bufPtr += len; 00113 } 00114 00115 // determine the request parameter set (maintain backward compatibility 00116 // with sources of registration requests that don't have the param set) 00117 if (bufPtr < (buf_ + this->size())) 00118 { 00119 len = convert32(bufPtr); 00120 bufPtr += sizeof(uint32); 00121 if (len >= 0) 00122 { 00123 // what is a reasonable limit? This is just to prevent 00124 // a bogus, really large value from being used... 00125 if (len <= 65000) 00126 { 00127 requestParameterSet_.append((char *) bufPtr, len); 00128 } 00129 bufPtr += len; 00130 } 00131 } 00132 }
Definition at line 42 of file ConsRegMessage.h.
References HeaderView::code(), and head_.
Referenced by ConsRegRequestView().
std::string ConsRegRequestView::getConsumerName | ( | ) | [inline] |
Definition at line 46 of file ConsRegMessage.h.
References consumerName_.
Referenced by stor::SMProxyServer::consumerWebPage(), stor::StorageManager::consumerWebPage(), stor::StorageManager::DQMconsumerWebPage(), and stor::SMProxyServer::DQMconsumerWebPage().
00046 { return consumerName_; }
std::string ConsRegRequestView::getConsumerPriority | ( | ) | [inline] |
Definition at line 47 of file ConsRegMessage.h.
References consumerPriority_.
Referenced by stor::SMProxyServer::consumerWebPage(), stor::StorageManager::consumerWebPage(), stor::StorageManager::DQMconsumerWebPage(), and stor::SMProxyServer::DQMconsumerWebPage().
00047 { return consumerPriority_; }
std::string ConsRegRequestView::getRequestParameterSet | ( | ) | [inline] |
Definition at line 48 of file ConsRegMessage.h.
References requestParameterSet_.
Referenced by stor::SMProxyServer::consumerWebPage(), stor::StorageManager::consumerWebPage(), stor::StorageManager::DQMconsumerWebPage(), and stor::SMProxyServer::DQMconsumerWebPage().
00048 { return requestParameterSet_; }
uint8* ConsRegRequestView::startAddress | ( | ) | [inline] |
uint8* ConsRegRequestView::buf_ [private] |
Definition at line 51 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and startAddress().
std::string ConsRegRequestView::consumerName_ [private] |
Definition at line 53 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and getConsumerName().
std::string ConsRegRequestView::consumerPriority_ [private] |
Definition at line 54 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and getConsumerPriority().
HeaderView ConsRegRequestView::head_ [private] |
std::string ConsRegRequestView::requestParameterSet_ [private] |
Definition at line 55 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and getRequestParameterSet().