Java Magazine, September/October 2016
Model Conveyor Belt Device Model Device Conveyor Belt IoT Application My Factory IoT Integration Factory Monitor App ORACLE COM JAVAMAGAZINE SEPTEMBER OCTOBER 2016 35 internet of things with the appropriate device attributes The data source is the conveyor belt motor and the logic should send an alert when the motor temperature goes above 100 degrees Fahrenheit and the cooling fan speed is less than 1 the fan is not on The TempThreshold2 analytic is similar except that it looks for a higher temperature 150 degrees Fahrenheit and a fan speed that is less than 2 The remaining analytics are similar However these analytics are useless unless theres an application that listens for the resulting alerts to act on them This is the Java monitoring application mentioned previously which is integrated through a REST endpoint to which IoTCS sends the analytics driven alerts As a result the monitoring application instructs the device to change its belt motor speed adjust the cooling fan speed or shut down in response to the analytics alerts see Listing 3 Listing 3 public static void handleREST HttpExchange t throws Exception Read request JSON string BufferedReader bodyReader new BufferedReader new InputStreamReader t getRequestBody Parse the JSON string StringReader sr new StringReader alert toString JsonReader jr Json createReader sr JsonObject jo JsonObject payload jo getJsonObject payload Get the alert type by URN Figure 2 The architecture of the sample Oracle IoTCS application Power Action Data Updates Data Updates ALERT Activate Action Requests Oracle IoT Cloud Service Java Device Client Software Library Oracle IoT Cloud Service Java Enterprise Client Software Library ORACLE IOT CLOUD SERVICE Real Time Analytics FACTORY MONITOR APPLICATION CONVEYOR BELT EMULATOR Figure 3 A Streams Explorer analytic definition
You must have JavaScript enabled to view digital editions.