KD SOAP
KDSoapServer.h
1 /****************************************************************************
2 ** Copyright (C) 2010-2016 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com.
3 ** All rights reserved.
4 **
5 ** This file is part of the KD Soap library.
6 **
7 ** Licensees holding valid commercial KD Soap licenses may use this file in
8 ** accordance with the KD Soap Commercial License Agreement provided with
9 ** the Software.
10 **
11 **
12 ** This file may be distributed and/or modified under the terms of the
13 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
14 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
15 **
16 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
17 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 **
19 ** Contact info@kdab.com if any conditions of this licensing are not
20 ** clear to you.
21 **
22 **********************************************************************/
23 #ifndef KDSOAPSERVER_H
24 #define KDSOAPSERVER_H
25 
26 #include "KDSoapServerGlobal.h"
27 #include <KDSoapClient/KDSoapMessage.h>
28 #include <QtNetwork/QTcpServer>
29 #include <QtNetwork/QSslConfiguration>
30 
31 class KDSoapThreadPool;
32 
42 class KDSOAPSERVER_EXPORT KDSoapServer : public QTcpServer
43 {
44  Q_OBJECT
45 public:
51  explicit KDSoapServer(QObject *parent = 0);
52 
57  ~KDSoapServer();
58 
59  enum Feature {
60  Public = 0,
61  Ssl = 1,
62  AuthRequired = 2
63  // bitfield, next item is 4
64  };
65  Q_DECLARE_FLAGS(Features, Feature)
66 
67 
71  void setFeatures(Features features);
72 
76  Features features() const;
77 
85  void setThreadPool(KDSoapThreadPool *threadPool);
86 
90  KDSoapThreadPool *threadPool() const;
91 
98  void setPath(const QString &path);
99 
103  QString path() const;
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
Definition: KDSoapServer.h:42
Definition: KDSoapMessage.h:41
Feature
Definition: KDSoapServer.h:59
Definition: KDSoapThreadPool.h:39

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