31 mSettings( copy.mSettings )
33 if ( copy.mPluginsServerCaches )
39 mPluginsServerCaches.reset(
nullptr );
45 if ( copy.mPluginsServerCaches )
51 mPluginsServerCaches.reset(
nullptr );
58 mPluginsServerCaches.reset();
64 QString key = getCacheKey( cache, accessControl, request );
72 QgsServerCacheFilterMap::const_iterator scIterator;
73 for ( scIterator = mPluginsServerCaches->constBegin(); scIterator != mPluginsServerCaches->constEnd(); ++scIterator )
75 content = scIterator.value()->getCachedDocument( project, request, key );
76 if ( !content.isEmpty() )
81 if ( content.isEmpty() )
86 if ( !doc->setContent( content ) )
97 QString key = getCacheKey( cache, accessControl, request );
104 QgsServerCacheFilterMap::const_iterator scIterator;
105 for ( scIterator = mPluginsServerCaches->constBegin(); scIterator != mPluginsServerCaches->constEnd(); ++scIterator )
107 if ( scIterator.value()->setCachedDocument( doc, project, request, key ) )
118 QString key = getCacheKey( cache, accessControl, request );
120 QgsServerCacheFilterMap::const_iterator scIterator;
121 for ( scIterator = mPluginsServerCaches->constBegin(); scIterator != mPluginsServerCaches->constEnd(); ++scIterator )
123 if ( scIterator.value()->deleteCachedDocument( project, request, key ) )
133 QgsServerCacheFilterMap::const_iterator scIterator;
134 for ( scIterator = mPluginsServerCaches->constBegin(); scIterator != mPluginsServerCaches->constEnd(); ++scIterator )
136 if ( scIterator.value()->deleteCachedDocuments( project ) )
147 QString key = getCacheKey( cache, accessControl, request );
149 QgsServerCacheFilterMap::const_iterator scIterator;
150 for ( scIterator = mPluginsServerCaches->constBegin(); scIterator != mPluginsServerCaches->constEnd(); ++scIterator )
152 QByteArray content = scIterator.value()->getCachedImage( project, request, key );
153 if ( !content.isEmpty() )
164 QString key = getCacheKey( cache, accessControl, request );
166 QgsServerCacheFilterMap::const_iterator scIterator;
167 for ( scIterator = mPluginsServerCaches->constBegin(); scIterator != mPluginsServerCaches->constEnd(); ++scIterator )
169 if ( scIterator.value()->setCachedImage( img, project, request, key ) )
180 QString key = getCacheKey( cache, accessControl, request );
182 QgsServerCacheFilterMap::const_iterator scIterator;
183 for ( scIterator = mPluginsServerCaches->constBegin(); scIterator != mPluginsServerCaches->constEnd(); ++scIterator )
185 if ( scIterator.value()->deleteCachedImage( project, request, key ) )
195 QgsServerCacheFilterMap::const_iterator scIterator;
196 for ( scIterator = mPluginsServerCaches->constBegin(); scIterator != mPluginsServerCaches->constEnd(); ++scIterator )
198 if ( scIterator.value()->deleteCachedImages( project ) )
208 mPluginsServerCaches->insert( priority, serverCache );
213 QStringList cacheKeyList;
223 return cacheKeyList.join(
'-' );
A helper class that centralizes restrictions given by all the access control filter plugins.
bool fillCacheKey(QStringList &cacheKey) const
Fill the capabilities caching key.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Class defining cache interface for QGIS Server plugins.
A helper class that centralizes caches accesses given by all the server cache filter plugins.
void registerServerCache(QgsServerCacheFilter *serverCache, int priority=0)
Register a server cache filter.
bool deleteCachedDocuments(const QgsProject *project) const
Deletes all cached documents for a QGIS project.
QgsServerCacheManager & operator=(const QgsServerCacheManager ©)
Assignment operator.
bool deleteCachedImages(const QgsProject *project) const
Deletes all cached images for a QGIS project.
bool deleteCachedDocument(const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Deletes the cached document.
bool setCachedDocument(const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Updates or inserts the document in cache like capabilities.
bool getCachedDocument(QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Returns cached document (or 0 if document not in cache) like capabilities.
bool setCachedImage(const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Updates or inserts the image in cache like tiles.
~QgsServerCacheManager()
Destructor.
bool deleteCachedImage(const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Deletes the cached image.
QgsServerCacheManager(const QgsServerSettings &settings=QgsServerSettings())
Constructor.
QByteArray getCachedImage(const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Returns cached image (or 0 if image not in cache) like tiles.
QString service() const
Returns SERVICE parameter as a string or an empty string if not defined.
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() met...
QgsServerParameters serverParameters() const
Returns parameters.
Provides a way to retrieve settings by prioritizing according to environment variables,...
SERVER_EXPORT QString serviceUrl(const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings)
Returns the service url defined in the environment variable or with HTTP header.
QMultiMap< int, QgsServerCacheFilter * > QgsServerCacheFilterMap
The registry definition.