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;
|
|
|
|
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";
|
2009-02-13 12:00:20 +01:00
|
|
|
protected static final String RP_FIRSTREPORT= "firstReport";
|
|
|
|
protected static final String RP_SECONDREPORT = "secondReport";
|
2009-01-14 12:11:12 +01:00
|
|
|
|
2009-02-13 12:00:20 +01:00
|
|
|
protected static String[] RPNames = { RP_ID, RP_FIRSTREPORT, RP_SECONDREPORT};
|
2008-04-22 16:54:47 +02:00
|
|
|
|
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]);
|
2009-02-13 12:00:20 +01:00
|
|
|
this.setFirstReport("");
|
|
|
|
this.setSecondReport("");
|
2008-04-22 15:04:13 +02:00
|
|
|
}
|
2008-04-22 14:11:53 +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);
|
|
|
|
}
|
2009-01-14 12:11:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @throws ResourceException
|
|
|
|
*/
|
2009-02-13 12:00:20 +01:00
|
|
|
public String getSecondReport() throws ResourceException {
|
|
|
|
return (String) this.getResourcePropertySet().get(RP_SECONDREPORT).get(0);
|
2009-01-14 12:11:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param reportSecondStep
|
|
|
|
* @throws ResourceException
|
|
|
|
*/
|
2009-02-13 12:00:20 +01:00
|
|
|
public synchronized void setSecondReport(String reportSecondStep) throws ResourceException {
|
|
|
|
this.getResourcePropertySet().get(RP_SECONDREPORT).clear();
|
|
|
|
this.getResourcePropertySet().get(RP_SECONDREPORT).add(reportSecondStep);
|
2009-01-14 12:11:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @throws ResourceException
|
|
|
|
*/
|
2009-02-13 12:00:20 +01:00
|
|
|
public String getFirstReport() throws ResourceException {
|
|
|
|
return (String) this.getResourcePropertySet().get(RP_FIRSTREPORT).get(0);
|
2009-01-14 12:11:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param reportFirstStep
|
|
|
|
* @throws ResourceException
|
|
|
|
*/
|
2009-02-13 12:00:20 +01:00
|
|
|
public synchronized void setFirstReport(String reportFirstStep) throws ResourceException {
|
|
|
|
this.getResourcePropertySet().get(RP_FIRSTREPORT).clear();
|
|
|
|
this.getResourcePropertySet().get(RP_FIRSTREPORT).add(reportFirstStep);
|
2009-01-14 12:11:12 +01:00
|
|
|
}
|
|
|
|
|
2010-05-13 18:20:41 +02:00
|
|
|
|
|
|
|
|
2008-04-22 14:11:53 +02:00
|
|
|
}
|