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  virtual ManagementObject::shared_ptr GetManagementObject(void) const = 0;
59 
60  // Every "Manageable" object must implement ManagementMethod. This
61  // function is called when a remote management client invokes a method
62  // on this object. The input and output arguments are specific to the
63  // method being called and must be down-cast to the appropriate sub class
64  // before use.
65  virtual status_t ManagementMethod(uint32_t methodId, Args& args, std::string& text);
66 
67  // This optional method can be overridden to allow the agent application to
68  // authorize method invocations. Return true iff the authenticated user identified
69  // in userId us authorized to execute the method.
70  virtual bool AuthorizeMethod(uint32_t methodId, Args& args, const std::string& userId);
71 };
72 
73 inline Manageable::~Manageable(void) {}
74 
75 }}
76 
77 #endif

Qpid C++ API Reference
Generated on Tue Mar 26 2013 for Qpid C++ Client API by doxygen 1.8.3.1