Rena Tsantouli 2009-06-29 12:52:28 +00:00
parent 2b3b678f01
commit a700f6f894
1 changed files with 10 additions and 3 deletions

View File

@ -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()));
}