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 "ManagementObject.h" 00024 #include "Args.h" 00025 #include <string> 00026 00027 namespace qpid { 00028 namespace management { 00029 00030 class Manageable 00031 { 00032 public: 00033 00034 virtual ~Manageable(void) = 0; 00035 00036 // status_t is a type used to pass completion status from the method handler. 00037 // 00038 typedef uint32_t status_t; 00039 static std::string StatusText(status_t status, std::string text = std::string()); 00040 00041 static const status_t STATUS_OK = 0; 00042 static const status_t STATUS_UNKNOWN_OBJECT = 1; 00043 static const status_t STATUS_UNKNOWN_METHOD = 2; 00044 static const status_t STATUS_NOT_IMPLEMENTED = 3; 00045 static const status_t STATUS_INVALID_PARAMETER = 4; 00046 static const status_t STATUS_FEATURE_NOT_IMPLEMENTED = 5; 00047 static const status_t STATUS_FORBIDDEN = 6; 00048 static const status_t STATUS_EXCEPTION = 7; 00049 static const status_t STATUS_USER = 0x00010000; 00050 00051 // Every "Manageable" object must hold a reference to exactly one 00052 // management object. This object is always of a class derived from 00053 // the pure-virtual "ManagementObject". 00054 // 00055 // This accessor function returns a pointer to the management object. 00056 // 00057 virtual ManagementObject* GetManagementObject(void) const = 0; 00058 00059 // Every "Manageable" object must implement ManagementMethod. This 00060 // function is called when a remote management client invokes a method 00061 // on this object. The input and output arguments are specific to the 00062 // method being called and must be down-cast to the appropriate sub class 00063 // before use. 00064 virtual status_t ManagementMethod(uint32_t methodId, Args& args, std::string& text); 00065 }; 00066 00067 inline Manageable::~Manageable(void) {} 00068 00069 }} 00070 00071 #endif