-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgsserverinterface.h
188 lines (157 loc) · 5.68 KB
/
qgsserverinterface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/***************************************************************************
qgsserverinterface.h
Class defining the interface made available to QGIS Server plugins.
-------------------
begin : 2014-09-10
copyright : (C) 2014 by Alessandro Pasotti
email : a dot pasotti at itopen dot it
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSSERVERINTERFACE_H
#define QGSSERVERINTERFACE_H
#include "qgsconfig.h"
#include "qgis_sip.h"
#include "qgscapabilitiescache.h"
#include "qgsrequesthandler.h"
#include "qgsserverfilter.h"
#include "qgsserversettings.h"
#ifdef HAVE_SERVER_PYTHON_PLUGINS
#include "qgsaccesscontrolfilter.h"
#include "qgsaccesscontrol.h"
#include "qgsservercachefilter.h"
#include "qgsservercachemanager.h"
#else
class QgsAccessControl;
class QgsAccessControlFilter;
class QgsServerCacheManager;
class QgsServerCacheFilter;
#endif
#include "qgsserviceregistry.h"
#include "qgis_server.h"
SIP_IF_MODULE( HAVE_SERVER_PYTHON_PLUGINS )
/**
* \ingroup server
* \brief QgsServerInterface
* Class defining interfaces exposed by QGIS Server and
* made available to plugins.
*
* This class provides methods to access the request handler and
* the capabilities cache. A method to read the environment
* variables set in the main FCGI loop is also available.
* Plugins can add listeners (instances of QgsServerFilter) with
* a certain priority through the registerFilter( QgsServerFilter* , int) method.
*
*/
class SERVER_EXPORT QgsServerInterface
{
public:
//! Constructor
QgsServerInterface() SIP_SKIP;
virtual ~QgsServerInterface() = default;
/**
* Set the request handler
* \param requestHandler request handler
* \note not available in Python bindings
*/
virtual void setRequestHandler( QgsRequestHandler *requestHandler ) = 0 SIP_SKIP;
/**
* Clear the request handler
*
* \note not available in Python bindings
*/
virtual void clearRequestHandler() = 0 SIP_SKIP;
/**
* Gets pointer to the capabiblities cache
* \returns QgsCapabilitiesCache
*/
virtual QgsCapabilitiesCache *capabilitiesCache() = 0 SIP_KEEPREFERENCE;
/**
* Gets pointer to the request handler
* \returns QgsRequestHandler
*/
virtual QgsRequestHandler *requestHandler() = 0 SIP_KEEPREFERENCE;
/**
* Register a QgsServerFilter
* \param filter the QgsServerFilter to add
* \param priority an optional priority for the filter order
*/
virtual void registerFilter( QgsServerFilter *filter SIP_TRANSFER, int priority = 0 ) = 0;
/**
* Set the filters map
* \param filters the QgsServerFiltersMap
*/
virtual void setFilters( QgsServerFiltersMap *filters SIP_TRANSFER ) = 0;
/**
* Returns the list of current QgsServerFilter
* \returns QgsServerFiltersMap list of QgsServerFilter
*/
virtual QgsServerFiltersMap filters() = 0;
/**
* Register an access control filter
* \param accessControl the access control to register
* \param priority the priority used to order them
*/
virtual void registerAccessControl( QgsAccessControlFilter *accessControl SIP_TRANSFER, int priority = 0 ) = 0;
//! Gets the registered access control filters
virtual QgsAccessControl *accessControls() const = 0;
/**
* Register a server cache filter
* \param serverCache the server cache to register
* \param priority the priority used to order them
* \since QGIS 3.4
*/
virtual void registerServerCache( QgsServerCacheFilter *serverCache SIP_TRANSFER, int priority = 0 ) = 0;
/**
* Gets the registered server cache filters
* \since QGIS 3.4
*/
virtual QgsServerCacheManager *cacheManager() const = 0;
//! Returns an enrironment variable, used to pass environment variables to Python
virtual QString getEnv( const QString &name ) const = 0;
/**
* Returns the configuration file path
* \returns QString containing the configuration file path
*/
virtual QString configFilePath() = 0;
/**
* Set the configuration file path
* \param configFilePath QString with the configuration file path
*/
virtual void setConfigFilePath( const QString &configFilePath ) = 0;
/**
* Remove entry from config cache
* \param path the path of the file to remove
*/
virtual void removeConfigCacheEntry( const QString &path ) = 0;
/**
* Returns the service registry
* \returns QgsServiceResgistry
*/
virtual QgsServiceRegistry *serviceRegistry() = 0 SIP_KEEPREFERENCE;
/**
* Returns the server settings
* \returns QgsServerSettings
*
* \note not available in Python bindings
*/
virtual QgsServerSettings *serverSettings() = 0 SIP_SKIP;
/**
* Reloads the server settings re-reading the configuration.
*
* \since QGIS 3.28
*/
virtual void reloadSettings() = 0;
private:
#ifdef SIP_RUN
QgsServerInterface();
#endif
QString mConfigFilePath;
};
#endif // QGSSERVERINTERFACE_H