mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
Expose server interfaces methodsi to python for clearing server layer cache.
This commit is contained in:
parent
f9ab7223fc
commit
a4a0c9b2fb
@ -64,6 +64,11 @@ class QgsServerInterface
|
|||||||
virtual QString configFilePath() = 0;
|
virtual QString configFilePath() = 0;
|
||||||
/** Set the config file path */
|
/** Set the config file path */
|
||||||
virtual void setConfigFilePath( const QString& configFilePath) = 0;
|
virtual void setConfigFilePath( const QString& configFilePath) = 0;
|
||||||
|
/** Remove entry from config cache */
|
||||||
|
virtual void removeConfigCacheEntry( const QString& path ) = 0;
|
||||||
|
/** Remove entry from layer cache */
|
||||||
|
virtual void removeProjectLayers( const QString& path ) = 0;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
|
@ -207,3 +207,10 @@ void QgsConfigCache::removeChangedEntry( const QString& path )
|
|||||||
|
|
||||||
mFileSystemWatcher.removePath( path );
|
mFileSystemWatcher.removePath( path );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void QgsConfigCache::removeEntry( const QString& path )
|
||||||
|
{
|
||||||
|
removeChangedEntry( path );
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -61,6 +61,8 @@ class SERVER_EXPORT QgsConfigCache : public QObject
|
|||||||
, const QMap<QString, QString>& parameterMap = ( QMap< QString, QString >() )
|
, const QMap<QString, QString>& parameterMap = ( QMap< QString, QString >() )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void removeEntry( const QString& path );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QgsConfigCache();
|
QgsConfigCache();
|
||||||
|
|
||||||
|
@ -226,3 +226,9 @@ void QgsMSLayerCache::logCacheContents() const
|
|||||||
QgsMessageLog::logMessage( "Url: " + it.value().url + " Layer name: " + it.value().layerPointer->name() + " Project: " + it.value().configFile, "Server", QgsMessageLog::INFO );
|
QgsMessageLog::logMessage( "Url: " + it.value().url + " Layer name: " + it.value().layerPointer->name() + " Project: " + it.value().configFile, "Server", QgsMessageLog::INFO );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void QgsMSLayerCache::removeProjectLayers( const QString& path )
|
||||||
|
{
|
||||||
|
removeProjectFileLayers( path );
|
||||||
|
}
|
||||||
|
@ -73,6 +73,9 @@ class QgsMSLayerCache: public QObject
|
|||||||
//for debugging
|
//for debugging
|
||||||
void logCacheContents() const;
|
void logCacheContents() const;
|
||||||
|
|
||||||
|
/** Expose method for use in server interface */
|
||||||
|
void removeProjectLayers( const QString& path );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** Protected singleton constructor*/
|
/** Protected singleton constructor*/
|
||||||
QgsMSLayerCache();
|
QgsMSLayerCache();
|
||||||
|
@ -111,6 +111,21 @@ class SERVER_EXPORT QgsServerInterface
|
|||||||
*/
|
*/
|
||||||
virtual void setConfigFilePath( const QString& configFilePath ) = 0;
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove entries from layer cache
|
||||||
|
* @param path the path of the project which own the layers to be removed
|
||||||
|
*/
|
||||||
|
virtual void removeProjectLayers( const QString& path ) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mConfigFilePath;
|
QString mConfigFilePath;
|
||||||
};
|
};
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "qgsserverinterfaceimpl.h"
|
#include "qgsserverinterfaceimpl.h"
|
||||||
|
#include "qgsconfigcache.h"
|
||||||
|
#include "qgsmslayercache.h"
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
QgsServerInterfaceImpl::QgsServerInterfaceImpl( QgsCapabilitiesCache* capCache )
|
QgsServerInterfaceImpl::QgsServerInterfaceImpl( QgsCapabilitiesCache* capCache )
|
||||||
@ -72,3 +73,17 @@ void QgsServerInterfaceImpl::registerAccessControl( QgsAccessControlFilter* acce
|
|||||||
{
|
{
|
||||||
mAccessControls->registerAccessControl( accessControl, priority );
|
mAccessControls->registerAccessControl( accessControl, priority );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void QgsServerInterfaceImpl::removeConfigCacheEntry( const QString& path )
|
||||||
|
{
|
||||||
|
QgsConfigCache::instance()->removeEntry( path );
|
||||||
|
}
|
||||||
|
|
||||||
|
void QgsServerInterfaceImpl::removeProjectLayers( const QString& path )
|
||||||
|
{
|
||||||
|
QgsMSLayerCache::instance()->removeProjectLayers( path );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,6 +61,8 @@ class QgsServerInterfaceImpl : public QgsServerInterface
|
|||||||
QString configFilePath() override { return mConfigFilePath; }
|
QString configFilePath() override { return mConfigFilePath; }
|
||||||
void setConfigFilePath( const QString& configFilePath ) override;
|
void setConfigFilePath( const QString& configFilePath ) override;
|
||||||
void setFilters( QgsServerFiltersMap *filters ) override;
|
void setFilters( QgsServerFiltersMap *filters ) override;
|
||||||
|
void removeConfigCacheEntry( const QString& path ) override;
|
||||||
|
void removeProjectLayers( const QString& path ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user