KDSOAP 1.2
|
00001 /**************************************************************************** 00002 ** Copyright (C) 2010-2012 Klaralvdalens Datakonsult AB. All rights reserved. 00003 ** 00004 ** This file is part of the KD Soap library. 00005 ** 00006 ** Licensees holding valid commercial KD Soap licenses may use this file in 00007 ** accordance with the KD Soap Commercial License Agreement provided with 00008 ** the Software. 00009 ** 00010 ** 00011 ** This file may be distributed and/or modified under the terms of the 00012 ** GNU General Public License version 2 and version 3 as published by the 00013 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included. 00014 ** 00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 ** 00018 ** Contact info@kdab.com if any conditions of this licensing are not 00019 ** clear to you. 00020 ** 00021 **********************************************************************/ 00022 #ifndef KDSOAPSERVER_H 00023 #define KDSOAPSERVER_H 00024 00025 #include "KDSoapServerGlobal.h" 00026 #include <KDSoapMessage.h> 00027 #include <QTcpServer> 00028 00029 class KDSoapThreadPool; 00030 00040 class KDSOAPSERVER_EXPORT KDSoapServer : public QTcpServer 00041 { 00042 Q_OBJECT 00043 public: 00049 explicit KDSoapServer(QObject* parent = 0); 00050 00055 ~KDSoapServer(); 00056 00057 enum Feature { 00058 Public = 0, 00059 Ssl = 1, 00060 AuthRequired = 2 00061 // bitfield, next item is 4 00062 }; 00063 Q_DECLARE_FLAGS(Features, Feature) 00064 00065 00069 void setFeatures(Features features); 00070 00074 Features features() const; 00075 00083 void setThreadPool(KDSoapThreadPool* threadPool); 00084 00088 KDSoapThreadPool* threadPool() const; 00089 00096 void setPath(const QString& path); 00097 00101 QString path() const; 00102 00103 00110 QString endPoint() const; 00111 00121 virtual QObject* createServerObject() = 0; 00122 00129 void setUse(KDSoapMessage::Use use); 00133 KDSoapMessage::Use use() const; 00134 00135 enum LogLevel { LogNothing, LogFaults, LogEveryCall }; 00148 void setLogLevel(LogLevel level); 00152 LogLevel logLevel() const; 00153 00159 void setLogFileName(const QString& fileName); 00160 00164 QString logFileName() const; 00165 00169 void flushLogFile(); 00170 00178 void setMaxConnections(int sockets); 00179 00185 int maxConnections() const; 00186 00195 static bool setExpectedSocketCount(int sockets); 00196 00204 int numConnectedSockets() const; 00205 00211 int totalConnectionCount() const; 00212 00217 void resetTotalConnectionCount(); 00218 00225 void setWsdlFile(const QString& file, const QString& pathInUrl); 00226 00230 QString wsdlFile() const; 00231 00235 QString wsdlPathInUrl() const; 00236 00237 public Q_SLOTS: 00242 void suspend(); 00243 00247 void resume(); 00248 00249 Q_SIGNALS: 00254 void connectionRejected(); 00255 00256 protected: void incomingConnection(int socketDescriptor); 00258 00259 private: 00260 friend class KDSoapServerSocket; 00261 void log(const QByteArray& text); 00262 class Private; 00263 Private* const d; 00264 }; 00265 00266 #endif