V2_0.java [src/java/m/example/simpleservice] Revision: 1557e2e94511b08574b86242d49a9c1bf25a6964 Date: Sat Aug 18 12:46:48 MDT 2018
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package m.example.simpleservice;
import csip.ServiceException;
import javax.ws.rs.Path;
import oms3.annotations.*;
import csip.annotations.Stage;
@Name("conv #2")
@Description("Example of an simple service")
@Path("m/simpleservice/2.0")
//@QA(RELEASED)
@Stage("Stay away.")
//@Deprecated
//@Resource(file = "/data/us_cvalues_topo2ras_masked.zip", type = ARCHIVE)
//@Resource(file = "/data/us_cvalues_topo2ras_masked.tif", type = REFERENCE, id = "tiff")
public class V2_0 extends csip.ModelDataService {
@Override
protected void doProcess() throws Exception {
long sleep = getLongParam("sleep", 0);
Thread.sleep(sleep);
double temp = getDoubleParam("temp_c");
String un = getParamUnit("temp_c");
if (un.equals("C")) {
putResult("temp", temp * 9 / 5 + 32, "F");
return;
}
throw new ServiceException("missing unit.");
}
}