removed old code
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@148714 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
bb18ce0fb9
commit
17e8af86ea
|
@ -98,7 +98,7 @@ public class GeonetworkResolver extends HttpServlet{
|
|||
@Override
|
||||
public void run() {
|
||||
logger.info("Resetting Geonetwork configuratiors cache...");
|
||||
resetCacheGeonetworkInstances();
|
||||
purgeCacheGeonetworkInstances();
|
||||
}
|
||||
}, CACHE_RESET_DELAY, CACHE_RESET_TIME);
|
||||
}
|
||||
|
@ -122,18 +122,24 @@ public class GeonetworkResolver extends HttpServlet{
|
|||
}
|
||||
|
||||
if(resetCache!=null && Boolean.parseBoolean(resetCache)){
|
||||
resetCacheGeonetworkInstances();
|
||||
purgeCacheGeonetworkInstances();
|
||||
}
|
||||
|
||||
if(resetScope!=null && Boolean.parseBoolean(resetScope)){
|
||||
resetCacheServerParameterForScope(scopeValue);
|
||||
resetGeonetoworkInstanceCacheForScope(scopeValue);
|
||||
}
|
||||
|
||||
logger.info("SCOPE: " + scopeValue +", Query String: " + req.getQueryString());
|
||||
try {
|
||||
|
||||
// ServerParameters geonetworkParams = getGeonetworkCachedServerParameters(scopeValue);
|
||||
GeonetworkInstance gnInstance = getGeonetworkInstanceForScope(scopeValue);
|
||||
|
||||
// if(gnInstance==null){
|
||||
// logger.info("GeonetworkInstance not istanciable via geonetwork library.. using ");
|
||||
// ServerParameters serverParams = getGeonetworkCachedServerParameters(scopeValue);
|
||||
// gnInstance = gntwAccess.getGeonetworkInstance();
|
||||
// }
|
||||
|
||||
// GeonetworkServiceInterface gntwAccess = new GeonetworkAccessParameter(scopeValue);
|
||||
// GeonetworkInstance gnInstance = gntwAccess.getGeonetworkInstance();
|
||||
HTTPCallsUtils httpUtils = new HTTPCallsUtils();
|
||||
|
@ -406,7 +412,7 @@ public class GeonetworkResolver extends HttpServlet{
|
|||
protected GeonetworkInstance getGeonetworkInstanceForScope(String scope) throws Exception{
|
||||
|
||||
if(cacheGNInstances==null)
|
||||
resetCacheGeonetworkInstances();
|
||||
purgeCacheGeonetworkInstances();
|
||||
|
||||
logger.info("Attempt to get geonetwork instance from GeonetworkInstance cache for scope: "+scope);
|
||||
GeonetworkInstance geoInstance = cacheGNInstances.get(scope);
|
||||
|
@ -441,12 +447,13 @@ public class GeonetworkResolver extends HttpServlet{
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reset cache server parameter for scope.
|
||||
* Reset geonetowork instance cache for scope.
|
||||
*
|
||||
* @param scope the scope
|
||||
*/
|
||||
private void resetCacheServerParameterForScope(String scope){
|
||||
private void resetGeonetoworkInstanceCacheForScope(String scope){
|
||||
if(cacheGNInstances!=null && cacheGNInstances.get(scope)!=null){
|
||||
cacheGNInstances.remove(scope);
|
||||
logger.info("Reset of "+scope+" in Cache Geonetwork server params perfomed!");
|
||||
|
@ -455,10 +462,11 @@ public class GeonetworkResolver extends HttpServlet{
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reset cache geonetwork instances.
|
||||
* Purge cache geonetwork instances.
|
||||
*/
|
||||
private void resetCacheGeonetworkInstances(){
|
||||
private void purgeCacheGeonetworkInstances(){
|
||||
cacheGNInstances = new HashMap<String, GeonetworkInstance>();
|
||||
logger.info("Reset of GeonetworkInstance cache perfomed!");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue