diff --git a/CHANGELOG b/CHANGELOG index e97ddac..31070f6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,4 +4,8 @@ v. 1.0.0 (17-10-2008) v. 1.2.0 (14-05-2010) * ticket #211: ResourceManager integration - * stubs modified \ No newline at end of file + * stubs modified + +v. 1.3.0 (11-09-2010) + * support for cloud deployment + \ No newline at end of file diff --git a/build.xml b/build.xml index 72496b7..bbf6ceb 100644 --- a/build.xml +++ b/build.xml @@ -419,7 +419,8 @@ full.stubs: (optional) Set to 'false', it excludes auxiliary stub code plac - + + diff --git a/changelog.xml b/changelog.xml new file mode 100644 index 0000000..8fdd50a --- /dev/null +++ b/changelog.xml @@ -0,0 +1,5 @@ + + + support for cloud deployment + + \ No newline at end of file diff --git a/etc/profile.xml b/etc/profile.xml index 6b84656..3978142 100644 --- a/etc/profile.xml +++ b/etc/profile.xml @@ -11,7 +11,7 @@
Allows user to create new VRE VREModeler-service - 1.2.1 + 1.3.0 @@ -20,7 +20,7 @@ 1.0.0 VREModeler-stubs - [1.02.00,1.03.00) + [1.03.00,1.04.00) false @@ -39,285 +39,13 @@ org.gcube.vremanagement.vremodeler.gar gcube/vremanagement/vremodeler/ModelerFactoryService - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - gcube/vremanagement/vremodeler/ModelerService - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
Allows user to create new VRE VREModeler-stubs - 1.2.1 + 1.3.0 org.gcube.vremanagement.vremodeler.stubs.jar diff --git a/src/org/gcube/vremanagement/vremodeler/consumers/CollectionConsumer.java b/src/org/gcube/vremanagement/vremodeler/consumers/CollectionConsumer.java index 3fc37ec..8e2af10 100644 --- a/src/org/gcube/vremanagement/vremodeler/consumers/CollectionConsumer.java +++ b/src/org/gcube/vremanagement/vremodeler/consumers/CollectionConsumer.java @@ -18,6 +18,10 @@ public class CollectionConsumer extends BaseNotificationConsumer{ public static final GCUBENotificationTopic collectionTopic= new GCUBENotificationTopic(new QName("http://gcube-system.org/namespaces/informationsystem/registry","Collection")); + static{ + collectionTopic.setUseRenotifier(false); + } + private GCUBEScope scope; public CollectionConsumer(GCUBEScope scope){ @@ -30,12 +34,12 @@ public class CollectionConsumer extends BaseNotificationConsumer{ logger.trace("notification received"); ServiceContext.getContext().setScope(this.scope); String id= event.getPayload().getMessage()[0].getChildNodes().item(0).getChildNodes().item(0).getNodeValue(); - String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); String operation=event.getPayload().getMessage()[0].getChildNodes().item(2).getChildNodes().item(0).getNodeValue(); if (operation.compareTo("create")==0){ logger.trace("adding a new Collection in DB"); GCUBECollection collection= GHNContext.getImplementation(GCUBECollection.class); + String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); collection.load(new StringReader(profile)); new CollectionHandler().add(collection); } else if (operation.compareTo("destroy")==0){ diff --git a/src/org/gcube/vremanagement/vremodeler/consumers/GHNConsumer.java b/src/org/gcube/vremanagement/vremodeler/consumers/GHNConsumer.java index 57bdb24..0748c03 100644 --- a/src/org/gcube/vremanagement/vremodeler/consumers/GHNConsumer.java +++ b/src/org/gcube/vremanagement/vremodeler/consumers/GHNConsumer.java @@ -22,6 +22,7 @@ public class GHNConsumer extends BaseNotificationConsumer{ static{ ghnTopic= new GCUBENotificationTopic(new QName("http://gcube-system.org/namespaces/informationsystem/registry","GHN")); ghnTopic.setPrecondition("(//operationType[text()='destroy']) or (//operationType[text()='create'])"); + ghnTopic.setUseRenotifier(false); } private GCUBELog logger= new GCUBELog(GHNConsumer.class); @@ -40,13 +41,13 @@ public class GHNConsumer extends BaseNotificationConsumer{ logger.trace("notification received"); ServiceContext.getContext().setScope(this.scope); String id= event.getPayload().getMessage()[0].getChildNodes().item(0).getChildNodes().item(0).getNodeValue(); - String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); String operation=event.getPayload().getMessage()[0].getChildNodes().item(2).getChildNodes().item(0).getNodeValue(); //logger.trace("received id: "+id+" op: "+operation+" profile: "+profile); if (operation.compareTo("create")==0){ logger.trace("adding a new GHN in DB"); GCUBEHostingNode ghn= GHNContext.getImplementation(GCUBEHostingNode.class); + String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); ghn.load(new StringReader(profile)); new GHNHandler().add(ghn); } else if (operation.compareTo("destroy")==0){ diff --git a/src/org/gcube/vremanagement/vremodeler/consumers/GenericResourceConsumer.java b/src/org/gcube/vremanagement/vremodeler/consumers/GenericResourceConsumer.java index 3381e91..6a23c66 100644 --- a/src/org/gcube/vremanagement/vremodeler/consumers/GenericResourceConsumer.java +++ b/src/org/gcube/vremanagement/vremodeler/consumers/GenericResourceConsumer.java @@ -20,6 +20,10 @@ private GCUBELog logger= new GCUBELog(GHNConsumer.class); public static final GCUBENotificationTopic functionalityTopic= new GCUBENotificationTopic(new QName("http://gcube-system.org/namespaces/informationsystem/registry","GenericResource")); + static{ + functionalityTopic.setUseRenotifier(false); + } + private String functionalityResourceId; private GCUBEScope scope; @@ -33,7 +37,6 @@ private GCUBELog logger= new GCUBELog(GHNConsumer.class); try{ ServiceContext.getContext().setScope(this.scope); String id= event.getPayload().getMessage()[0].getChildNodes().item(0).getChildNodes().item(0).getNodeValue(); - String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); String operation=event.getPayload().getMessage()[0].getChildNodes().item(2).getChildNodes().item(0).getNodeValue(); logger.info("notification received for genericResource "+id+" and operation "+operation); @@ -41,14 +44,16 @@ private GCUBELog logger= new GCUBELog(GHNConsumer.class); if ((operation.compareTo("update")==0) && id.compareTo(this.functionalityResourceId)==0){ logger.trace("notification received for functionalityResource with id "+id+" in scope "+scope.toString()); KGCUBEGenericFunctionalityResource resource= new KGCUBEGenericFunctionalityResource(); + String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); resource.load(new StringReader(profile)); - //FunctionalityHandler + //FunctionalityHandler FunctionalityHandler functionalityHandler= new FunctionalityHandler(); functionalityHandler.add(resource); }else if (operation.compareTo("create")==0){ logger.trace("notification received for generic resource with operation create"); GCUBEGenericResource genericResource= GHNContext.getImplementation(GCUBEGenericResource.class); + String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); genericResource.load(new StringReader(profile)); if (genericResource.getName().compareTo("FuctionalitiesResource")==0){ FunctionalityHandler functionalityHandler= new FunctionalityHandler(); diff --git a/src/org/gcube/vremanagement/vremodeler/consumers/MCollectionConsumer.java b/src/org/gcube/vremanagement/vremodeler/consumers/MCollectionConsumer.java index a992cc1..0bc04b9 100644 --- a/src/org/gcube/vremanagement/vremodeler/consumers/MCollectionConsumer.java +++ b/src/org/gcube/vremanagement/vremodeler/consumers/MCollectionConsumer.java @@ -18,6 +18,10 @@ public class MCollectionConsumer extends BaseNotificationConsumer{ public static final GCUBENotificationTopic mCollectionTopic=new GCUBENotificationTopic(new QName("http://gcube-system.org/namespaces/informationsystem/registry","MetadataCollection")); + static{ + mCollectionTopic.setUseRenotifier(false); + } + private GCUBELog logger= new GCUBELog(MCollectionConsumer.class); private GCUBEScope scope; @@ -32,10 +36,10 @@ public class MCollectionConsumer extends BaseNotificationConsumer{ //logger.trace("notification received"); ServiceContext.getContext().setScope(this.scope); String id= event.getPayload().getMessage()[0].getChildNodes().item(0).getChildNodes().item(0).getNodeValue(); - String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); String operation=event.getPayload().getMessage()[0].getChildNodes().item(2).getChildNodes().item(0).getNodeValue(); if (operation.compareTo("create")==0){ logger.trace("adding a new MCollection in DB"); + String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); GCUBEMCollection mCollection= GHNContext.getImplementation(GCUBEMCollection.class); mCollection.load(new StringReader(profile)); new MCollectionHandler(mCollection.getRelCollection().getCollectionID()).add(mCollection); diff --git a/src/org/gcube/vremanagement/vremodeler/consumers/RunningInstanceConsumer.java b/src/org/gcube/vremanagement/vremodeler/consumers/RunningInstanceConsumer.java index 01afe68..2146074 100644 --- a/src/org/gcube/vremanagement/vremodeler/consumers/RunningInstanceConsumer.java +++ b/src/org/gcube/vremanagement/vremodeler/consumers/RunningInstanceConsumer.java @@ -18,6 +18,10 @@ public class RunningInstanceConsumer extends BaseNotificationConsumer{ public static final GCUBENotificationTopic riTopic= new GCUBENotificationTopic(new QName("http://gcube-system.org/namespaces/informationsystem/registry","RunningInstance")); + static{ + riTopic.setUseRenotifier(false); + } + private GCUBEScope scope; public RunningInstanceConsumer(GCUBEScope scope){ @@ -30,11 +34,11 @@ public class RunningInstanceConsumer extends BaseNotificationConsumer{ logger.trace("notification received for RI"); ServiceContext.getContext().setScope(this.scope); String id= event.getPayload().getMessage()[0].getChildNodes().item(0).getChildNodes().item(0).getNodeValue(); - String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); String operation=event.getPayload().getMessage()[0].getChildNodes().item(2).getChildNodes().item(0).getNodeValue(); if (operation.compareTo("create")==0){ logger.trace("adding a new RI in DB"); GCUBERunningInstance ri= GHNContext.getImplementation(GCUBERunningInstance.class); + String profile=event.getPayload().getMessage()[0].getChildNodes().item(1).getChildNodes().item(0).getNodeValue(); ri.load(new StringReader(profile)); new RunningInstancesHandler(ri.getGHNID()).add(ri); } else if (operation.compareTo("destroy")==0){ diff --git a/src/org/gcube/vremanagement/vremodeler/db/DBInterface.java b/src/org/gcube/vremanagement/vremodeler/db/DBInterface.java index a3e983d..06b7321 100644 --- a/src/org/gcube/vremanagement/vremodeler/db/DBInterface.java +++ b/src/org/gcube/vremanagement/vremodeler/db/DBInterface.java @@ -55,8 +55,7 @@ public class DBInterface { // of the db. // It can contain directory names relative to the // current working directory - - + Connection conn = DriverManager.getConnection("jdbc:hsqldb:file:" + dbFile+ServiceContext.getContext().getScope().toString().replace("/", "-"), // filenames "sa", // username diff --git a/src/org/gcube/vremanagement/vremodeler/db/IStoDBUtil.java b/src/org/gcube/vremanagement/vremodeler/db/IStoDBUtil.java index 83faf95..b9e5cae 100644 --- a/src/org/gcube/vremanagement/vremodeler/db/IStoDBUtil.java +++ b/src/org/gcube/vremanagement/vremodeler/db/IStoDBUtil.java @@ -55,7 +55,7 @@ public class IStoDBUtil { logger.info("Starting initialization!!"); if (!DBInterface.dbAlreadyCreated()) createTables(scope); - cleanDB(scope); + else cleanDB(scope); } private static void cleanDB(GCUBEScope scope) throws GCUBEFault diff --git a/src/org/gcube/vremanagement/vremodeler/impl/ServiceContext.java b/src/org/gcube/vremanagement/vremodeler/impl/ServiceContext.java index f97e1bf..5853e2b 100644 --- a/src/org/gcube/vremanagement/vremodeler/impl/ServiceContext.java +++ b/src/org/gcube/vremanagement/vremodeler/impl/ServiceContext.java @@ -14,6 +14,7 @@ import org.gcube.vremanagement.vremodeler.consumers.GHNConsumer; import org.gcube.vremanagement.vremodeler.consumers.GenericResourceConsumer; import org.gcube.vremanagement.vremodeler.consumers.MCollectionConsumer; import org.gcube.vremanagement.vremodeler.consumers.RunningInstanceConsumer; +import org.gcube.vremanagement.vremodeler.db.DBInterface; import org.gcube.vremanagement.vremodeler.db.IStoDBUtil; import org.gcube.vremanagement.vremodeler.impl.util.ServicePair; import org.gcube.vremanagement.vremodeler.resources.handlers.CollectionHandler; @@ -116,6 +117,7 @@ public class ServiceContext extends GCUBEServiceContext{ for (GCUBEScope scope : ServiceContext.getContext().getInstance().getScopes().values()){ ServiceContext.getContext().setScope(scope); notifier.unregisterFromISNotification(this, topicToRemove, scope); + if (!scope.isInfrastructure()) DBInterface.close(); } } diff --git a/src/org/gcube/vremanagement/vremodeler/impl/deploy/DeployGHNsOnCloud.java b/src/org/gcube/vremanagement/vremodeler/impl/deploy/DeployGHNsOnCloud.java index 48ddfce..f149bea 100644 --- a/src/org/gcube/vremanagement/vremodeler/impl/deploy/DeployGHNsOnCloud.java +++ b/src/org/gcube/vremanagement/vremodeler/impl/deploy/DeployGHNsOnCloud.java @@ -61,7 +61,7 @@ public class DeployGHNsOnCloud{ configureAndStartContainers(eolus, hostnames); //waiting few seconds for GHN registration - Thread.sleep(30000); + Thread.sleep(60000); checkGHNAvailability(hostnames); //now we can be sure that the GHNs are registered on the IS @@ -129,6 +129,8 @@ public class DeployGHNsOnCloud{ } } } + //waiting 1 minute for the boot of the VMs + Thread.sleep(180000); return vmsNames; } diff --git a/src/org/gcube/vremanagement/vremodeler/impl/deploy/DeployVRE.java b/src/org/gcube/vremanagement/vremodeler/impl/deploy/DeployVRE.java index e565285..085cd17 100644 --- a/src/org/gcube/vremanagement/vremodeler/impl/deploy/DeployVRE.java +++ b/src/org/gcube/vremanagement/vremodeler/impl/deploy/DeployVRE.java @@ -24,6 +24,7 @@ import org.gcube.common.core.resources.GCUBEGenericResource; import org.gcube.common.core.resources.GCUBEMCollection; import org.gcube.common.core.resources.GCUBERunningInstance; import org.gcube.common.core.scope.GCUBEScope; +import org.gcube.common.core.scope.GCUBEScope.MalformedScopeExpressionException; import org.gcube.common.core.utils.handlers.GCUBEServiceClientImpl; import org.gcube.common.core.utils.handlers.GCUBEServiceHandler.NoQueryResultException; import org.gcube.common.core.utils.logging.GCUBELog; @@ -134,6 +135,7 @@ public class DeployVRE extends Thread{ } }else{ getResource().getDeployReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Failed); + getResource().getDeployReport().getResourceManagerDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Failed); getResource().store(); logger.info("Deploying of the VRE with id "+this.resourceId+" FAILED on first step"); throw new Exception("Error Deployng the VRE filed on first step"); @@ -152,7 +154,7 @@ public class DeployVRE extends Thread{ } - private boolean deployManagerOnVRE(String candidateGhnId) throws GCUBEFault, ResourceException{ + private boolean deployManagerOnVRE(String candidateGhnId) throws MalformedScopeExpressionException, Exception{ try { DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='Deploying' WHERE VRE.id='"+this.resourceId+"';"); } catch (Exception e) { @@ -163,68 +165,44 @@ public class DeployVRE extends Thread{ getResource().getDeployReport().getResourceManagerDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Running); getResource().store(); + ResourceManagerPortType rmPortType=getResourceMangerPT(this.startingScope); - ResourceManagerServiceHandler resourceManagerHandler= new ResourceManagerServiceHandler(){ + + String report; + try{ + AddResourcesParameters arp= new AddResourcesParameters(); + ServiceList services= new ServiceList(); + ServiceItem[] service= new ServiceItem[1]; + service[0]=new ServiceItem(); + service[0].setServiceClass("VREManagement"); + service[0].setServiceName("ResourceManager"); + service[0].setServiceVersion("1.00.00"); + services.setService(service); - @SuppressWarnings({ "static-access"}) - @Override - protected Boolean makeCall(ResourceManagerPortType resourceManagerPT) - throws Exception { - String report; - try{ - - String vreName=(String) this.getParameter()[0]; - String candidateGHN=(String) this.getParameter()[1]; - - AddResourcesParameters arp= new AddResourcesParameters(); - ServiceList services= new ServiceList(); - ServiceItem[] service= new ServiceItem[1]; - service[0]=new ServiceItem(); - service[0].setServiceClass("VREManagement"); - service[0].setServiceName("ResourceManager"); - service[0].setServiceVersion("1.00.00"); - services.setService(service); - - services.setGHN(new String[]{candidateGHN}); - arp.setServices(services); - arp.setTargetScope(this.scope+"/"+vreName); - String reportId=resourceManagerPT.addResources(arp); - logger.trace("the report id for Rm is "+reportId); - //waiting few seconds - Thread.currentThread().sleep(60000); - int attempt=0; - do{ - Thread.currentThread().sleep(20000); - report=resourceManagerPT.getReport(reportId); - attempt++; - getResource().getDeployReport().getResourceManagerDeployingReport().setResourceManagerReport(report); - getResource().store(); - }while (!isDeploymentStatusFinished(report) && attempt<10); - - }catch(Exception e){logger.error("error deploying RM on VRE",e); throw e;} - logger.trace("report step 1: "+report); - logger.info("is something failed in the first step?"+isSomethingFailed(report)); - return !isSomethingFailed(report); - } - }; - - resourceManagerHandler.clearBlackboard(); - resourceManagerHandler.setHandled(new GCUBEServiceClientImpl()); - resourceManagerHandler.setParameter(new Object[]{vreName,candidateGhnId}); - resourceManagerHandler.scope=this.startingScope; - - try { - resourceManagerHandler.run(); - } catch (Exception e) { - getResource().getDeployReport().getResourceManagerDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Failed); - getResource().store(); - logger.error("DeployingVRE step 1 -- failed "+e); - return false; - } + services.setGHN(new String[]{candidateGhnId}); + arp.setServices(services); + arp.setTargetScope(this.startingScope+"/"+vreName); + String reportId=rmPortType.addResources(arp); + logger.trace("the report id for Rm is "+reportId); + //waiting few seconds + Thread.sleep(60000); + int attempt=0; + do{ + Thread.sleep(20000); + report=rmPortType.getReport(reportId); + attempt++; + getResource().getDeployReport().getResourceManagerDeployingReport().setResourceManagerReport(report); + getResource().store(); + }while (!isDeploymentStatusFinished(report) && attempt<10); + + }catch(Exception e){logger.error("error deploying RM on VRE",e); throw e;} + logger.trace("report step 1: "+report); + logger.info("is something failed in the first step?"+isSomethingFailed(report)); + collectionResourceCreation= new CollectionResourceCreation(this.resourceId, this.vreName); getResource().getDeployReport().getResourceManagerDeployingReport().setState(org.gcube.vremanagement.vremodeler.stubs.deployreport.State.Finished); getResource().store(); - return resourceManagerHandler.getReturnValue(); + return !isSomethingFailed(report); } @@ -236,7 +214,7 @@ public class DeployVRE extends Thread{ ReportFiller.initizlizeFunctionalityForReport(getResource().getDeployReport().getFunctionalityDeployingReport(),this.resourceId); ReportFiller.initializeResourcesForReport(getResource().getDeployReport().getResourceDeployingReport(), this.resourceId); - ResourceManagerPortType rmPortType=getResourceMangerPTinVRE(); + ResourceManagerPortType rmPortType=getResourceMangerPT(GCUBEScope.getScope(this.startingScope+"/"+this.vreName)); CreateScopeParameters scopeParameter=getScopeParameters(); @@ -397,7 +375,7 @@ public class DeployVRE extends Thread{ return ret; } - private ResourceManagerPortType getResourceMangerPTinVRE() throws Exception{ + private ResourceManagerPortType getResourceMangerPT(GCUBEScope scope) throws Exception{ ResourceManagerPortType rmPortType = null; int attempt=0; do{ @@ -411,25 +389,27 @@ public class DeployVRE extends Thread{ query.setExpression("declare namespace is = 'http://gcube-system.org/namespaces/informationsystem/registry';" + " for $outer in collection(\"/db/Profiles/RunningInstance\")//Document/Data/is:Profile/Resource " + - " let $scope:= $outer/Scopes/Scope[string() eq '"+GCUBEScope.getScope(this.startingScope+"/"+this.vreName).toString()+"'] " + + " let $scope:= $outer/Scopes/Scope[string() eq '"+scope.toString()+"'] " + " where count($scope)>0 " + " and $outer/Profile/ServiceName/string() eq 'ResourceManager' " + + " and $outer/Profile/DeploymentData/Status/string() eq 'ready'"+ " return $outer"); List eprs = new ArrayList(); - for (GCUBERunningInstance instance : client.execute(query, GCUBEScope.getScope(this.startingScope+"/"+this.vreName))) + for (GCUBERunningInstance instance : client.execute(query, scope)) eprs.add(instance.getAccessPoint().getEndpoint("gcube/vremanagement/ResourceManager")); if(eprs.size()==0) throw new NoQueryResultException(); ResourceManagerServiceAddressingLocator vmsal= new ResourceManagerServiceAddressingLocator(); + logger.trace("trying to contact instance at "+eprs.get(0).getAddress()); rmPortType= vmsal.getResourceManagerPortTypePort(eprs.get(0)); - rmPortType = GCUBERemotePortTypeContext.getProxy(rmPortType,GCUBEScope.getScope(this.startingScope+"/"+this.vreName), Integer.parseInt((String)ServiceContext.getContext().getProperty("resourceManagerTimeout", true))); + rmPortType = GCUBERemotePortTypeContext.getProxy(rmPortType,scope, Integer.parseInt((String)ServiceContext.getContext().getProperty("resourceManagerTimeout", true))); }catch(Exception e){ logger.warn(e); logger.warn("the query for resourceManager returned no result, re-trying in 30 secs ("+attempt+")"); }finally {attempt++;} }while(rmPortType==null && attempt<10); - if (attempt>=10) throw new Exception("no ResourceMaanger can be retrieved for scope "+GCUBEScope.getScope(this.startingScope+"/"+this.vreName).toString()); + if (attempt>=10) throw new Exception("no ResourceMaanger can be retrieved for scope "+scope); return rmPortType; } diff --git a/src/org/gcube/vremanagement/vremodeler/resources/handlers/GHNHandler.java b/src/org/gcube/vremanagement/vremodeler/resources/handlers/GHNHandler.java index 8868c37..adaabc1 100644 --- a/src/org/gcube/vremanagement/vremodeler/resources/handlers/GHNHandler.java +++ b/src/org/gcube/vremanagement/vremodeler/resources/handlers/GHNHandler.java @@ -25,6 +25,7 @@ public class GHNHandler implements ResourceHandler { ISClient client= GHNContext.getImplementation(ISClient.class); GCUBEGHNQuery query=client.getQuery(GCUBEGHNQuery.class); query.addAtomicConditions(new AtomicCondition("/Profile/GHNDescription/Type","Dynamic")); + query.addAtomicConditions(new AtomicCondition("/Profile/GHNDescription/Status","certified")); List ghnList= client.execute(query, ServiceContext.getContext().getScope()); for (GCUBEHostingNode ghn:ghnList) try{ diff --git a/src/org/gcube/vremanagement/vremodeler/test/ModelerTest.java b/src/org/gcube/vremanagement/vremodeler/test/ModelerTest.java index e13ac0e..ef8298c 100644 --- a/src/org/gcube/vremanagement/vremodeler/test/ModelerTest.java +++ b/src/org/gcube/vremanagement/vremodeler/test/ModelerTest.java @@ -54,7 +54,7 @@ public class ModelerTest { vreReq.setDescription("desc"); vreReq.setDesigner("Lucio"); vreReq.setManager("Lucio"); - vreReq.setName("testCloud"); + vreReq.setName("lucioCloud"); msptp.setDescription(vreReq); System.out.println("description set");