From a700f6f8948820a256624beda9a06044f9921f83 Mon Sep 17 00:00:00 2001 From: Rena Tsantouli Date: Mon, 29 Jun 2009 12:52:28 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@13267 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../factories/GenericResourceCacheEntryFactory.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/org/gcube/application/framework/core/cache/factories/GenericResourceCacheEntryFactory.java b/src/org/gcube/application/framework/core/cache/factories/GenericResourceCacheEntryFactory.java index 6356673..b7cdd36 100644 --- a/src/org/gcube/application/framework/core/cache/factories/GenericResourceCacheEntryFactory.java +++ b/src/org/gcube/application/framework/core/cache/factories/GenericResourceCacheEntryFactory.java @@ -17,6 +17,7 @@ import org.gcube.common.core.informationsystem.client.ISClient; import org.gcube.common.core.informationsystem.client.queries.GCUBEGenericResourceQuery; import org.gcube.common.core.resources.GCUBEGenericResource; import org.gcube.common.core.scope.GCUBEScope; +import org.gcube.common.core.scope.GCUBEScope.Type; import org.gcube.common.core.utils.logging.GCUBELog; import net.sf.ehcache.constructs.blocking.CacheEntryFactory; @@ -78,9 +79,15 @@ public class GenericResourceCacheEntryFactory implements CacheEntryFactory { query.addAtomicConditions(new AtomicCondition("/Profile/Name", querySt.get(CacheEntryConstants.name))); } else if(querySt.containsKey(CacheEntryConstants.vreResource)) - { - - query.addAtomicConditions(new AtomicCondition("//SecondaryType", GCUBEGenericResource.SECONDARYTYPE_VRE), new AtomicCondition("//Body/Scope", scope.toString())); + { + String secondaryType = new String(); + if (scope.getType() == Type.VRE) + secondaryType = GCUBEGenericResource.SECONDARYTYPE_VRE; + else if (scope.getType() == Type.VO) + secondaryType = GCUBEGenericResource.SECONDARYTYPE_VO; + else + secondaryType = GCUBEGenericResource.SECONDARYTYPE_INFRASTRUCTURE; + query.addAtomicConditions(new AtomicCondition("//SecondaryType", secondaryType), new AtomicCondition("//Body/Scope", scope.toString())); }