git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@9675 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9db3293917
commit
f70d0d974f
|
@ -399,6 +399,11 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="jarService" depends="buildService" description="jars service implementation">
|
<target name="jarService" depends="buildService" description="jars service implementation">
|
||||||
|
<copy todir="${build.class.dir}">
|
||||||
|
<fileset dir="${source.dir}">
|
||||||
|
<include name="org/**/*.xsl"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
<jar jarfile="${build.lib.dir}/${jarfile}" basedir="${build.class.dir}">
|
<jar jarfile="${build.lib.dir}/${jarfile}" basedir="${build.class.dir}">
|
||||||
<include name="${package.dir}/**" />
|
<include name="${package.dir}/**" />
|
||||||
</jar>
|
</jar>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
xmlns:agg="http://mds.globus.org/aggregator/types">
|
xmlns:agg="http://mds.globus.org/aggregator/types">
|
||||||
|
|
||||||
<agg:AggregatorConfig xsi:type="agg:AggregatorConfig">
|
<agg:AggregatorConfig xsi:type="agg:AggregatorConfig">
|
||||||
<agg:GetMultipleResourcePropertiesPollType xmlns:xmlindexer="http://gcube-system.org/namespaces/metadatamanagement/xmlindexer/gcubedaix">
|
<agg:GetMultipleResourcePropertiesPollType xmlns:modeler="http://gcube-system.org/namespaces/vremanagement/vremodeler">
|
||||||
<!-- the polling time: how often the IS synchronizes its content with the RPD values -->
|
<!-- the polling time: how often the IS synchronizes its content with the RPD values -->
|
||||||
<agg:PollIntervalMillis>60000</agg:PollIntervalMillis>
|
<agg:PollIntervalMillis>60000</agg:PollIntervalMillis>
|
||||||
<agg:ResourcePropertyNames>modeler:Id</agg:ResourcePropertyNames>
|
<agg:ResourcePropertyNames>modeler:Id</agg:ResourcePropertyNames>
|
||||||
|
|
|
@ -12,15 +12,15 @@ public class ModelerPersistenceDelegate extends GCUBEWSFilePersistenceDelegate<M
|
||||||
protected void onLoad(ModelerResource resource, ObjectInputStream ois) throws Exception {
|
protected void onLoad(ModelerResource resource, ObjectInputStream ois) throws Exception {
|
||||||
super.onLoad(resource, ois);
|
super.onLoad(resource, ois);
|
||||||
resource.setId((String)ois.readObject());
|
resource.setId((String)ois.readObject());
|
||||||
resource.setReportFirstStep((String)ois.readObject());
|
resource.setFirstReport((String)ois.readObject());
|
||||||
resource.setReportSecondStep((String)ois.readObject());
|
resource.setSecondReport((String)ois.readObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void onStore(ModelerResource resource,ObjectOutputStream oos) throws Exception {
|
protected void onStore(ModelerResource resource,ObjectOutputStream oos) throws Exception {
|
||||||
super.onStore(resource, oos);
|
super.onStore(resource, oos);
|
||||||
oos.writeObject(resource.getId());
|
oos.writeObject(resource.getId());
|
||||||
oos.writeObject(resource.getReportFirstStep());
|
oos.writeObject(resource.getFirstReport());
|
||||||
oos.writeObject(resource.getReportSecondStep());
|
oos.writeObject(resource.getSecondReport());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,17 +6,18 @@ import org.globus.wsrf.ResourceException;
|
||||||
public class ModelerResource extends GCUBEWSResource {
|
public class ModelerResource extends GCUBEWSResource {
|
||||||
|
|
||||||
protected static final String RP_ID = "Id";
|
protected static final String RP_ID = "Id";
|
||||||
protected static final String RP_FIRSTSTEP = "firstReport";
|
protected static final String RP_FIRSTREPORT= "firstReport";
|
||||||
protected static final String RP_SECONDSTEP = "secondReport";
|
protected static final String RP_SECONDREPORT = "secondReport";
|
||||||
|
|
||||||
protected static String[] RPNames = { RP_ID, RP_FIRSTSTEP, RP_SECONDSTEP};
|
protected static String[] RPNames = { RP_ID, RP_FIRSTREPORT, RP_SECONDREPORT};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initialise(Object... args) throws ResourceException {
|
protected void initialise(Object... args) throws ResourceException {
|
||||||
if (args.length!=1) throw new ResourceException();
|
if (args.length!=1) throw new ResourceException();
|
||||||
this.setId((String) args[0]);
|
this.setId((String) args[0]);
|
||||||
this.setReportFirstStep("");
|
this.setFirstReport("");
|
||||||
this.setReportSecondStep("");
|
this.setSecondReport("");
|
||||||
|
this.store();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,8 +53,8 @@ public class ModelerResource extends GCUBEWSResource {
|
||||||
* @return
|
* @return
|
||||||
* @throws ResourceException
|
* @throws ResourceException
|
||||||
*/
|
*/
|
||||||
public String getReportSecondStep() throws ResourceException {
|
public String getSecondReport() throws ResourceException {
|
||||||
return (String) this.getResourcePropertySet().get(RP_SECONDSTEP).get(0);
|
return (String) this.getResourcePropertySet().get(RP_SECONDREPORT).get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,10 +62,9 @@ public class ModelerResource extends GCUBEWSResource {
|
||||||
* @param reportSecondStep
|
* @param reportSecondStep
|
||||||
* @throws ResourceException
|
* @throws ResourceException
|
||||||
*/
|
*/
|
||||||
public synchronized void setReportSecondStep(String reportSecondStep) throws ResourceException {
|
public synchronized void setSecondReport(String reportSecondStep) throws ResourceException {
|
||||||
this.getResourcePropertySet().get(RP_SECONDSTEP).clear();
|
this.getResourcePropertySet().get(RP_SECONDREPORT).clear();
|
||||||
this.getResourcePropertySet().get(RP_SECONDSTEP).add(reportSecondStep);
|
this.getResourcePropertySet().get(RP_SECONDREPORT).add(reportSecondStep);
|
||||||
this.store();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,8 +72,8 @@ public class ModelerResource extends GCUBEWSResource {
|
||||||
* @return
|
* @return
|
||||||
* @throws ResourceException
|
* @throws ResourceException
|
||||||
*/
|
*/
|
||||||
public String getReportFirstStep() throws ResourceException {
|
public String getFirstReport() throws ResourceException {
|
||||||
return (String) this.getResourcePropertySet().get(RP_FIRSTSTEP).get(0);
|
return (String) this.getResourcePropertySet().get(RP_FIRSTREPORT).get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,10 +81,9 @@ public class ModelerResource extends GCUBEWSResource {
|
||||||
* @param reportFirstStep
|
* @param reportFirstStep
|
||||||
* @throws ResourceException
|
* @throws ResourceException
|
||||||
*/
|
*/
|
||||||
public synchronized void setReportFirstStep(String reportFirstStep) throws ResourceException {
|
public synchronized void setFirstReport(String reportFirstStep) throws ResourceException {
|
||||||
this.getResourcePropertySet().get(RP_FIRSTSTEP).clear();
|
this.getResourcePropertySet().get(RP_FIRSTREPORT).clear();
|
||||||
this.getResourcePropertySet().get(RP_FIRSTSTEP).add(reportFirstStep);
|
this.getResourcePropertySet().get(RP_FIRSTREPORT).add(reportFirstStep);
|
||||||
this.store();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.gcube.common.core.types.VOID;
|
||||||
import org.gcube.common.core.utils.logging.GCUBELog;
|
import org.gcube.common.core.utils.logging.GCUBELog;
|
||||||
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
||||||
import org.gcube.vremanagement.vremodeler.impl.thread.DeployVRE;
|
import org.gcube.vremanagement.vremodeler.impl.thread.DeployVRE;
|
||||||
import org.gcube.vremanagement.vremodeler.impl.util.GCUBECollection;
|
|
||||||
import org.gcube.vremanagement.vremodeler.impl.util.MetadataFormat;
|
import org.gcube.vremanagement.vremodeler.impl.util.MetadataFormat;
|
||||||
import org.gcube.vremanagement.vremodeler.impl.util.ModelerCollection;
|
import org.gcube.vremanagement.vremodeler.impl.util.ModelerCollection;
|
||||||
import org.gcube.vremanagement.vremodeler.impl.util.XMLUtil;
|
import org.gcube.vremanagement.vremodeler.impl.util.XMLUtil;
|
||||||
|
@ -541,7 +540,7 @@ public class ModelerService {
|
||||||
|
|
||||||
public CheckStatusResponse checkStatus(VOID var) throws Exception{
|
public CheckStatusResponse checkStatus(VOID var) throws Exception{
|
||||||
CheckStatusResponse res= new CheckStatusResponse();
|
CheckStatusResponse res= new CheckStatusResponse();
|
||||||
res.setReports(new String[]{getResource().getReportFirstStep(), getResource().getReportSecondStep()});
|
res.setReports(new String[]{getResource().getFirstReport(), getResource().getSecondReport()});
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,10 +90,12 @@ public class DeployVRE extends Thread{
|
||||||
throw new Exception("Error Deployng the VRE failed on second step");
|
throw new Exception("Error Deployng the VRE failed on second step");
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
getResource().setReportSecondStep("FAILED");
|
getResource().setSecondReport("FAILED");
|
||||||
|
getResource().store();
|
||||||
logger.info("Deploying of the VRE with id "+this.resourceId+" FAILED on first step");
|
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");
|
throw new Exception("Error Deployng the VRE filed on first step");
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
try {
|
try {
|
||||||
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+ModelerService.FAILED+"' WHERE VRE.id='"+this.resourceId+"';");
|
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+ModelerService.FAILED+"' WHERE VRE.id='"+this.resourceId+"';");
|
||||||
|
@ -147,7 +149,8 @@ public class DeployVRE extends Thread{
|
||||||
Thread.currentThread().sleep(20000);
|
Thread.currentThread().sleep(20000);
|
||||||
report=mbportType.getReport(reportId);
|
report=mbportType.getReport(reportId);
|
||||||
attempt++;
|
attempt++;
|
||||||
getResource().setReportFirstStep(report);
|
getResource().setFirstReport(report);
|
||||||
|
getResource().store();
|
||||||
}while (!isDeploymentStatusFinished(report) && attempt<10);
|
}while (!isDeploymentStatusFinished(report) && attempt<10);
|
||||||
}catch(Exception e){e.printStackTrace(); throw e;}
|
}catch(Exception e){e.printStackTrace(); throw e;}
|
||||||
logger.trace("report step 1: "+report);
|
logger.trace("report step 1: "+report);
|
||||||
|
@ -325,8 +328,8 @@ public class DeployVRE extends Thread{
|
||||||
Thread.currentThread().sleep(20000);
|
Thread.currentThread().sleep(20000);
|
||||||
report=vreManPortType.getReport(reportId);
|
report=vreManPortType.getReport(reportId);
|
||||||
attempt++;
|
attempt++;
|
||||||
getResource().setReportSecondStep(report);
|
getResource().setSecondReport(report);
|
||||||
|
getResource().store();
|
||||||
}while (!isDeploymentStatusFinished(report) && attempt<20);
|
}while (!isDeploymentStatusFinished(report) && attempt<20);
|
||||||
logger.info("is something failed in the second step?"+isSomethingFailed(report));
|
logger.info("is something failed in the second step?"+isSomethingFailed(report));
|
||||||
logger.trace("report step 2: "+report);
|
logger.trace("report step 2: "+report);
|
||||||
|
|
Loading…
Reference in New Issue