KDSOAP

KDSoapServer.h

00001 /****************************************************************************
00002 ** Copyright (C) 2010-2011 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 
00212     void setWsdlFile(const QString& file, const QString& pathInUrl);
00213 
00217     QString wsdlFile() const;
00218 
00222     QString wsdlPathInUrl() const;
00223 
00224 public Q_SLOTS:
00229     void suspend();
00230 
00234     void resume();
00235 
00236 Q_SIGNALS:
00241     void connectionRejected();
00242 
00243 protected: void incomingConnection(int socketDescriptor);
00245 
00246 private:
00247     friend class KDSoapServerSocket;
00248     void log(const QByteArray& text);
00249     class Private;
00250     Private* const d;
00251 };
00252 
00253 #endif
 All Classes Functions Enumerations Enumerator

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