KD SOAP  1.10.0
KDSoapServer.h
1 /****************************************************************************
2 **
3 ** This file is part of the KD Soap library.
4 **
5 ** SPDX-FileCopyrightText: 2010-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: LicenseRef-KDAB-KDSoap-AGPL3-Modified OR LicenseRef-KDAB-KDSoap OR LicenseRef-KDAB-KDSoap-US
8 **
9 ** Licensees holding valid commercial KD Soap licenses may use this file in
10 ** accordance with the KD Soap Commercial License Agreement provided with
11 ** the Software.
12 **
13 ** Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 **
15 ****************************************************************************/
16 #ifndef KDSOAPSERVER_H
17 #define KDSOAPSERVER_H
18 
19 #include "KDSoapServerGlobal.h"
20 #include <KDSoapClient/KDSoapMessage.h>
21 #include <QtNetwork/QTcpServer>
22 #include <QtNetwork/QSslConfiguration>
23 
24 class KDSoapThreadPool;
25 
35 class KDSOAPSERVER_EXPORT KDSoapServer : public QTcpServer
36 {
37  Q_OBJECT
38 public:
44  explicit KDSoapServer(QObject *parent = 0);
45 
50  ~KDSoapServer();
51 
52  enum Feature {
53  Public = 0,
54  Ssl = 1,
55  AuthRequired = 2
56  // bitfield, next item is 4
57  };
58  Q_DECLARE_FLAGS(Features, Feature)
59 
60 
64  void setFeatures(Features features);
65 
69  Features features() const;
70 
78  void setThreadPool(KDSoapThreadPool *threadPool);
79 
83  KDSoapThreadPool *threadPool() const;
84 
91  void setPath(const QString &path);
92 
96  QString path() const;
97 
104  QString endPoint() const;
105 
115  virtual QObject *createServerObject() = 0;
116 
123  void setUse(KDSoapMessage::Use use);
127  KDSoapMessage::Use use() const;
128 
129  enum LogLevel { LogNothing, LogFaults, LogEveryCall };
142  void setLogLevel(LogLevel level);
146  LogLevel logLevel() const;
147 
153  void setLogFileName(const QString &fileName);
154 
158  QString logFileName() const;
159 
163  void flushLogFile();
164 
169  void closeLogFile();
170 
178  void setMaxConnections(int sockets);
179 
185  int maxConnections() const;
186 
195  static bool setExpectedSocketCount(int sockets);
196 
204  int numConnectedSockets() const;
205 
211  int totalConnectionCount() const;
212 
217  void resetTotalConnectionCount();
218 
225  void setWsdlFile(const QString &file, const QString &pathInUrl);
226 
230  QString wsdlFile() const;
231 
235  QString wsdlPathInUrl() const;
236 
237 #ifndef QT_NO_SSL
238 
241  QSslConfiguration sslConfiguration() const;
242 
247  void setSslConfiguration(const QSslConfiguration &config);
248 #endif
249 
250 public Q_SLOTS:
255  void suspend();
256 
260  void resume();
261 
262 Q_SIGNALS:
267  void connectionRejected();
268 
269 protected:
270 #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
271  void incomingConnection(qintptr socketDescriptor) override;
272 #else
273  void incomingConnection(int socketDescriptor) override;
274 #endif
275 
276 private:
277  friend class KDSoapServerSocket;
278  void log(const QByteArray &text);
279  class Private;
280  Private *const d;
281 };
282 
283 #endif
Definition: KDSoapServer.h:35
Definition: KDSoapMessage.h:34
Feature
Definition: KDSoapServer.h:52
Definition: KDSoapThreadPool.h:32

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-soap/