Displaying differences for changeset
 
display as  

nbproject/private/private.xml

@@ -42,15 +42,24 @@
             <file>file:/od/projects/csip-all/csip-example/web/WEB-INF/csip-defaults.json</file>
             <file>file:/od/projects/csip-all/csip-example/build.xml</file>
         </group>
+        <group name="RTI">
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/py/V1_0.java</file>
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/py/V1_0.py</file>
+            <file>file:/od/projects/csip-all/csip-example/build.xml</file>
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V2_0.java</file>
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V1_0.java</file>
+            <file>file:/od/projects/csip-all/csip-example/web/WEB-INF/csip-defaults.json</file>
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V1_01.java</file>
+        </group>
         <group name="csip-core">
-            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/py/V1_0.java</file>
-            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V2_0.json</file>
-            <file>file:/od/projects/csip-all/csip-example/src/java/client/example/Call.py</file>
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V3.java</file>
             <file>file:/od/projects/csip-all/csip-example/src/java/m/example/py/V1_0.py</file>
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V1_0.java</file>
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V1_01.java</file>
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/stats/V2_0.java</file>
             <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V2_0.java</file>
+            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/jdbc/V1_0.java</file>
             <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V2_0_1.java</file>
-            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/py/install.sh</file>
-            <file>file:/od/projects/csip-all/csip-example/src/java/m/example/stats/V1_0.java</file>
         </group>
     </open-files>
 </project-private>

src/java/m/example/ApplicationConfig.java

@@ -20,40 +20,44 @@
 @javax.ws.rs.ApplicationPath("")
 public class ApplicationConfig extends Application {
 
-    @Context
-    private ServletContext context;
+  @Context
+  private ServletContext context;
 
 
-    @Override
-    public Set<Class<?>> getClasses() {
-        Set<Class<?>> resources = new java.util.HashSet<Class<?>>();
-        resources.add(MultiPartFeature.class);
-        addRestResourceClasses(resources);
-        Config.registry().register(resources);
-        return resources;
-    }
+  @Override
+  public Set<Class<?>> getClasses() {
+    Set<Class<?>> resources = new java.util.HashSet<>();
+    addRestResourceClasses(resources);
+    ContextConfig.filterServices(context, resources);
+    Config.register(resources);
+    return resources;
+  }
 
 
-    /**
-     * Do not modify addRestResourceClasses() method. It is automatically
-     * re-generated by NetBeans REST support to populate given list with all
-     * resources defined in the project.
-     */
-    private void addRestResourceClasses(Set<Class<?>> resources) {
-        resources.add(csip.ArchiveService.class);
-        resources.add(csip.CatalogService.class);
-        resources.add(csip.ControlService.class);
-        resources.add(csip.QueryService.class);
-        resources.add(csip.ReportService.class);
-        resources.add(csip.UIService.class);
-        resources.add(m.example.externalexe.V1_0.class);
-        resources.add(m.example.jdbc.V1_0.class);
-        resources.add(m.example.logging.V1_0.class);
-        resources.add(m.example.py.V1_0.class);
-        resources.add(m.example.simpleservice.V1_0.class);
-        resources.add(m.example.simpleservice.V2_0.class);
-        resources.add(m.example.simpleservice.V2_0_1.class);
+  /**
+   * Do not modify addRestResourceClasses() method. It is automatically
+   * re-generated by NetBeans REST support to populate given list with all
+   * resources defined in the project.
+   */
+  private void addRestResourceClasses(Set<Class<?>> resources) {
+    resources.add(csip.ArchiveService.class);
+    resources.add(csip.CatalogService.class);
+    resources.add(csip.ControlService.class);
+    resources.add(csip.DynamicPyModelDataService.class);
+    resources.add(csip.QueryService.class);
+    resources.add(csip.QueueingModelDataService.class);
+    resources.add(csip.ReportService.class);
+    resources.add(csip.UIService.class);
+    resources.add(m.example.externalexe.V1_0.class);
+    resources.add(m.example.jdbc.V1_0.class);
+    resources.add(m.example.logging.V1_0.class);
+    resources.add(m.example.py.V1_0.class);
+    resources.add(m.example.simpleservice.V1_0.class);
+    resources.add(m.example.simpleservice.V1_01.class);
+    resources.add(m.example.simpleservice.V2_0.class);
+    resources.add(m.example.simpleservice.V2_0_1.class);
     resources.add(m.example.simpleservice.V3.class);
     resources.add(m.example.stats.V1_0.class);
-    }
+    resources.add(m.example.stats.V2_0.class);
+  }
 }

