Apache Qpid C++ API
Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation

qmf/Agent.h

Go to the documentation of this file.
00001 #ifndef _QmfAgent_
00002 #define _QmfAgent_
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 "qmf/QmfImportExport.h"
00024 
00025 namespace qmf {
00026 
00027     class AgentImpl;
00028     class Connection;
00029     class ObjectId;
00030     class AgentObject;
00031     class Value;
00032     class Event;
00033     class SchemaObjectClass;
00034 
00041     class AgentListener {
00042         QMF_EXTERN virtual ~AgentListener();
00043 
00052         virtual bool allowQuery(const Query& q, const char* userId);
00053 
00065         virtual bool allowMethod(const char* name, const Value& args, const ObjectId& oid,
00066                                  const SchemaObjectClass& cls, const char* userId);
00067 
00081         virtual void query(uint32_t context, const Query& q, const char* userId);
00082 
00099         virtual void syncStart(uint32_t context, const Query& q, const char* userId);
00100 
00112         virtual void syncTouch(uint32_t context, const char* userId);
00113 
00124         virtual void syncStop(uint32_t context, const char* userId);
00125 
00141         virtual void methodCall(uint32_t context, const char* name, Value& args,
00142                                 const ObjectId& oid, const SchemaObjectClass& cls, const char* userId);
00143     };
00144 
00151     class Agent {
00152     public:
00171         QMF_EXTERN Agent(char* label="qmfa", bool internalStore=true, AgentListener* listener=0);
00172 
00176         QMF_EXTERN ~Agent();
00177 
00185         QMF_EXTERN void setStoreDir(const char* path);
00186 
00192         QMF_EXTERN void setConnection(Connection* conn);
00193 
00201         QMF_EXTERN void registerClass(SchemaObjectClass* cls);
00202         QMF_EXTERN void registerClass(SchemaEventClass* cls);
00203 
00218         QMF_EXTERN const ObjectId* addObject(AgentObject& obj, bool persistent=false, uint64_t oid=0);
00219         QMF_EXTERN const ObjectId* addObject(AgentObject& obj, bool persistent, uint32_t oidLo, uint32_t oidHi);
00220 
00233         QMF_EXTERN const ObjectId* allocObjectId(bool persistent=false, uint64_t oid=0);
00234         QMF_EXTERN const ObjectId* allocObjectId(bool persistent, uint32_t oidLo, uint32_t oidHi);
00235 
00241         QMF_EXTERN void raiseEvent(Event& event);
00242 
00254         QMF_EXTERN void queryResponse(uint32_t context, AgentObject& object, bool prop = true, bool stat = true);
00255 
00261         QMF_EXTERN void queryComplete(uint32_t context);
00262 
00278         QMF_EXTERN void methodResponse(uint32_t context, const Value& args, uint32_t status=0,
00279                                        const Value* exception=0);
00280 
00281     private:
00282         AgentImpl* impl;
00283     };
00284 
00285 }
00286 
00287 #endif

Qpid C++ API Reference
Generated on Fri Feb 18 12:26:54 2011 for Qpid C++ Client API by doxygen 1.4.7