KD SOAP
 All Classes Functions Enumerations Enumerator Pages
KDSoapServer.h
1 /****************************************************************************
2 ** Copyright (C) 2010-2014 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 
105 
112  QString endPoint() const;
113 
123  virtual QObject* createServerObject() = 0;
124 
131  void setUse(KDSoapMessage::Use use);
135  KDSoapMessage::Use use() const;
136 
137  enum LogLevel { LogNothing, LogFaults, LogEveryCall };
150  void setLogLevel(LogLevel level);
154  LogLevel logLevel() const;
155 
161  void setLogFileName(const QString& fileName);
162 
166  QString logFileName() const;
167 
171  void flushLogFile();
172 
177  void closeLogFile();
178 
186  void setMaxConnections(int sockets);
187 
193  int maxConnections() const;
194 
203  static bool setExpectedSocketCount(int sockets);
204 
212  int numConnectedSockets() const;
213 
219  int totalConnectionCount() const;
220 
225  void resetTotalConnectionCount();
226 
233  void setWsdlFile(const QString& file, const QString& pathInUrl);
234 
238  QString wsdlFile() const;
239 
243  QString wsdlPathInUrl() const;
244 
245 #ifndef QT_NO_OPENSSL
246 
249  QSslConfiguration sslConfiguration() const;
250 
255  void setSslConfiguration(const QSslConfiguration &config);
256 #endif
257 
258 public Q_SLOTS:
263  void suspend();
264 
268  void resume();
269 
270 Q_SIGNALS:
275  void connectionRejected();
276 
277 protected:
278 #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
279  void incomingConnection(qintptr socketDescriptor);
280 #else
281  void incomingConnection(int socketDescriptor);
282 #endif
283 
284 private:
285  friend class KDSoapServerSocket;
286  void log(const QByteArray& text);
287  class Private;
288  Private* const d;
289 };
290 
291 #endif

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