Displaying differences for changeset
 
display as  

nbproject/ant-deploy.xml

@@ -1,4 +1,43 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright (c) 2006, 2016 Oracle and/or its affiliates. All rights reserved.
+
+Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+Other names may be trademarks of their respective owners.
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common
+Development and Distribution License("CDDL") (collectively, the
+"License"). You may not use this file except in compliance with the
+License. You can obtain a copy of the License at
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+specific language governing permissions and limitations under the
+License.  When distributing the software, include this License Header
+Notice in each file and include the License file at
+nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the
+License Header, with the fields enclosed by brackets [] replaced by
+your own identifying information:
+"Portions Copyrighted [year] [name of copyright owner]"
+
+If you wish your version of this file to be governed by only the CDDL
+or only the GPL Version 2, indicate your decision by adding
+"[Contributor] elects to include this software in this distribution
+under the [CDDL or GPL Version 2] license." If you do not indicate a
+single choice of license, a recipient has the option to distribute
+your version of this file under either the CDDL, the GPL Version 2 or
+to extend the choice of license to its licensees as provided above.
+However, if you add GPL Version 2 code and therefore, elected the GPL
+Version 2 license, then the option applies only if the new code is
+made subject to such option by the copyright holder.
+
+Contributor(s):
+-->
 <project default="-deploy-ant" basedir=".">
     <target name="-init" if="deploy.ant.enabled">
         <property file="${deploy.ant.properties.file}"/>
@@ -16,7 +55,7 @@
                     <isset property="tomcat.password"/>
                 </not>
             </condition>
-        </fail>    
+        </fail>
     </target>
     <target name="-deploy-ant" if="deploy.ant.enabled" depends="-init,-check-credentials">
         <echo message="Deploying ${deploy.ant.archive} to ${Context(path)}"/>

nbproject/project.properties

@@ -1,3 +1,4 @@
+j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.4.1.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-spdy.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar
 #Thu Feb 18 14:04:37 MST 2016
 javadoc.splitindex=true
 lib.dir=${web.docbase.dir}/WEB-INF/lib
@@ -12,7 +13,6 @@
 build.web.excludes=${build.classes.excludes}
 war.ear.name=${war.name}
 j2ee.compile.on.save=false
-j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar\:${j2ee.server.home}/lib/catalina-ant.jar\:${j2ee.server.home}/lib/catalina-ha.jar\:${j2ee.server.home}/lib/catalina-storeconfig.jar\:${j2ee.server.home}/lib/catalina-tribes.jar\:${j2ee.server.home}/lib/catalina.jar\:${j2ee.server.home}/lib/ecj-4.4.1.jar\:${j2ee.server.home}/lib/el-api.jar\:${j2ee.server.home}/lib/jasper-el.jar\:${j2ee.server.home}/lib/jasper.jar\:${j2ee.server.home}/lib/jsp-api.jar\:${j2ee.server.home}/lib/servlet-api.jar\:${j2ee.server.home}/lib/sqljdbc4.jar\:${j2ee.server.home}/lib/tomcat-api.jar\:${j2ee.server.home}/lib/tomcat-coyote.jar\:${j2ee.server.home}/lib/tomcat-dbcp.jar\:${j2ee.server.home}/lib/tomcat-i18n-es.jar\:${j2ee.server.home}/lib/tomcat-i18n-fr.jar\:${j2ee.server.home}/lib/tomcat-i18n-ja.jar\:${j2ee.server.home}/lib/tomcat-jdbc.jar\:${j2ee.server.home}/lib/tomcat-jni.jar\:${j2ee.server.home}/lib/tomcat-spdy.jar\:${j2ee.server.home}/lib/tomcat-util-scan.jar\:${j2ee.server.home}/lib/tomcat-util.jar\:${j2ee.server.home}/lib/tomcat-websocket.jar\:${j2ee.server.home}/lib/websocket-api.jar
 debug.test.classpath=${run.test.classpath}
 build.dir=build
 javac.deprecation=false

src/java/m/hydrotools/ApplicationConfig.java

@@ -45,6 +45,6 @@
         resources.add(m.hydrotools.efh2.V1_0.class);
         resources.add(m.hydrotools.efh2.V2_0.class);
         resources.add(m.hydrotools.tr20.V1_0.class);
-        resources.add(m.hydrotools.tr20.V2_0.class);
+    resources.add(m.hydrotools.tr20.V2_0.class);
     }
 }

src/java/m/hydrotools/conv/HECRAS_V1_0.java

