Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
qpid/management/Manageable.h
Go to the documentation of this file.
00001 #ifndef _Manageable_
00002 #define _Manageable_
00003 
00004 //
00005 // Licensed to the Apache Software Foundation (ASF) under one
00006 // or more contributor license agreements.  See the NOTICE file
00007 // distributed with this work for additional information
00008 // regarding copyright ownership.  The ASF licenses this file
00009 // to you under the Apache License, Version 2.0 (the
00010 // "License"); you may not use this file except in compliance
00011 // with the License.  You may obtain a copy of the License at
00012 //
00013 //   http://www.apache.org/licenses/LICENSE-2.0
00014 //
00015 // Unless required by applicable law or agreed to in writing,
00016 // software distributed under the License is distributed on an
00017 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00018 // KIND, either express or implied.  See the License for the
00019 // specific language governing permissions and limitations
00020 // under the License.
00021 //
00022 
00023 #include "qpid/management/ManagementObject.h"
00024 #include "qpid/management/Args.h"
00025 #include <string>
00026 #include "qpid/CommonImportExport.h"
00027 
00028 namespace qpid {
00029 namespace management {
00030 
00031 class QPID_COMMON_EXTERN Manageable
00032 {
00033   public:
00034 
00035     virtual ~Manageable(void) = 0;
00036 
00037     //  status_t is a type used to pass completion status from the method handler.
00038     //
00039     typedef uint32_t status_t;
00040     static std::string StatusText(status_t status, std::string text = std::string());
00041 
00042     static const status_t STATUS_OK                      = 0;
00043     static const status_t STATUS_UNKNOWN_OBJECT          = 1;
00044     static const status_t STATUS_UNKNOWN_METHOD          = 2;
00045     static const status_t STATUS_NOT_IMPLEMENTED         = 3;
00046     static const status_t STATUS_PARAMETER_INVALID       = 4;
00047     static const status_t STATUS_FEATURE_NOT_IMPLEMENTED = 5;
00048     static const status_t STATUS_FORBIDDEN               = 6;
00049     static const status_t STATUS_EXCEPTION               = 7;
00050     static const status_t STATUS_USER                    = 0x00010000;
00051 
00052     //  Every "Manageable" object must hold a reference to exactly one
00053     //  management object.  This object is always of a class derived from
00054     //  the pure-virtual "ManagementObject".
00055     //
00056     //  This accessor function returns a pointer to the management object.
00057     //
00058     virtual ManagementObject* GetManagementObject(void) const = 0;
00059 
00060     //  Every "Manageable" object must implement ManagementMethod.  This
00061     //  function is called when a remote management client invokes a method
00062     //  on this object.  The input and output arguments are specific to the
00063     //  method being called and must be down-cast to the appropriate sub class
00064     //  before use.
00065     virtual status_t ManagementMethod(uint32_t methodId, Args& args, std::string& text);
00066 
00067     //  This optional method can be overridden to allow the agent application to
00068     //  authorize method invocations.  Return true iff the authenticated user identified
00069     //  in userId us authorized to execute the method.
00070     virtual bool AuthorizeMethod(uint32_t methodId, Args& args, const std::string& userId);
00071 };
00072 
00073 inline Manageable::~Manageable(void) {}
00074 
00075 }}
00076 
00077 #endif  

Qpid C++ API Reference
Generated on Mon Aug 22 2011 for Qpid C++ Client API by doxygen 1.7.4