qpid/console/Event.h Source File

Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

qpid/console/Event.h
Go to the documentation of this file.

    00001 /*
    00002  *
    00003  * Licensed to the Apache Software Foundation (ASF) under one
    00004  * or more contributor license agreements.  See the NOTICE file
    00005  * distributed with this work for additional information
    00006  * regarding copyright ownership.  The ASF licenses this file
    00007  * to you under the Apache License, Version 2.0 (the
    00008  * "License"); you may not use this file except in compliance
    00009  * with the License.  You may obtain a copy of the License at
    00010  *
    00011  *   http://www.apache.org/licenses/LICENSE-2.0
    00012  *
    00013  * Unless required by applicable law or agreed to in writing,
    00014  * software distributed under the License is distributed on an
    00015  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    00016  * KIND, either express or implied.  See the License for the
    00017  * specific language governing permissions and limitations
    00018  * under the License.
    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