00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _QPID_CONSOLE_EVENT_H_
00022 #define _QPID_CONSOLE_EVENT_H_
00023
00024 #include "qpid/console/ConsoleImportExport.h"
00025 #include "qpid/console/Object.h"
00026 #include "qpid/framing/Uuid.h"
00027 #include "qpid/framing/FieldTable.h"
00028
00029 namespace qpid {
00030 namespace framing {
00031 class Buffer;
00032 }
00033 namespace console {
00034
00035 class Broker;
00036 struct SchemaClass;
00037 class ClassKey;
00038
00043 class Event {
00044 public:
00045 typedef enum {
00046 SEV_EMERGENCY = 0, SEV_ALERT = 1, SEV_CRITICAL = 2, SEV_ERROR = 3,
00047 SEV_WARNING = 4, SEV_NOTICE = 5, SEV_INFO = 6, SEV_DEBUG = 7
00048 } Severity;
00049
00050 QPID_CONSOLE_EXTERN Event(Broker* broker,
00051 SchemaClass* schemaClass,
00052 framing::Buffer& buffer);
00053 Broker* getBroker() const { return broker; }
00054 QPID_CONSOLE_EXTERN const ClassKey& getClassKey() const;
00055 SchemaClass* getSchema() const { return schema; }
00056 const Object::AttributeMap& getAttributes() const { return attributes; }
00057 uint64_t getTimestamp() const { return timestamp; }
00058 uint8_t getSeverity() const { return severity; }
00059 QPID_CONSOLE_EXTERN std::string getSeverityString() const;
00060
00061 QPID_CONSOLE_EXTERN ObjectId attrRef(const std::string& key) const;
00062 QPID_CONSOLE_EXTERN uint32_t attrUint(const std::string& key) const;
00063 QPID_CONSOLE_EXTERN int32_t attrInt(const std::string& key) const;
00064 QPID_CONSOLE_EXTERN uint64_t attrUint64(const std::string& key) const;
00065 QPID_CONSOLE_EXTERN int64_t attrInt64(const std::string& key) const;
00066 QPID_CONSOLE_EXTERN std::string attrString(const std::string& key) const;
00067 QPID_CONSOLE_EXTERN bool attrBool(const std::string& key) const;
00068 QPID_CONSOLE_EXTERN float attrFloat(const std::string& key) const;
00069 QPID_CONSOLE_EXTERN double attrDouble(const std::string& key) const;
00070 QPID_CONSOLE_EXTERN framing::Uuid attrUuid(const std::string& key) const;
00071 QPID_CONSOLE_EXTERN framing::FieldTable attrMap(const std::string& key) const;
00072
00073 private:
00074 Broker* broker;
00075 SchemaClass* schema;
00076 uint64_t timestamp;
00077 Severity severity;
00078 Object::AttributeMap attributes;
00079 };
00080
00081 QPID_CONSOLE_EXTERN std::ostream& operator<<(std::ostream& o, const Event& event);
00082 }
00083 }
00084
00085
00086 #endif