git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@8441 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3782a28092
commit
b6abf9b2db
|
@ -70,6 +70,7 @@ public class IStoDBUtil {
|
||||||
*/
|
*/
|
||||||
public static void initDB(GCUBEScope scope) throws GCUBEFault{
|
public static void initDB(GCUBEScope scope) throws GCUBEFault{
|
||||||
|
|
||||||
|
logger.info("Starting initialization!!");
|
||||||
cleanDB();
|
cleanDB();
|
||||||
insertCollection(scope);
|
insertCollection(scope);
|
||||||
logger.debug("initialization: collection");
|
logger.debug("initialization: collection");
|
||||||
|
@ -80,6 +81,7 @@ public class IStoDBUtil {
|
||||||
insertServices(scope);
|
insertServices(scope);
|
||||||
insertGHN(scope);
|
insertGHN(scope);
|
||||||
logger.debug("initialization: GHN");
|
logger.debug("initialization: GHN");
|
||||||
|
logger.info("Database Initialized!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void cleanDB() throws GCUBEFault
|
private static void cleanDB() throws GCUBEFault
|
||||||
|
|
|
@ -14,7 +14,6 @@ import javax.xml.xpath.XPathConstants;
|
||||||
import javax.xml.xpath.XPathExpressionException;
|
import javax.xml.xpath.XPathExpressionException;
|
||||||
import javax.xml.xpath.XPathFactory;
|
import javax.xml.xpath.XPathFactory;
|
||||||
import org.gcube.common.core.faults.GCUBEFault;
|
import org.gcube.common.core.faults.GCUBEFault;
|
||||||
import org.gcube.common.core.informationsystem.publisher.ISPublisher;
|
|
||||||
import org.gcube.common.core.resources.GCUBECollection;
|
import org.gcube.common.core.resources.GCUBECollection;
|
||||||
import org.gcube.common.core.resources.GCUBEMCollection;
|
import org.gcube.common.core.resources.GCUBEMCollection;
|
||||||
import org.gcube.common.core.resources.impl.kxml.KGCUBEResource;
|
import org.gcube.common.core.resources.impl.kxml.KGCUBEResource;
|
||||||
|
@ -62,7 +61,6 @@ public class DeployVRE extends Thread{
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
deployManagerOnVRE();
|
deployManagerOnVRE();
|
||||||
ServiceContext.getContext().setScope(GCUBEScope.getScope(this.startingScope+"/"+this.vreName));
|
|
||||||
createVRE();
|
createVRE();
|
||||||
logger.info("FINISHED");
|
logger.info("FINISHED");
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
@ -207,12 +205,12 @@ public class DeployVRE extends Thread{
|
||||||
resItem.setType(GCUBECollection.TYPE);
|
resItem.setType(GCUBECollection.TYPE);
|
||||||
resItemList.add(resItem);
|
resItemList.add(resItem);
|
||||||
}
|
}
|
||||||
}catch(SQLException sqle){logger.error("Error contacting HSQLDB");}
|
}catch(SQLException sqle){logger.error("Error contacting HSQLDB "+sqle);}
|
||||||
|
|
||||||
//retrieving MDCollection with native MDFormat
|
//retrieving MDCollection with native MDFormat
|
||||||
try{
|
try{
|
||||||
ResourceItem resItem;
|
ResourceItem resItem;
|
||||||
ResultSet resMdColNative =DBInterface.queryDB("select mdcollid from SELECTEDNATIVEMDFROMAT AS s where s.vreid='"+this.getParameter()+"';");
|
ResultSet resMdColNative =DBInterface.queryDB("select s.mdcollid from SELECTEDNATIVEMDFORMAT AS s where s.vreid='"+this.getParameter()+"';");
|
||||||
while (resMdColNative.next()){
|
while (resMdColNative.next()){
|
||||||
resItem= new ResourceItem();
|
resItem= new ResourceItem();
|
||||||
resItem.setID(resMdColNative.getString(1));
|
resItem.setID(resMdColNative.getString(1));
|
||||||
|
@ -220,7 +218,7 @@ public class DeployVRE extends Thread{
|
||||||
resItem.setType(GCUBEMCollection.TYPE);
|
resItem.setType(GCUBEMCollection.TYPE);
|
||||||
resItemList.add(resItem);
|
resItemList.add(resItem);
|
||||||
}
|
}
|
||||||
}catch(SQLException sqle){logger.error("Error contacting HSQLDB");}
|
}catch(SQLException sqle){logger.error("Error contacting HSQLDB "+sqle);}
|
||||||
|
|
||||||
rl.setResource(resItemList.toArray(new ResourceItem[0]));
|
rl.setResource(resItemList.toArray(new ResourceItem[0]));
|
||||||
arp.setResources(rl);
|
arp.setResources(rl);
|
||||||
|
@ -230,7 +228,7 @@ public class DeployVRE extends Thread{
|
||||||
try{
|
try{
|
||||||
ServiceItem servItem;
|
ServiceItem servItem;
|
||||||
List<ServiceItem> listService= new ArrayList<ServiceItem>();
|
List<ServiceItem> listService= new ArrayList<ServiceItem>();
|
||||||
ResultSet resMdColNative =DBInterface.queryDB("select s.name, s.class from VRERELATEDFUNCTIONALITY AS vrf, SERVICES AS s where vrf.vreid='"+this.getParameter()+"' AND s.id=vrf.funcid;");
|
ResultSet resMdColNative =DBInterface.queryDB("select s.name, s.class from VRERELATEDFUNCT AS vrf, SERVICES AS s where vrf.vreid='"+this.getParameter()+"' AND s.id=vrf.funcid;");
|
||||||
while (resMdColNative.next()){
|
while (resMdColNative.next()){
|
||||||
servItem= new ServiceItem();
|
servItem= new ServiceItem();
|
||||||
servItem.setServiceClass(resMdColNative.getString("class"));
|
servItem.setServiceClass(resMdColNative.getString("class"));
|
||||||
|
@ -238,19 +236,19 @@ public class DeployVRE extends Thread{
|
||||||
listService.add(servItem);
|
listService.add(servItem);
|
||||||
}
|
}
|
||||||
serviceList.setService(listService.toArray(new ServiceItem[0]));
|
serviceList.setService(listService.toArray(new ServiceItem[0]));
|
||||||
}catch(SQLException sqle){logger.error("Error contacting HSQLDB");}
|
}catch(SQLException sqle){logger.error("Error contacting HSQLDB "+sqle);}
|
||||||
|
|
||||||
//retrieve the GHN
|
//retrieve the GHN
|
||||||
try{
|
try{
|
||||||
List<String> listGHN= new ArrayList<String>();
|
List<String> listGHN= new ArrayList<String>();
|
||||||
ResultSet resGHN =DBInterface.queryDB("select ghnih, s.class from VRERELATEDGHN where vrf.vreid='"+this.getParameter()+"';");
|
ResultSet resGHN =DBInterface.queryDB("select VRERELATEDGHN.ghnid from VRERELATEDGHN where VRERELATEDGHN.vreid='"+this.getParameter()+"';");
|
||||||
//eliminating the First GHN used for VREManager Deployment
|
//eliminating the First GHN used for VREManager Deployment
|
||||||
resGHN.next();
|
resGHN.next();
|
||||||
while (resGHN.next()){
|
while (resGHN.next()){
|
||||||
listGHN.add(resGHN.getString(1));
|
listGHN.add(resGHN.getString(1));
|
||||||
}
|
}
|
||||||
serviceList.setGHN(listGHN.toArray(new String[0]));
|
serviceList.setGHN(listGHN.toArray(new String[0]));
|
||||||
}catch(SQLException sqle){logger.error("Error contacting HSQLDB");}
|
}catch(SQLException sqle){logger.error("Error contacting HSQLDB "+sqle);}
|
||||||
|
|
||||||
arp.setServices(serviceList);
|
arp.setServices(serviceList);
|
||||||
|
|
||||||
|
@ -258,7 +256,7 @@ public class DeployVRE extends Thread{
|
||||||
String report;
|
String report;
|
||||||
int attempt=0;
|
int attempt=0;
|
||||||
do{
|
do{
|
||||||
this.wait(20000);
|
Thread.currentThread().sleep(20000);
|
||||||
report=vreManPortType.getReport(reportId);
|
report=vreManPortType.getReport(reportId);
|
||||||
System.out.println("---step 2------");
|
System.out.println("---step 2------");
|
||||||
System.out.println(report);
|
System.out.println(report);
|
||||||
|
@ -273,7 +271,7 @@ public class DeployVRE extends Thread{
|
||||||
|
|
||||||
vreManagerHandler.setHandled(new GCUBEServiceClientImpl());
|
vreManagerHandler.setHandled(new GCUBEServiceClientImpl());
|
||||||
vreManagerHandler.setParameter(this.resourceId);
|
vreManagerHandler.setParameter(this.resourceId);
|
||||||
vreManagerHandler.scope=this.startingScope;
|
vreManagerHandler.scope=GCUBEScope.getScope(this.startingScope+"/"+this.vreName);
|
||||||
try {
|
try {
|
||||||
vreManagerHandler.run();
|
vreManagerHandler.run();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class ModelerTest {
|
||||||
msptp.setFunctionality(fida);
|
msptp.setFunctionality(fida);
|
||||||
|
|
||||||
GHNArray ghnArray= new GHNArray();
|
GHNArray ghnArray= new GHNArray();
|
||||||
ghnArray.setGHNElement(new String[]{"fbd4db10-e268-11dd-bf95-b9ea85be7470","2baac080-ce27-11dd-a523-acaef5fbd79f"});
|
ghnArray.setGHNElement(new String[]{"fbd4db10-e268-11dd-bf95-b9ea85be7470","17f27050-e331-11dd-b475-f675e9b40166"});
|
||||||
msptp.setGHNs(ghnArray);
|
msptp.setGHNs(ghnArray);
|
||||||
|
|
||||||
System.out.println("-"+msptp.checkStatus(new VOID()).getReports(0)+"-");
|
System.out.println("-"+msptp.checkStatus(new VOID()).getReports(0)+"-");
|
||||||
|
|
Loading…
Reference in New Issue