vre-modeler/src/org/gcube/vremanagement/vremodeler/impl/ModelerResource.java

109 lines
2.6 KiB
Java
Raw Normal View History

package org.gcube.vremanagement.vremodeler.impl;
import org.gcube.common.core.state.GCUBEWSResource;
import org.globus.wsrf.ResourceException;
public class ModelerResource extends GCUBEWSResource {
protected static final String RP_ID = "Id";
protected static final String RP_FIRSTREPORT= "firstReport";
protected static final String RP_SECONDREPORT = "secondReport";
protected static String[] RPNames = { RP_ID, RP_FIRSTREPORT, RP_SECONDREPORT};
private boolean isUseCloud;
@Override
protected void initialise(Object... args) throws ResourceException {
if (args.length!=1) throw new ResourceException();
this.setId((String) args[0]);
this.setFirstReport("");
this.setSecondReport("");
this.isUseCloud=false;
}
/**
*
* @return
*/
public boolean isUseCloud() {
return isUseCloud;
}
/**
*
* @param isUseClound
*/
public void setUseCloud(boolean isUseCloud) {
this.isUseCloud = isUseCloud;
}
/**
* {@inheritDoc}
*/
public String[] getPropertyNames() {
return RPNames;
}
/**
* Returns the id.
*
* @return the id.
*/
public String getId() throws ResourceException {
return (String) this.getResourcePropertySet().get(RP_ID).get(0);
}
/**
*
* @param id
* @throws ResourceException
*/
public synchronized void setId(String id) throws ResourceException {
this.getResourcePropertySet().get(RP_ID).clear();
this.getResourcePropertySet().get(RP_ID).add(id);
}
/**
*
* @return
* @throws ResourceException
*/
public String getSecondReport() throws ResourceException {
return (String) this.getResourcePropertySet().get(RP_SECONDREPORT).get(0);
}
/**
*
* @param reportSecondStep
* @throws ResourceException
*/
public synchronized void setSecondReport(String reportSecondStep) throws ResourceException {
this.getResourcePropertySet().get(RP_SECONDREPORT).clear();
this.getResourcePropertySet().get(RP_SECONDREPORT).add(reportSecondStep);
}
/**
*
* @return
* @throws ResourceException
*/
public String getFirstReport() throws ResourceException {
return (String) this.getResourcePropertySet().get(RP_FIRSTREPORT).get(0);
}
/**
*
* @param reportFirstStep
* @throws ResourceException
*/
public synchronized void setFirstReport(String reportFirstStep) throws ResourceException {
this.getResourcePropertySet().get(RP_FIRSTREPORT).clear();
this.getResourcePropertySet().get(RP_FIRSTREPORT).add(reportFirstStep);
}
}