qmf/AgentSession.h Source File

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

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

qmf/AgentSession.h
Go to the documentation of this file.

    00001 #ifndef QMF_AGENT_SESSION_H
    00002 #define QMF_AGENT_SESSION_H
    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
    00024 #include <qmf/ImportExport.h>
    00025 #include "qmf/Handle.h"
    00026 #include "qpid/messaging/Duration.h"
    00027 #include "qpid/messaging/Connection.h"
    00028 #include "qpid/types/Variant.h"
    00029 #include <string>
    00030
    00031 namespace qmf {
    00032
    00033 #ifndef SWIG
    00034     template <class> class PrivateImplRef;
    00035 #endif
    00036
    00037     class AgentSessionImpl;
    00038     class AgentEvent;
    00039     class Schema;
    00040     class Data;
    00041     class DataAddr;
    00042
    00043     class QMF_CLASS_EXTERN AgentSession : public qmf::Handle<AgentSessionImpl> {
    00044     public:
    00045         QMF_EXTERN AgentSession(AgentSessionImpl* impl = 0);
    00046         QMF_EXTERN AgentSession(const AgentSession&);
    00047         QMF_EXTERN AgentSession& operator=(const AgentSession&);
    00048         QMF_EXTERN ~AgentSession();
    00049
    00080         QMF_EXTERN AgentSession(qpid::messaging::Connection& conn, const std::string& options="");
    00081
    00087         QMF_EXTERN void setDomain(const std::string& domain);
    00088
    00096         QMF_EXTERN void setVendor(const std::string& vendor);
    00097         QMF_EXTERN void setProduct(const std::string& product);
    00098         QMF_EXTERN void setInstance(const std::string& instance);
    00099
    00105         QMF_EXTERN void setAttribute(const std::string& key, const qpid::types::Variant& value);
    00106
    00110         QMF_EXTERN const std::string& getName() const;
    00111
    00116         QMF_EXTERN void open();
    00117
    00121         QMF_EXTERN void close();
    00122
    00129         QMF_EXTERN bool nextEvent(AgentEvent& outEvent, qpid::messaging::Duration timeout=qpid::messaging::Duration::FOREVER);
    00130
    00134         QMF_EXTERN int pendingEvents() const;
    00135
    00139         QMF_EXTERN void registerSchema(Schema& schema);
    00140
    00152         QMF_EXTERN DataAddr addData(Data& data, const std::string& name="", bool persistent=false);
    00153
    00157         QMF_EXTERN void delData(const DataAddr& dataAddr);
    00158
    00169         QMF_EXTERN void authAccept(AgentEvent& event);
    00170         QMF_EXTERN void authReject(AgentEvent& event, const std::string& diag="");
    00171         QMF_EXTERN void raiseException(AgentEvent& event, const std::string& errorText);
    00172         QMF_EXTERN void raiseException(AgentEvent& event, const Data& errorData);
    00173         QMF_EXTERN void response(AgentEvent& event, const Data& responseData);
    00174         QMF_EXTERN void complete(AgentEvent& event);
    00175         QMF_EXTERN void methodSuccess(AgentEvent& event);
    00176
    00185         QMF_EXTERN void raiseEvent(const Data& data);
    00186         QMF_EXTERN void raiseEvent(const Data& data, int severity);
    00187
    00188 #ifndef SWIG
    00189     private:
    00190         friend class qmf::PrivateImplRef<AgentSession>;
    00191         friend struct AgentSessionImplAccess;
    00192 #endif
    00193     };
    00194
    00195 }
    00196
    00197 #endif