@@ -8,7 +8,6 @@
 import csip.ModelDataService;
 import csip.annotations.*;
 import javax.ws.rs.Path;
-import oms3.annotations.*;
 
 /**
  * HECRAS converter for Hydrotools.
@@ -19,10 +18,8 @@
 @Description("HECRAS converter.")
 @Path("m/hecras/1.0")
 @Polling(first = 10000, next = 2000)
-@Resources({
-    @Resource(file = "/bin/lin-amd64/HECRAS_Converter_V31.exe", type = ResourceType.EXECUTABLE, id="auto"),
-    @Resource(file = "*.inp *.err *.dbg *stdout.txt *stderr.txt", type = ResourceType.OUTPUT)
-})
+@Resource(file = "/bin/lin-amd64/HECRAS_Converter_V31.exe", type = ResourceType.EXECUTABLE, id = "auto")
+@Resource(file = "*.inp *.err *.dbg *stdout.txt *stderr.txt", type = ResourceType.OUTPUT)
 public class HECRAS_V1_0 extends ModelDataService {
-    // nothing else to do here :)
+  // nothing else to do here :)
 }

src/java/m/hydrotools/conv/NOAA_non_V1_0.java

@@ -8,8 +8,6 @@
 import csip.ModelDataService;
 import csip.annotations.*;
 import javax.ws.rs.Path;
-import oms3.annotations.*;
-
 
 /**
  * NOAA converter for Hydrotools.
@@ -20,10 +18,8 @@
 @Description("NOAA converter. (non-smoothing)")
 @Path("m/noaa-non/1.0")
 @Polling(first = 10000, next = 2000)
-@Resources({
- @Resource(file="/bin/lin-amd64/NOAA_Converter_V31.exe", type=ResourceType.EXECUTABLE, id="auto"),
- @Resource(file="*.inp *.err *.dbg *stdout.txt *stderr.txt", type=ResourceType.OUTPUT)
-})
+@Resource(file = "/bin/lin-amd64/NOAA_Converter_V31.exe", type = ResourceType.EXECUTABLE, id = "auto")
+@Resource(file = "*.inp *.err *.dbg *stdout.txt *stderr.txt", type = ResourceType.OUTPUT)
 public class NOAA_non_V1_0 extends ModelDataService {
-    // nothing else to do here :)
+  // nothing else to do here :)
 }

src/java/m/hydrotools/conv/NOAA_sm_V1_0.java

@@ -8,11 +8,9 @@
 import csip.ModelDataService;
 import csip.annotations.*;
 import javax.ws.rs.Path;
-import oms3.annotations.*;
-
 
 /**
- * NOAA converter Service. 
+ * NOAA converter Service.
  *
  * @author od
  */
@@ -20,10 +18,8 @@
 @Description("NOAA converter. (smoothing)")
 @Path("m/noaa-sm/1.0")
 @Polling(first = 10000, next = 2000)
-@Resources({
- @Resource(file="/bin/lin-amd64/NOAA_Converter_V31_sm.exe", type=ResourceType.EXECUTABLE, id="auto"),
- @Resource(file="*.inp *.err *.dbg *stdout.txt *stderr.txt", type=ResourceType.OUTPUT),
-})
+@Resource(file = "/bin/lin-amd64/NOAA_Converter_V31_sm.exe", type = ResourceType.EXECUTABLE, id = "auto")
+@Resource(file = "*.inp *.err *.dbg *stdout.txt *stderr.txt", type = ResourceType.OUTPUT)
 public class NOAA_sm_V1_0 extends ModelDataService {
-    // nothing else to do here :)
+  // nothing else to do here :)
 }

src/java/m/hydrotools/conv/NRCC_non_V1_0.java

@@ -8,7 +8,6 @@
 import csip.ModelDataService;
 import csip.annotations.*;
 import javax.ws.rs.Path;
