Java Magazine, Sept/Oct 2016
ORACLE COM JAVAMAGAZINE SEPTEMBER OCTOBER 2016 38 internet of things In this example the monitoring application turns the conveyor belt on by calling the power action with the right parameter value and then setting the belt speed At this point everything is in place for the end to end conveyor belt IoT application to function properly In reality the application would have a user interface to more easily view the activity but for my purposes the command line will do fine The following listing shows some sample output from the conveyor belt device emulator as it receives commands from the monitoring application Indented lines are wrapped from the previous lines Ed Created the directly connected device Device model urn com acme conveyorbeltmodel Instance 0 LENQ Starting belt speed 0 Motor temp 70 Motor oil pressure 0 Mon Jul 25 12 00 37 EDT 2016 0 LENQ Call power true Motor temp 70 Motor oil pressure 0 Mon Jul 25 12 00 50 EDT 2016 0 LENQ onChange BeltSpeed was 0 now 1 Motor temp 81 Motor oil pressure 40 Motor temp 82 Motor oil pressure 42 Mon Jul 25 12 07 50 EDT 2016 0 LENQ onChange CoolingFanSpeed was 0 now 1 IoTCS analytics alert the monitoring application regarding when to turn the cooling fan on or of as well as about other important events such as low oil pressure and overheating events The following output shows the monitoring application reacting to the various IoTCS analytics alerts Listening on http localhost 7890 monitor messages Device 0 LENQ OilPressure 49 Device 0 LENQ Temperature 71 Alert 0 LENQ TempThreshold1 set cooling fan to 1 What should be noted from this output and the corresponding code shown earlier is how the device and the monitoring application both react to events from IoTCS as implemented through the Java Client Software Library and driven by analytics defined in IoTCS itself The cloud abstracts much of the tedious configuration and glue to make this application functional Conclusion As you can see a PaaS cloud restores some of the fun to coding It removes a level of monotony and it enables users to have greater agility for adjusting applications to their needs article Eric Bruno is a principal sales consultant and an Oracle IoT Champion in the Oracle ISV software sales team He has more than 20 years experience in the information technology community as an enterprise architect developer and industry analyst with expertise in full lifecycle large scale software architecture design and development learn more Oracle IoT Cloud Service home page OAuth 20
You must have JavaScript enabled to view digital editions.