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 #include <boost/shared_ptr.hpp> 00027 00028 namespace qpid { 00029 namespace management { 00030 00031 class 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); 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_INVALID_PARAMETER = 4; 00047 static const status_t STATUS_FEATURE_NOT_IMPLEMENTED = 5; 00048 00049 // Every "Manageable" object must hold a reference to exactly one 00050 // management object. This object is always of a class derived from 00051 // the pure-virtual "ManagementObject". 00052 // 00053 // This accessor function returns a shared_ptr to the management object. 00054 // 00055 virtual ManagementObject::shared_ptr GetManagementObject (void) const = 0; 00056 00057 // Every "Manageable" object must implement ManagementMethod. This 00058 // function is called when a remote management client invokes a method 00059 // on this object. The input and output arguments are specific to the 00060 // method being called and must be down-cast to the appropriate sub class 00061 // before use. 00062 virtual status_t ManagementMethod (uint32_t methodId, Args& args); 00063 }; 00064 00065 inline Manageable::~Manageable (void) {} 00066 00067 }} 00068 00069 #endif