-import oms3.annotations.*;
 
 /**
  * NRCC converter for Hydrotools.
@@ -19,10 +18,8 @@
 @Description("NRCC converter. (non-smoothing)")
 @Path("m/nrcc-non/1.0")
 @Polling(first = 10000, next = 2000)
-@Resources({
-    @Resource(file = "/bin/lin-amd64/NRCC_Converter_V31_non.exe", type = ResourceType.EXECUTABLE, id = "auto"),
-    @Resource(file = "*.inp *.err *.dbg *stdout.txt *stderr.txt", type = ResourceType.OUTPUT)
-})
+@Resource(file = "/bin/lin-amd64/NRCC_Converter_V31_non.exe", type = ResourceType.EXECUTABLE, id = "auto")
+@Resource(file = "*.inp *.err *.dbg *stdout.txt *stderr.txt", type = ResourceType.OUTPUT)
 public class NRCC_non_V1_0 extends ModelDataService {
-    // nothing else to do here :)
+  // nothing else to do here :)
 }

src/java/m/hydrotools/conv/NRCC_sm_V1_0.java

@@ -8,7 +8,6 @@
 import csip.ModelDataService;
 import csip.annotations.*;
 import javax.ws.rs.Path;
-import oms3.annotations.*;
 
 /**
  * NRCC converter.
@@ -19,10 +18,8 @@
 @Description("NRCC converter. (smoothing)")
 @Path("m/nrcc-sm/1.0")
 @Polling(first = 10000, next = 2000)
-@Resources({
-    @Resource(file = "/bin/lin-amd64/NRCC_Converter_V31_sm.exe", type = ResourceType.EXECUTABLE, id = "auto"),
-    @Resource(file = "*.inp *.err *.dbg *stdout.txt *stderr.txt", type = ResourceType.OUTPUT)
-})
+@Resource(file = "/bin/lin-amd64/NRCC_Converter_V31_sm.exe", type = ResourceType.EXECUTABLE, id = "auto")
+@Resource(file = "*.inp *.err *.dbg *stdout.txt *stderr.txt", type = ResourceType.OUTPUT)
 public class NRCC_sm_V1_0 extends ModelDataService {
-    // nothing else to do here :)
+  // nothing else to do here :)
 }

src/java/m/hydrotools/efh2/V1_0.java

@@ -15,41 +15,44 @@
 @Path("m/efh2/1.0")
 public class V1_0 extends ModelDataService {
 
-    static final String PRECIP = "precip";
-    static final String RUNOFF = "runoff";
-    static final String RUNOFFCURVENUMBER = "runoffcurvenumber";
-    static final String STORMTYPE = "stormtype";
-    static final String TIMEOFCONCENTRATION = "timeofconcentration";
-    static final String UNITPEAKDISCHARGE = "unitpeakdischarge";
-    static final String WATERSHEDLENGTH = "watershedlength";
-    static final String WATERSHEDSLOPE = "watershedslope";
-    //
-    EFH2HydrologyModel model = new EFH2HydrologyModel();
+  static final String PRECIP = "precip";
+  static final String RUNOFF = "runoff";
+  static final String RUNOFFCURVENUMBER = "runoffcurvenumber";
+  static final String STORMTYPE = "stormtype";
+  static final String TIMEOFCONCENTRATION = "timeofconcentration";
+  static final String UNITPEAKDISCHARGE = "unitpeakdischarge";
+  static final String WATERSHEDLENGTH = "watershedlength";
+  static final String WATERSHEDSLOPE = "watershedslope";
+  //
+  EFH2HydrologyModel model = new EFH2HydrologyModel();
 
-    @Override
-    protected void preProcess() throws Exception {
-        model.setPrecip(getDoubleParam(PRECIP)); // 14
-        model.setRunoffCurveNumber(getIntParam(RUNOFFCURVENUMBER)); // 90
-        model.setStormType(getStringParam(STORMTYPE)); // 'I'
-        model.setWatershedLength(getDoubleParam(WATERSHEDLENGTH)); // 1500
-        model.setWatershedSlope(getDoubleParam(WATERSHEDSLOPE)); // 0.5
-    }
 
-    @Override
-    protected String process() throws Exception {
-        model.simulate();
-        return EXEC_OK;
-    }
+  @Override
+  protected void preProcess() throws Exception {
+    model.setPrecip(getDoubleParam(PRECIP)); // 14
+    model.setRunoffCurveNumber(getIntParam(RUNOFFCURVENUMBER)); // 90
+    model.setStormType(getStringParam(STORMTYPE)); // 'I'
+    model.setWatershedLength(getDoubleParam(WATERSHEDLENGTH)); // 1500
+    model.setWatershedSlope(getDoubleParam(WATERSHEDSLOPE)); // 0.5
+  }
 
-    @Override
-    protected void postProcess() throws Exception {
-        putResult(RUNOFF, model.getRunoffQ());
-        putResult(TIMEOFCONCENTRATION, model.getTimeOfConcentration());
-        putResult(UNITPEAKDISCHARGE, model.getUnitPeakDischarge());
-    }
 
-    @Override
-    protected void report() throws Exception {
-        putReport("RUNOFF", model.getRunoffQ());
-    }
+  @Override
+  protected void doProcess() throws Exception {
+    model.simulate();
+  }
+
+
+  @Override
+  protected void postProcess() throws Exception {
+    putResult(RUNOFF, model.getRunoffQ());
+    putResult(TIMEOFCONCENTRATION, model.getTimeOfConcentration());
+    putResult(UNITPEAKDISCHARGE, model.getUnitPeakDischarge());
+  }
+
+
+  @Override
+  protected void doReport() throws Exception {
+    putReport("RUNOFF", model.getRunoffQ());
+  }
 }

src/java/m/hydrotools/efh2/V2_0.java

@@ -20,7 +20,6 @@
 import java.util.Map;
 import java.util.Properties;
 import javax.ws.rs.Path;
-import oms3.annotations.*;
 import org.apache.commons.io.FileUtils;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
@@ -37,205 +36,204 @@
 @Polling(first = 10000, next = 2000)
 public class V2_0 extends ModelDataService {
 
-    // parameter
-    static final String WATERSHED_NAME = "watershed_name";
-    static final String DRAINAGE_AREA = "drainage_area";
-    static final String CURVE_NUMBER = "curve_number";
-    static final String WATERSHED_SLOPE = "watershed_slope";
-    static final String WATERSHED_LENGTH = "watershed_length";
-    static final String STORM_NAME = "storm_name";
-    static final String RAIN_DEPTH = "rain_depth";
-    static final String RAIN_DIST = "rain_dist";
+  // parameter
+  static final String WATERSHED_NAME = "watershed_name";
+  static final String DRAINAGE_AREA = "drainage_area";
+  static final String CURVE_NUMBER = "curve_number";
+  static final String WATERSHED_SLOPE = "watershed_slope";
+  static final String WATERSHED_LENGTH = "watershed_length";
+  static final String STORM_NAME = "storm_name";
+  static final String RAIN_DEPTH = "rain_depth";
+  static final String RAIN_DIST = "rain_dist";
 
-    // output
-    static final String RUNOFF_VOLUME = "runoff_volume";
-    static final String PEAK_DISCHARGE = "peak_discharge";
-    static final String PEAK_TIME = "peak_time";
-    static final String TOC = "time_of_concentration";
+  // output
+  static final String RUNOFF_VOLUME = "runoff_volume";
+  static final String PEAK_DISCHARGE = "peak_discharge";
+  static final String PEAK_TIME = "peak_time";
+  static final String TOC = "time_of_concentration";
 
-    // internal result string.
-    private String[] res;
-    String st_name;
-    String toc;
+  // internal result string.
+  private String[] res;
+  String st_name;
+  String toc;
 
 
-    /**
-     * Inclusive range check.
-     *
-     * @param val
-     * @param name
-     * @param min
-     * @param max
-     * @throws ServiceException
-     */
-    static void checkRange(double val, String name, double min, double max) throws ServiceException {
-        if (val >= min && val <= max) {
-            return;
-        }
-        throw new ServiceException(name + ": " + val + " not in range " + min + " ... " + max);
+  /**
+   * Inclusive range check.
+   *
+   * @param val
+   * @param name
+   * @param min
+   * @param max
+   * @throws ServiceException
+   */
+  static void checkRange(double val, String name, double min, double max) throws ServiceException {
+    if (val >= min && val <= max) {
+      return;
+    }
+    throw new ServiceException(name + ": " + val + " not in range " + min + " ... " + max);
+  }
+
+
+  static void checkGT(double val, String name, double min) throws ServiceException {
+    if (val > min) {
+      return;
+    }
+    throw new ServiceException(name + ": " + val + " must be > " + min);
+  }
+
+
+  @Override
+  protected void preProcess() throws Exception {
+    // watershed name
+    String ws_name = getStringParam(WATERSHED_NAME);
+    st_name = getStringParam(STORM_NAME);
+
+    double dr_area = getDoubleParam(DRAINAGE_AREA);
+    checkRange(dr_area, DRAINAGE_AREA, 0, 2000);
+    checkGT(dr_area, DRAINAGE_AREA, 0);
+
+    double cu_number = getDoubleParam(CURVE_NUMBER);
+    checkRange(cu_number, CURVE_NUMBER, 30, 100);
+
+    double ws_slope = getDoubleParam(WATERSHED_SLOPE);
+    checkRange(ws_slope, WATERSHED_SLOPE, 0.5, 64);
+
+    double ws_length = getDoubleParam(WATERSHED_LENGTH);
+    checkRange(ws_length, WATERSHED_LENGTH, 200, 26000);
+
+    double ra_depth = getDoubleParam(RAIN_DEPTH);
+    checkRange(ra_depth, RAIN_DEPTH, 0, 26);
+
+    String ra_dist = getStringParam(RAIN_DIST);
+
+    // populate the input file
+    DecimalFormat f = new DecimalFormat("0.0####");
+    Map<String, Object> m = new HashMap<>();
+    m.put("wn", ws_name);
+    m.put("da______", pad(f.format(dr_area), 10));
+    m.put("cn______", pad(f.format(cu_number), 10));
+    m.put("wl______", pad(f.format(ws_length), 10));
+    m.put("ws______", pad(f.format(ws_slope), 10));
+    m.put("rde_____", pad(f.format(ra_depth), 10));
+    m.put("sn______", pad(st_name, 10));
+    m.put("rdi_____", pad(ra_dist, 10));
+    createTR20Input(m, new File(getWorkspaceDir(), "TR20.inp"));
+  }
+
+
+  @Override
+  protected void doProcess() throws Exception {
+    Executable tr20 = getResourceExe("tr20");
+    int ret = tr20.exec();
+    if (ret != 0) {
+      File err = tr20.stderr();
+      if (err.exists()) {
+        new ServiceException(FileUtils.readFileToString(err));
+      }
+      new ServiceException("Error executing TR20");
+    }
+    File out = new File(getWorkspaceDir(), "TR20.out");
+    if (!out.exists()) {
+      new ServiceException("Missing File : TR20.out");
+    }
+    File dbg = new File(getWorkspaceDir(), "TR20.dbg");
+    if (!dbg.exists()) {
+      new ServiceException("Missing File : TR20.dbg");
     }
 
-
-    static void checkGT(double val, String name, double min) throws ServiceException {
-        if (val > min) {
-            return;
-        }
-        throw new ServiceException(name + ": " + val + " must be > " + min);
+    res = parseOutputFile(st_name, out);
+    if (res == null || res.length != 3) {
+      new ServiceException("Missing output.");
     }
 
+    toc = parseDebugFile(dbg);
+    if (toc == null) {
+      new ServiceException("Missing tocs.");
+    }
+  }
 
-    @Override
-    protected void preProcess() throws Exception {
-        // watershed name
-        String ws_name = getStringParam(WATERSHED_NAME);
-        st_name = getStringParam(STORM_NAME);
 
-        double dr_area = getDoubleParam(DRAINAGE_AREA);
-        checkRange(dr_area, DRAINAGE_AREA, 0, 2000);
-        checkGT(dr_area, DRAINAGE_AREA, 0);
+  @Override
+  protected void postProcess() throws Exception {
+    putResult(RUNOFF_VOLUME, res[0], "inches");
+    putResult(PEAK_TIME, res[1], "h");
+    putResult(PEAK_DISCHARGE, res[2], "cfs");
+    putResult(TOC, toc, "h");
+  }
 
-        double cu_number = getDoubleParam(CURVE_NUMBER);
-        checkRange(cu_number, CURVE_NUMBER, 30, 100);
 
-        double ws_slope = getDoubleParam(WATERSHED_SLOPE);
-        checkRange(ws_slope, WATERSHED_SLOPE, 0.5, 64);
+  static private String parseDebugFile(File debugFile) throws IOException {
+    List<String> out = FileUtils.readLines(debugFile);
+    for (int i = 0; i < out.size(); i++) {
+      String l = out.get(i);
+      if (l.trim().toLowerCase().startsWith("time of concentration =")) {
+        String[] vals = l.trim().split("\\s+");
+        return (vals.length == 5) ? vals[4] : null;
+      }
+    }
+    return null;
+  }
 
-        double ws_length = getDoubleParam(WATERSHED_LENGTH);
-        checkRange(ws_length, WATERSHED_LENGTH, 200, 26000);
 
-        double ra_depth = getDoubleParam(RAIN_DEPTH);
-        checkRange(ra_depth, RAIN_DEPTH, 0, 26);
-
-        String ra_dist = getStringParam(RAIN_DIST);
-
-        // populate the input file
-        DecimalFormat f = new DecimalFormat("0.0####");
-        Map<String, Object> m = new HashMap<>();
-        m.put("wn", ws_name);
-        m.put("da______", pad(f.format(dr_area), 10));
-        m.put("cn______", pad(f.format(cu_number), 10));
-        m.put("wl______", pad(f.format(ws_length), 10));
-        m.put("ws______", pad(f.format(ws_slope), 10));
-        m.put("rde_____", pad(f.format(ra_depth), 10));
-        m.put("sn______", pad(st_name, 10));
-        m.put("rdi_____", pad(ra_dist, 10));
-        createTR20Input(m, new File(getWorkspaceDir(), "TR20.inp"));
+  static private String[] parseOutputFile(String st_name, File outFile) throws IOException {
+    List<String> out = FileUtils.readLines(outFile);
+    int st_index = 0;
+    for (int i = 0; i < out.size(); i++) {
+      String l = out.get(i);
+      if (l.trim().startsWith("STORM " + st_name)) {
+        st_index = i;
+        break;
+      }
     }
-
-
-    @Override
-    protected String process() throws Exception {
-        Executable tr20 = getResourceExe("tr20");
-        int ret = tr20.exec();
-        if (ret != 0) {
-            File err = tr20.stderr();
-            if (err.exists()) {
-                return FileUtils.readFileToString(err);
-            }
-            return "Error executing TR20";
-        }
-        File out = new File(getWorkspaceDir(), "TR20.out");
-        if (!out.exists()) {
-            return "Missing File : TR20.out";
-        }
-        File dbg = new File(getWorkspaceDir(), "TR20.dbg");
-        if (!dbg.exists()) {
-            return "Missing File : TR20.dbg";
-        }
-
-        res = parseOutputFile(st_name, out);
-        if (res == null || res.length != 3) {
-            return "Missing output.";
-        }
-
-        toc = parseDebugFile(dbg);
-        if (toc == null) {
-            return "Missing tocs.";
-        }
-        return EXEC_OK;
-    }
-
-
-    @Override
-    protected void postProcess() throws Exception {
-        putResult(RUNOFF_VOLUME, res[0], "inches");
-        putResult(PEAK_TIME, res[1], "h");
-        putResult(PEAK_DISCHARGE, res[2], "cfs");
-        putResult(TOC, toc, "h");
-    }
-
-
-    static private String parseDebugFile(File debugFile) throws IOException {
-        List<String> out = FileUtils.readLines(debugFile);
-        for (int i = 0; i < out.size(); i++) {
-            String l = out.get(i);
-            if (l.trim().toLowerCase().startsWith("time of concentration =")) {
-                String[] vals = l.trim().split("\\s+");
-                return (vals.length == 5) ? vals[4] : null;
-            }
-        }
-        return null;
-    }
-
-
-    static private String[] parseOutputFile(String st_name, File outFile) throws IOException {
-        List<String> out = FileUtils.readLines(outFile);
-        int st_index = 0;
-        for (int i = 0; i < out.size(); i++) {
-            String l = out.get(i);
-            if (l.trim().startsWith("STORM " + st_name)) {
-                st_index = i;
-                break;
-            }
-        }
-        if (st_index > 0) {
-            for (int i = st_index; i < out.size(); i++) {
-                String l = out.get(i);
-                if (l.trim().startsWith("sub 1")) {
-                    String[] vals = l.split("\\s+");
-                    if (vals.length > 5) {
+    if (st_index > 0) {
+      for (int i = st_index; i < out.size(); i++) {
+        String l = out.get(i);
+        if (l.trim().startsWith("sub 1")) {
+          String[] vals = l.split("\\s+");
+          if (vals.length > 5) {
 //                        System.out.println("runoff " + vals[3]);
 //                        System.out.println("time " + vals[4]);
 //                        System.out.println("rate " + vals[5]);
-                        return new String[]{vals[3], vals[4], vals[5]};
-                    }
-                    break;
-                }
-            }
+            return new String[]{vals[3], vals[4], vals[5]};
+          }
+          break;
         }
-        return null;
+      }
     }
+    return null;
+  }
 
 
-    public static void createTR20Input(Map<String, Object> inp, File file) throws Exception {
-        Properties props = new Properties();
-        props.put("resource.loader", "class");
-        props.put("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
+  public static void createTR20Input(Map<String, Object> inp, File file) throws Exception {
+    Properties props = new Properties();
+    props.put("resource.loader", "class");
+    props.put("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
 
-        VelocityContext context = new VelocityContext(inp);
-        try (Writer writer = new FileWriter(file)) {
-            VelocityEngine ve = new VelocityEngine();
-            ve.init(props);
-            ve.getTemplate("m/hydrotools/efh2/V2_0_input.vm").merge(context, writer);
-        }
+    VelocityContext context = new VelocityContext(inp);
+    try (Writer writer = new FileWriter(file)) {
+      VelocityEngine ve = new VelocityEngine();
+      ve.init(props);
+      ve.getTemplate("m/hydrotools/efh2/V2_0_input.vm").merge(context, writer);
     }
+  }
 
 
-    /**
-     *
-     * @param s
-     * @param len
-     * @return
-     */
-    private static String pad(String s, int len) {
-        if (s.length() == len) {
-            return s;
-        }
-        if (s.length() > len) {
-            return s.substring(0, len);
-        }
-        return String.format("%1$-" + len + "s", s);
+  /**
+   *
+   * @param s
+   * @param len
+   * @return
+   */
+  private static String pad(String s, int len) {
+    if (s.length() == len) {
+      return s;
     }
+    if (s.length() > len) {
+      return s.substring(0, len);
+    }
+    return String.format("%1$-" + len + "s", s);
+  }
 
 //    public static void main(String[] args) throws IOException, Exception {
 ////        parseOutput("storm1", new File("/od/projects/csip-all/csip-hydrotools/src/java/bin/lin-amd64/TR20.out"));

src/java/m/hydrotools/tr20/V1_0.java

@@ -8,7 +8,6 @@
 import csip.ModelDataService;
 import csip.annotations.*;
 import javax.ws.rs.Path;
-import oms3.annotations.*;
 
 /**
  * TR20 Service. Plain execution of the original executable.
@@ -19,10 +18,8 @@
 @Description("TR20")
 @Path("m/tr20/1.0")
 @Polling(first = 10000, next = 2000)
-@Resources({
- @Resource(file="/bin/lin-amd64/TR20.exe", type=ResourceType.EXECUTABLE, id="auto"),
- @Resource(file="*.out *.hyd *.err *.dbg stdout.txt stderr.txt", type=ResourceType.OUTPUT),
-})
+@Resource(file = "/bin/lin-amd64/TR20.exe", type = ResourceType.EXECUTABLE, id = "auto")
+@Resource(file = "*.out *.hyd *.err *.dbg stdout.txt stderr.txt", type = ResourceType.OUTPUT)
 public class V1_0 extends ModelDataService {
 
 }

src/java/m/hydrotools/tr20/V2_0.java

@@ -14,7 +14,6 @@
 import java.io.File;
 import java.util.List;
 import javax.ws.rs.Path;
-import oms3.annotations.*;
 import org.apache.commons.io.FileUtils;
 
 /**
@@ -26,67 +25,59 @@
 @Description("TR20 with converters.")
 @Path("m/tr20/2.0")
 @Polling(first = 10000, next = 2000)
-@Resources({
-    @Resource(file = "/bin/lin-amd64/TR20.exe", type = ResourceType.EXECUTABLE, id = "tr20"),
-    @Resource(file = "/bin/lin-amd64/HECRAS_Converter_V31.exe", type = EXECUTABLE, id = "hecras"),
-    @Resource(file = "/bin/lin-amd64/NOAA_Converter_V31.exe", type = EXECUTABLE, id = "noaa"),
-    @Resource(file = "/bin/lin-amd64/NOAA_Converter_V31_sm.exe", type = EXECUTABLE, id = "noaa_sm"),
-    @Resource(file = "/bin/lin-amd64/NRCC_Converter_V31_non.exe", type = EXECUTABLE, id = "nrcc"),
-    @Resource(file = "/bin/lin-amd64/NRCC_Converter_V31_sm.exe", type = EXECUTABLE, id = "nrcc_sm"),
-    @Resource(file = "*.out *.hyd *.err *.dbg stdout.txt stderr.txt", type = OUTPUT)
-})
+@Resource(file = "/bin/lin-amd64/TR20.exe", type = ResourceType.EXECUTABLE, id = "tr20")
+@Resource(file = "/bin/lin-amd64/HECRAS_Converter_V31.exe", type = EXECUTABLE, id = "hecras")
+@Resource(file = "/bin/lin-amd64/NOAA_Converter_V31.exe", type = EXECUTABLE, id = "noaa")
+@Resource(file = "/bin/lin-amd64/NOAA_Converter_V31_sm.exe", type = EXECUTABLE, id = "noaa_sm")
+@Resource(file = "/bin/lin-amd64/NRCC_Converter_V31_non.exe", type = EXECUTABLE, id = "nrcc")
+@Resource(file = "/bin/lin-amd64/NRCC_Converter_V31_sm.exe", type = EXECUTABLE, id = "nrcc_sm")
+@Resource(file = "*.out *.hyd *.err *.dbg stdout.txt stderr.txt", type = OUTPUT)
 
 public class V2_0 extends ModelDataService {
 
-    String conv;
-    String tr20name;
-    String convinput;
+  String conv;
+  String tr20name;
+  String convinput;
 
 
-    @Override
-    protected void preProcess() throws Exception {
-        conv = getStringParam("conv");
-        tr20name = getStringParam("tr20_input");
-        convinput = getStringParam("conv_input");
+  @Override
+  protected void preProcess() throws Exception {
+    conv = getStringParam("conv");
+    tr20name = getStringParam("tr20_input");
+    convinput = getStringParam("conv_input");
+  }
+
+  // hecras nrcc: txt, 
+  // noaa csv
+  // all produce inp.
+
+  @Override
+  protected void doProcess() throws Exception {
+    Executable e = getResourceExe(conv);
+    int ret = e.exec();
+    if (ret != 0) {
+      throw new ServiceException(" Converter error " + conv);
     }
 
-    // hecras nrcc: txt, 
-    // noaa csv
-    // all produce inp.
-
-    @Override
-    protected String process() throws Exception {
-        Executable e = getResourceExe(conv);
-        int ret = e.exec();
-        if (ret != 0) {
-            return " Converter error " + conv;
-        }
-
-        File conv_output = new File(getWorkspaceDir(), convinput.substring(0, convinput.indexOf('.')) + ".inp");
-        if (!conv_output.exists()) {
-            throw new ServiceException("No converter output.");
-        }
-
-        List<String> inp = FileUtils.readLines(conv_output);
-        inp.remove(0);
-        inp.remove(0);
-        inp.remove(0);
-
-        FileUtils.writeLines(getFileInput(tr20name), inp, true);
-
-        // merge the input files.
-        Executable e1 = getResourceExe("tr20");
-        e1.setArguments(tr20name);
-        ret = e1.exec();
-        if (ret != 0) {
-            return " TR20 error " + conv;
-        }
-        return EXEC_OK;
+    File conv_output = new File(getWorkspaceDir(), convinput.substring(0, convinput.indexOf('.')) + ".inp");
+    if (!conv_output.exists()) {
+      throw new ServiceException("No converter output.");
     }
 
+    List<String> inp = FileUtils.readLines(conv_output);
+    inp.remove(0);
+    inp.remove(0);
+    inp.remove(0);
 
-    @Override
-    protected void postProcess() throws Exception {
-        super.postProcess(); //To change body of generated methods, choose Tools | Templates.
+    FileUtils.writeLines(getFileInput(tr20name), inp, true);
+
+    // merge the input files.
+    Executable e1 = getResourceExe("tr20");
+    e1.setArguments(tr20name);
+    ret = e1.exec();
+    if (ret != 0) {
+      throw new ServiceException(" TR20 error " + conv);
     }
+  }
+
 }

test/efh2_v2/simple-res.json

@@ -1,14 +1,14 @@
 {
   "metainfo": {
     "status": "Finished",
-    "suid": "d966acf0-d748-11e5-8398-75b49e876abb",
+    "suid": "a8473587-db25-11e5-a96b-5d3590c40ecc",
     "cloud_node": "10.2.228.58",
-    "tstamp": "2016-02-19 13:39:18",
+    "tstamp": "2016-02-24 11:37:28",
     "service_url": "http://localhost:8080/csip-hydrotools/m/efh2/2.0",
     "request_ip": "127.0.0.1",
     "csip.version": "$version$",
-    "cpu_time": 164,
-    "expiration_date": "2016-02-19 13:39:22"
+    "cpu_time": 153,
+    "expiration_date": "2016-02-24 11:37:30"
   },
   "parameter": [
     {

web/META-INF/csip-conf.json

@@ -1,7 +1,7 @@
 {
  "csip.archive.enabled": false,
- "csip.archive.backend": "mongodb",
+ "csip.archive.backend": "local",
  "csip.logging.enabled": false,
- "csip.session.backend": "mongodb",
+ "csip.session.backend": "local",
  "csip.session.ttl": "1"
 }