KD SOAP
 All Classes Functions Enumerations Enumerator Pages
KDSoapServer.h
1 /****************************************************************************
2 ** Copyright (C) 2010-2013 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Soap library.
5 **
6 ** Licensees holding valid commercial KD Soap licenses may use this file in
7 ** accordance with the KD Soap Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 #ifndef KDSOAPSERVER_H
23 #define KDSOAPSERVER_H
24 
25 #include "KDSoapServerGlobal.h"
26 #include <KDSoapClient/KDSoapMessage.h>
27 #include <QtNetwork/QTcpServer>
28 #include <QtNetwork/QSslConfiguration>
29 
30 class KDSoapThreadPool;
31 
41 class KDSOAPSERVER_EXPORT KDSoapServer : public QTcpServer
42 {
43  Q_OBJECT
44 public:
50  explicit KDSoapServer(QObject* parent = 0);
51 
56  ~KDSoapServer();
57 
58  enum Feature {
59  Public = 0,
60  Ssl = 1,
61  AuthRequired = 2
62  // bitfield, next item is 4
63  };
64  Q_DECLARE_FLAGS(Features, Feature)
65 
66 
70  void setFeatures(Features features);
71 
75  Features features() const;
76 
84  void setThreadPool(KDSoapThreadPool* threadPool);
85 
89  KDSoapThreadPool* threadPool() const;
90 
97  void setPath(const QString& path);
98 
102  QString path() const;
103 
104 
111  QString endPoint() const;
112 
122  virtual QObject* createServerObject() = 0;
123 
130  void setUse(KDSoapMessage::Use use);
134  KDSoapMessage::Use use() const;
135 
136  enum LogLevel { LogNothing, LogFaults, LogEveryCall };
149  void setLogLevel(LogLevel level);
153  LogLevel logLevel() const;
154 
160  void setLogFileName(const QString& fileName);
161 
165  QString logFileName() const;
166 
170  void flushLogFile();
171 
176  void closeLogFile();
177 
185  void setMaxConnections(int sockets);
186 
192  int maxConnections() const;
193 
202  static bool setExpectedSocketCount(int sockets);
203 
211  int numConnectedSockets() const;
212 
218  int totalConnectionCount() const;
219 
224  void resetTotalConnectionCount();
225 
232  void setWsdlFile(const QString& file, const QString& pathInUrl);
233 
237  QString wsdlFile() const;
238 
242  QString wsdlPathInUrl() const;
243 
244 #ifndef QT_NO_OPENSSL
245 
248  QSslConfiguration sslConfiguration() const;
249 
254  void setSslConfiguration(const QSslConfiguration &config);
255 #endif
256 
257 public Q_SLOTS:
262  void suspend();
263 
267  void resume();
268 
269 Q_SIGNALS:
274  void connectionRejected();
275 
276 protected:
277 #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
278  void incomingConnection(qintptr socketDescriptor);
279 #else
280  void incomingConnection(int socketDescriptor);
281 #endif
282 
283 private:
284  friend class KDSoapServerSocket;
285  void log(const QByteArray& text);
286  class Private;
287  Private* const d;
288 };
289 
290 #endif

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-soap/