Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
Manageable.h
Go to the documentation of this file.
1 #ifndef _Manageable_
2 #define _Manageable_
3 
4 //
5 // Licensed to the Apache Software Foundation (ASF) under one
6 // or more contributor license agreements. See the NOTICE file
7 // distributed with this work for additional information
8 // regarding copyright ownership. The ASF licenses this file
9 // to you under the Apache License, Version 2.0 (the
10 // "License"); you may not use this file except in compliance
11 // with the License. You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing,
16 // software distributed under the License is distributed on an
17 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 // KIND, either express or implied. See the License for the
19 // specific language governing permissions and limitations
20 // under the License.
21 //
22 
24 #include "qpid/management/Args.h"
25 #include <string>
27 
28 namespace qpid {
29 namespace management {
30 
32 {
33  public:
34 
35  virtual ~Manageable(void) = 0;
36 
37  // status_t is a type used to pass completion status from the method handler.
38  //
39  typedef uint32_t status_t;
40  static std::string StatusText(status_t status, std::string text = std::string());
41 
42  static const status_t STATUS_OK = 0;
43  static const status_t STATUS_UNKNOWN_OBJECT = 1;
44  static const status_t STATUS_UNKNOWN_METHOD = 2;
45  static const status_t STATUS_NOT_IMPLEMENTED = 3;
46  static const status_t STATUS_PARAMETER_INVALID = 4;
47  static const status_t STATUS_FEATURE_NOT_IMPLEMENTED = 5;
48  static const status_t STATUS_FORBIDDEN = 6;
49  static const status_t STATUS_EXCEPTION = 7;
50  static const status_t STATUS_USER = 0x00010000;
51 
52  // Every "Manageable" object must hold a reference to exactly one
53  // management object. This object is always of a class derived from
54  // the pure-virtual "ManagementObject".
55  //
56  // This accessor function returns a pointer to the management object.
57  //
58 #ifdef _IN_QPID_BROKER
59  virtual ManagementObject::shared_ptr GetManagementObject() const = 0;
60 #else
61  virtual ManagementObject* GetManagementObject() const = 0;
62 #endif
63 
64  // Every "Manageable" object must implement ManagementMethod. This
65  // function is called when a remote management client invokes a method
66  // on this object. The input and output arguments are specific to the
67  // method being called and must be down-cast to the appropriate sub class
68  // before use.
69  virtual status_t ManagementMethod(uint32_t methodId, Args& args, std::string& text);
70 
71  // This optional method can be overridden to allow the agent application to
72  // authorize method invocations. Return true iff the authenticated user identified
73  // in userId us authorized to execute the method.
74  virtual bool AuthorizeMethod(uint32_t methodId, Args& args, const std::string& userId);
75 };
76 
77 inline Manageable::~Manageable(void) {}
78 
79 }}
80 
81 #endif
#define QPID_COMMON_EXTERN
unsigned int uint32_t
Definition: IntegerTypes.h:27
virtual ~Manageable(void)=0
Definition: Manageable.h:77

Qpid C++ API Reference
Generated on Tue Aug 19 2014 for Qpid C++ Client API by doxygen 1.8.7