2008-04-22 14:11:53 +02:00
|
|
|
package org.gcube.vremanagement.vremodeler.impl;
|
|
|
|
|
2008-04-22 15:04:13 +02:00
|
|
|
import org.gcube.common.core.state.GCUBEWSResource;
|
2010-11-03 19:32:06 +01:00
|
|
|
import org.gcube.vremanagement.vremodeler.stubs.deployreport.DeployReport;
|
2008-04-22 15:04:13 +02:00
|
|
|
import org.globus.wsrf.ResourceException;
|
|
|
|
|
|
|
|
public class ModelerResource extends GCUBEWSResource {
|
2008-04-22 16:54:47 +02:00
|
|
|
|
|
|
|
protected static final String RP_ID = "Id";
|
2010-11-03 19:32:06 +01:00
|
|
|
|
|
|
|
protected static String[] RPNames = { RP_ID};
|
2008-04-22 16:54:47 +02:00
|
|
|
|
2010-10-29 19:36:10 +02:00
|
|
|
private boolean isUseCloud;
|
|
|
|
|
2010-11-03 19:32:06 +01:00
|
|
|
private int numberOfVMsForCloud;
|
|
|
|
|
|
|
|
private DeployReport deployReport;
|
|
|
|
|
|
|
|
|
2008-04-22 15:04:13 +02:00
|
|
|
@Override
|
2008-10-31 15:26:06 +01:00
|
|
|
protected void initialise(Object... args) throws ResourceException {
|
|
|
|
if (args.length!=1) throw new ResourceException();
|
|
|
|
this.setId((String) args[0]);
|
2010-11-03 19:32:06 +01:00
|
|
|
this.deployReport=null;
|
2010-10-29 19:36:10 +02:00
|
|
|
this.isUseCloud=false;
|
2010-11-08 20:02:22 +01:00
|
|
|
this.numberOfVMsForCloud=-1;
|
2008-04-22 15:04:13 +02:00
|
|
|
}
|
2008-04-22 14:11:53 +02:00
|
|
|
|
2008-04-22 16:54:47 +02:00
|
|
|
|
2010-10-29 19:36:10 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public boolean isUseCloud() {
|
|
|
|
return isUseCloud;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param isUseClound
|
|
|
|
*/
|
|
|
|
public void setUseCloud(boolean isUseCloud) {
|
|
|
|
this.isUseCloud = isUseCloud;
|
|
|
|
}
|
|
|
|
|
2010-11-03 19:32:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
public int getNumberOfVMsForCloud() {
|
|
|
|
return numberOfVMsForCloud;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setNumberOfVMsForCloud(int numberOfVMsForCloud) {
|
|
|
|
this.numberOfVMsForCloud = numberOfVMsForCloud;
|
|
|
|
}
|
2010-10-29 19:36:10 +02:00
|
|
|
|
|
|
|
|
2008-04-22 16:54:47 +02:00
|
|
|
/**
|
|
|
|
* {@inheritDoc}
|
|
|
|
*/
|
|
|
|
public String[] getPropertyNames() {
|
|
|
|
return RPNames;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the id.
|
|
|
|
*
|
|
|
|
* @return the id.
|
|
|
|
*/
|
|
|
|
public String getId() throws ResourceException {
|
2009-01-14 12:11:12 +01:00
|
|
|
return (String) this.getResourcePropertySet().get(RP_ID).get(0);
|
2008-04-22 16:54:47 +02:00
|
|
|
}
|
|
|
|
|
2009-01-14 12:11:12 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param id
|
|
|
|
* @throws ResourceException
|
|
|
|
*/
|
|
|
|
public synchronized void setId(String id) throws ResourceException {
|
2008-04-22 16:54:47 +02:00
|
|
|
this.getResourcePropertySet().get(RP_ID).clear();
|
|
|
|
this.getResourcePropertySet().get(RP_ID).add(id);
|
|
|
|
}
|
2010-11-03 19:32:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
public DeployReport getDeployReport() {
|
|
|
|
return deployReport;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setDeployReport(DeployReport deployReport) {
|
|
|
|
this.deployReport = deployReport;
|
|
|
|
}
|
|
|
|
|
2009-01-14 12:11:12 +01:00
|
|
|
|
2010-11-03 19:32:06 +01:00
|
|
|
|
2008-04-22 14:11:53 +02:00
|
|
|
}
|