src/java/m/example/jdbc/V1_0.java

@@ -7,7 +7,9 @@
 
 import csip.ModelDataService;
 import csip.ServiceException;
+import csip.SessionLogger;
 import csip.annotations.*;
+import csip.utils.Binaries;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -34,23 +36,28 @@
 @Resource(from = PoolClass.class)
 public class V1_0 extends ModelDataService {
 
-    @Override
-    protected void doProcess() throws Exception {
-        try (Connection c = getResourceJDBC(P_ID); Statement st = c.createStatement()) {
-            try (ResultSet rs = st.executeQuery("select * from patches;")) {
-                while (rs.next()) {
-                    System.out.println(rs.getDouble("nval"));
-                }
-            }
-        } catch (SQLException | ServiceException ex) {
-            LOG.log(Level.SEVERE, null, ex);
+  private void ttt(Class<?> c, SessionLogger l) throws ServiceException {
+    Connection cc = Binaries.getResourceJDBC(c, "test", l);
+  }
+
+
+  @Override
+  protected void doProcess() throws Exception {
+    try (Connection c = getResourceJDBC(P_ID); Statement st = c.createStatement()) {
+      try (ResultSet rs = st.executeQuery("select * from patches;")) {
+        while (rs.next()) {
+          System.out.println(rs.getDouble("nval"));
         }
+      }
+    } catch (SQLException | ServiceException ex) {
+      LOG.log(Level.SEVERE, null, ex);
     }
+  }
 
 
-    @Override
-    protected void postProcess() throws Exception {
-        putResult("result", "done.");
-    }
+  @Override
+  protected void postProcess() throws Exception {
+    putResult("result", "done.");
+  }
 
 }

src/java/m/example/py/V1_0.java

@@ -24,9 +24,7 @@
 @Resource(file = "/m/example/py/install.sh", type = INSTALL)
 
 // explicit python mapping to service
-
 //@Resource(file = "/m/example/py/V1_0.py", type = PYTHON3)
-
 // python mapping by naming convention
 @Resource(type = PYTHON3)
 

src/java/m/example/simpleservice/V1_0.java

@@ -25,7 +25,7 @@
     // 1) parse the service input 
     @Override
     protected void preProcess() throws Exception {
-        temp = getDoubleParam("temp");
+        temp = parameter().getDouble("temp");
     }
 
 
@@ -40,7 +40,8 @@
     // 3) provide the temperature as a result.
     @Override
     protected void postProcess() throws Exception {
-        putResult("temp", temp, "Temperature", "F");
+//      putResult("temp", temp, "Temperature", "F");
+        results().put("temp", temp, "Temperature", "F");
     }
 
 

src/java/m/example/simpleservice/V2_0.java

@@ -25,12 +25,16 @@
 
     @Override
     protected void doProcess() throws Exception {
-        long sleep = getLongParam("sleep", 0);
+//        long sleep = getLongParam("sleep", 0);
+        long sleep = parameter().getLong("sleep", 0);
         Thread.sleep(sleep);
-        double temp = getDoubleParam("temp");
-        String un = getParamUnit("temp");
+//        double temp = getDoubleParam("temp");
+        double temp = parameter().getDouble("temp");
+//        String un = getParamUnit("temp");
+        String un = parameter().getUnit("temp");
         if (un.equals("C")) {
-            putResult("temp", temp * 9 / 5 + 32, "temperature", "F");
+//            putResult("temp", temp * 9 / 5 + 32, "temperature", "F");
+            results().put("temp", temp * 9 / 5 + 32, "temperature", "F");
             return;
         }
         throw new ServiceException("missing unit.");

web/WEB-INF/csip-defaults.json

@@ -11,5 +11,8 @@
 
  "connect.url": "jdbc:postgresql://localhost/od?user=od&password=od",
  "mssql.db": "jdbc:sqlserver:\/\/129.82.20.241:1433;databaseName=conservation_resources;user=readOnly;password=password"  ,
- "csip.response.stacktrace": true
+ "csip.response.stacktrace": true,
+ "csip.publisher.backend":"none",
+ "csip.publisher.kafka.topic":"8080",
+ "csip.publisher.kafka.bootstrap_servers" : "perams10.engr.colostate.edu:9092"
 }