ctkDicomAppServer_p.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKDICOMAPPPSERVER_P_H
  16. #define CTKDICOMAPPPSERVER_P_H
  17. // Qt includes
  18. #include <QObject>
  19. #include <QtSoapMessage>
  20. // CTK includes
  21. #include <ctkServiceTracker.h>
  22. #include <ctkDicomAppInterface.h>
  23. #include <ctkSimpleSoapServer.h>
  24. #include <ctkSoapMessageProcessorList.h>
  25. /**
  26. * This class serves as a SOAP server for DICOM Hosted Application
  27. * specific requests. It forwards the SOAP requests to a service
  28. * object registered under the ctkDicomAppInterface interface from
  29. * a specific application plugin.
  30. */
  31. class ctkDicomAppServer : public QObject, ctkServiceTrackerCustomizer<ctkDicomAppInterface*>
  32. {
  33. Q_OBJECT
  34. public:
  35. ctkDicomAppServer(int port, QString path);
  36. ~ctkDicomAppServer();
  37. public slots:
  38. void incomingSoapMessage(const QtSoapMessage& message,
  39. QtSoapMessage* reply);
  40. void incomingWSDLMessage(const QString& message, QString* reply);
  41. protected:
  42. virtual ctkDicomAppInterface* addingService(const ctkServiceReference& reference);
  43. virtual void modifiedService(const ctkServiceReference& reference, ctkDicomAppInterface* service);
  44. virtual void removedService(const ctkServiceReference& reference, ctkDicomAppInterface* service);
  45. private:
  46. QMutex Mutex;
  47. bool AppInterfaceRegistered;
  48. ctkSoapMessageProcessorList Processors;
  49. ctkSimpleSoapServer Server;
  50. int Port;
  51. QString Path;
  52. ctkServiceTracker<ctkDicomAppInterface*> AppInterfaceTracker;
  53. };
  54. #endif // CTKDICOMAPPPSERVER_P_H