Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
00001 #ifndef _QmfConnection_ 00002 #define _QmfConnection_ 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 #include "qmf/ConnectionSettings.h" 00025 00026 namespace qmf { 00027 00033 enum ConnectionState { 00034 CONNECTION_UP = 1, 00035 CONNECTION_DOWN = 2 00036 }; 00037 00045 class ConnectionListener { 00046 QMF_EXTERN virtual ~ConnectionListener(); 00047 00053 virtual void newState(ConnectionState state); 00054 00063 virtual void interactivePrompt(const char* prompt, char* answer, uint32_t answerLen); 00064 }; 00065 00066 class ConnectionImpl; 00067 00074 class Connection { 00075 public: 00076 00088 QMF_EXTERN Connection(const ConnectionSettings& settings, 00089 const ConnectionListener* listener = 0); 00090 00094 QMF_EXTERN ~Connection(); 00095 00101 QMF_EXTERN void setAdminState(bool enabled); 00102 00108 QMF_EXTERN ConnectionState getOperState() const; 00109 00115 QMF_EXTERN const char* getLastError() const; 00116 00117 private: 00118 friend class AgentImpl; 00119 friend class ConsoleImpl; 00120 ConnectionImpl* impl; 00121 }; 00122 00123 } 00124 00125 #endif