3 import iotinstaller.MySQLInterface;
4 import iotinstaller.TableProperty;
5 import iotinstaller.Table;
9 import java.util.Scanner;
10 import java.util.Properties;
12 /** A class that creates an object for IoT device/entity installation into database
14 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
18 public class IoTInstaller {
21 * IoTInstaller class properties
26 * IoTInstaller class constants
28 private static final String STR_MAIN_TABLE_NAME = "IoTMain";
29 private static final String STR_COMM_TABLE_NAME = "IoTComm";
30 private static final String STR_HOST_TABLE_NAME = "IoTComputeNode";
31 private static final String STR_ADDRESS_TABLE_NAME = "IoTAddress";
32 private static final String STR_DEV_ADD_TABLE_NAME = "IoTDeviceAddress";
33 private static final String STR_ZB_ADD_TABLE_NAME = "IoTZigbeeAddress";
34 private static final int INT_NUM_COMM_FIELDS = 5;
35 private static final int INT_NUM_HOST_FIELDS = 3;
37 private static final String STR_INSTALL_ENTITY_CMD = "-install_ent";
38 private static final String STR_INSTALL_COMMUNICATION_CMD = "-install_comm";
39 private static final String STR_INSTALL_COMPLETE_CMD = "-install_comp";
40 private static final String STR_INSTALL_ADDRESS_CMD = "-install_add";
41 private static final String STR_INSTALL_DEV_ADDRESS_CMD = "-install_dev_add";
42 private static final String STR_INSTALL_ZB_ADDRESS_CMD = "-install_zb_add";
43 private static final String STR_INSTALL_HOST_CMD = "-install_host";
44 private static final String STR_DELETE_ENTITY_CMD = "-delete_ent";
45 private static final String STR_DELETE_ADDRESS_CMD = "-delete_add";
46 private static final String STR_DELETE_DEV_ADD_CMD = "-delete_dev_add";
47 private static final String STR_DELETE_ZB_ADD_CMD = "-delete_zb_add";
48 private static final String STR_DELETE_HOST_CMD = "-delete_host";
49 private static final String STR_HELP_CMD = "-help";
54 public IoTInstaller() {
56 // Make this not verbose by default
57 tbl = new Table(false);
58 System.out.println("IoTInstaller: Initializing installation..");
62 * A method to insert a new entry to the main table (IoTMain)
64 * This entry can be a new device or a new entity that we should keep track about
65 * A new entry will need a unique ID and a type name from the driver
67 * @param strID string ID to insert device into the main table
68 * @param strType string type to insert device into the main table
71 private void insertMainDBEntry(String strID, String strType) {
73 // Creating String array
74 String[] strFlds = new String[2];
75 for(int i=0; i<2; i++) {
76 strFlds[i] = new String();
81 // Insert entry through Table object
82 tbl.setTableName(STR_MAIN_TABLE_NAME);
83 tbl.insertEntry(strFlds);
84 System.out.println("IoTInstaller: Inserting a new entry into main table");
88 * A method to extract device/entity information from the user
90 * Users are supposed to supply the information needed for installation
92 * @param strCfgFileName String config file name for device/entity
95 public void extractTableAndInstall(String strCfgFileName) {
96 // TO DO: WE PROBABLY NEED TO IMPROVE THE FILE PARSING BUT FOR NOW KEEP IT MINIMUM
100 // Parse configuration file
101 // Assumption here is that .config file is written with the correct syntax (need typechecking)
102 File file = new File(strCfgFileName);
103 Scanner scanFile = new Scanner(new FileReader(file));
104 System.out.println("IoTInstaller: Extracting information from config file: " + strCfgFileName);
106 // Initialize String for ID and TYPE
109 String strTypeSpecific = "";
111 // Initialize TableProperty for devices and specific devices
113 // e.g. ProximitySensor - table of many ProximitySensor devices
114 // ProximitySensorBrandA - table that contains the constructor
115 // information for a specific device
116 TableProperty[] tpDevice = new TableProperty[1];
117 TableProperty[] tpDeviceSpecific = new TableProperty[1];
119 // Initialize array of string
120 String[] strFields = new String[1];
121 String[] strFieldsSpecific = new String[1];
123 // String for scanning the file
126 // Store number of fields here
128 while (scanFile.hasNext()) {
130 strScan = scanFile.next();
131 if (strScan.equals("IoTMain")) {
133 while (scanFile.hasNext()) {
134 strScan = scanFile.next();
137 if (strScan.equals("ID")) {
138 strID = scanFile.next();
141 else if (strScan.equals("TYPE")) {
142 strType = scanFile.next();
145 else if (strScan.equals("TYPESPECIFIC")) {
146 strTypeSpecific = scanFile.next();
147 } else if (strScan.equals("END")) {
152 } else if (strScan.equals("Table")) {
154 // Get number of fields, e.g. Table 3
155 iFields = scanFile.nextInt();
157 // We have device ID and device specific names
158 // e.g. ID = PS1; TYPE
159 tpDevice = new TableProperty[2];
160 tpDevice[0] = new TableProperty();
161 tpDevice[0].setField("ID");
162 tpDevice[0].setType("VARCHAR");
163 tpDevice[0].setLength("5");
164 tpDevice[1] = new TableProperty();
165 tpDevice[1].setField("TYPE");
166 tpDevice[1].setType("VARCHAR");
167 tpDevice[1].setLength("30");
169 // Prepare properties for a specific device
170 tpDeviceSpecific = new TableProperty[iFields];
171 for (int i=0; i<iFields; i++) {
172 tpDeviceSpecific[i] = new TableProperty();
174 // Looping over the fields
175 strScan = scanFile.next();
176 tpDeviceSpecific[i].setField(strScan);
177 strScan = scanFile.next();
178 tpDeviceSpecific[i].setType(strScan);
179 strScan = scanFile.next();
180 tpDeviceSpecific[i].setLength(strScan);
182 } else if (strScan.equals("Data")) {
184 // Get the device information
185 strFields = new String[2];
186 strFields[0] = strID;
187 strFields[1] = strTypeSpecific;
189 if ((tpDeviceSpecific.length == 1) &&
190 (tpDeviceSpecific[0].getField().equals("EMPTY"))) {
192 // Get the fields for specific device
193 strFieldsSpecific = null;
194 System.out.println("IoTInstaller: Empty constructor for: " + strTypeSpecific);
198 // Get the fields for specific device
199 strFieldsSpecific = new String[iFields];
200 for (int i=0; i<iFields; i++) {
201 strScan = scanFile.next();
202 strFieldsSpecific[i] = strScan;
208 installNewEntity(strType, strTypeSpecific, strID, tpDevice,
209 tpDeviceSpecific, strFields, strFieldsSpecific);
210 System.out.println("IoTInstaller: Installing a new entity/device into the system");
212 } catch (FileNotFoundException ex) {
214 System.out.println("IoTInstaller: Exception: ");
215 ex.printStackTrace();
221 * A method to install a new entity/device into the database
223 * 1) Insert this device/entity into the main table IoTMain
224 * 2) Create a new device/entity table if it doesn't exist yet
225 * 3) Insert this entry into the specific device/entity table
227 * @param strType String device type
228 * @param strTypeSpecific String device specific type
229 * @param strID String unique device/entity ID
230 * @param tpDevice array of TableProperty to construct the new table
231 * @param tpDeviceSpecific array of TableProperty to construct the new table
232 * @param strFields field values of device table
233 * @param strFieldsSpecific field values of device specific table
235 private void installNewEntity(String strType, String strTypeSpecific, String strID,
236 TableProperty[] tpDevice, TableProperty[] tpDeviceSpecific, String[] strFields, String[] strFieldsSpecific) {
238 // Create a new IoTInstaller object
239 System.out.println("IoTInstaller: Installing device " + strType + " with specific type " + strTypeSpecific);
240 tbl.setTableName(strType);
242 // 1) Insert this device/entity into the main table IoTMain
243 insertMainDBEntry(strID, strType);
246 // 2) Create a new device/entity table if it doesn't exist yet
247 tbl.setTableName(strType);
248 if (tbl.isTableExisting()) {
250 System.out.println("IoTInstaller: Table " + strType + " exists.. just insert new entry!");
252 // table does not exist yet
253 tbl.createTable(tpDevice, "ID");
256 // 3) Insert this entry into the device/entity table
257 tbl.insertEntry(strFields);
259 // Device specific table
260 // 2) Create a new device/entity table if it doesn't exist yet
261 // P.S. We should assume that table doesn't exist yet, and we throw error otherwise!
262 tbl.setTableName(strTypeSpecific + strID);
263 tbl.createTable(tpDeviceSpecific, null);
265 // 3) Insert this entry into the device/entity table
266 if (strFieldsSpecific != null) {
267 tbl.insertEntry(strFieldsSpecific);
272 * A method to extract device/entity communication configuration from the user
274 * Users are supposed to supply the information needed for installation
276 * @param strCfgFileName String config file name for device/entity
279 public void extractCommAndInstall(String strCfgFileName) {
280 // TODO: WE PROBABLY NEED TO IMPROVE THE FILE PARSING BUT FOR NOW KEEP IT MINIMUM
284 // Parse configuration file
285 // Assumption here is that .config file is written with the correct syntax (need typechecking)
286 File file = new File(strCfgFileName);
287 Scanner scanFile = new Scanner(new FileReader(file));
289 System.out.println("IoTInstaller: Extracting information from config file: " + strCfgFileName);
294 // Initialize array of string
295 String[] strFields = new String[INT_NUM_COMM_FIELDS];
296 for(int i=0; i<INT_NUM_COMM_FIELDS; i++) {
297 strFields[i] = new String();
299 while (scanFile.hasNext() && (iFieldCnt < INT_NUM_COMM_FIELDS)) {
301 strFields[iFieldCnt++] = scanFile.next();
304 // Create a new installer object
305 tbl.setTableName(STR_COMM_TABLE_NAME);
306 tbl.insertEntry(strFields);
308 System.out.println("IoTInstaller: Installing a new communication pattern into the system");
310 } catch (FileNotFoundException ex) {
312 System.out.println("IoTInstaller: Exception: ");
313 ex.printStackTrace();
319 * A method to extract device/entity addresses information
321 * Users are supposed to supply the information needed for installation
323 * @param strCfgFileName String config file name for device/entity
326 public void installDeviceAddress(String strCfgFileName) {
330 // Parse configuration file
331 Properties prop = new Properties();
332 File file = new File(strCfgFileName);
333 FileInputStream fis = new FileInputStream(file);
336 } catch (IOException ex) {
337 ex.printStackTrace();
339 System.out.println("IoTInstaller: Extracting information from config file: " + strCfgFileName);
341 // We can only install one device address per one time with the following sequence
342 String[] strFields = new String[2];
343 String[] strFieldsAddress = null;
344 // Check for wildcard feature
345 if ((prop.getProperty("SOURCEWILDCARD", null) != null) &&
346 (prop.getProperty("DESTWILDCARD", null) != null)) {
347 strFieldsAddress = new String[5];
348 strFieldsAddress[3] = prop.getProperty("SOURCEWILDCARD");
349 strFieldsAddress[4] = prop.getProperty("DESTWILDCARD");
351 strFieldsAddress = new String[3];
353 strFields[0] = prop.getProperty("ID");
354 strFields[1] = prop.getProperty("ADDRESSFOR");
355 strFieldsAddress[0] = prop.getProperty("DEVICEADDRESS");
356 strFieldsAddress[1] = prop.getProperty("PORTNUMBER");
357 strFieldsAddress[2] = prop.getProperty("PROTOCOL");
359 // Insert this entry into the main device address table
360 tbl.setTableName(STR_DEV_ADD_TABLE_NAME);
361 tbl.insertEntry(strFields);
363 // Create a new table for a specific device address
364 // e.g. AmcrestCameraAdd + CM1 = AmcrestCameraAddCM1
365 tbl.setTableName(strFields[1] + strFields[0]);
367 // Table does not exist yet
368 // Set TableProperty for device address (MAC address)
369 TableProperty[] tp = null;
370 // Check for wildcard feature
371 if (strFieldsAddress.length == 5) {
372 tp = new TableProperty[5];
373 tp[3] = new TableProperty();
374 tp[3].setField("SOURCEWILDCARD");
375 tp[3].setType("VARCHAR");
376 tp[3].setLength("5");
377 tp[4] = new TableProperty();
378 tp[4].setField("DESTWILDCARD");
379 tp[4].setType("VARCHAR");
380 tp[4].setLength("5");
382 tp = new TableProperty[3];
384 tp[0] = new TableProperty();
385 tp[0].setField("DEVICEADDRESS");
386 tp[0].setType("VARCHAR");
387 tp[0].setLength("20");
388 tp[1] = new TableProperty();
389 tp[1].setField("PORTNUMBER");
390 tp[1].setType("INT");
391 tp[1].setLength("11");
392 tp[2] = new TableProperty();
393 tp[2].setField("PROTOCOL");
394 tp[2].setType("VARCHAR");
395 tp[2].setLength("5");
396 tbl.createTable(tp, "DEVICEADDRESS");
398 // Insert new address entry
399 tbl.insertEntry(strFieldsAddress);
401 System.out.println("IoTInstaller: Installing a new device/entity address into the system");
403 } catch (FileNotFoundException ex) {
405 System.out.println("IoTInstaller: Exception: ");
406 ex.printStackTrace();
412 * A method to extract Zigbee device addresses information
414 * Users are supposed to supply the information needed for installation
416 * @param strCfgFileName String config file name for device/entity
419 public void installZigbeeAddress(String strCfgFileName) {
423 // Parse configuration file
424 Properties prop = new Properties();
425 File file = new File(strCfgFileName);
426 FileInputStream fis = new FileInputStream(file);
429 } catch (IOException ex) {
430 ex.printStackTrace();
432 System.out.println("IoTInstaller: Extracting information from config file: " + strCfgFileName);
434 // We can only install one device address per one time with the following sequence
435 String[] strFields = new String[2];
436 String[] strFieldsAddress = new String[1];
437 strFields[0] = prop.getProperty("ID");
438 strFields[1] = prop.getProperty("ADDRESSFOR");
439 strFieldsAddress[0] = prop.getProperty("DEVICEADDRESS");
441 // Insert this entry into the main device address table
442 tbl.setTableName(STR_ZB_ADD_TABLE_NAME);
443 tbl.insertEntry(strFields);
445 // Create a new table for a specific device address
446 // e.g. AmcrestCameraZBAdd + CM1 = AmcrestCameraZBAddCM1
447 tbl.setTableName(strFields[1] + strFields[0]);
449 // Table does not exist yet
450 // Set TableProperty for device address (MAC address)
451 TableProperty[] tp = new TableProperty[1];
452 tp[0] = new TableProperty();
453 tp[0].setField("DEVICEADDRESS");
454 tp[0].setType("VARCHAR");
455 tp[0].setLength("25");
456 tbl.createTable(tp, "DEVICEADDRESS");
458 // Insert new address entry
459 tbl.insertEntry(strFieldsAddress);
461 System.out.println("IoTInstaller: Installing a new device/entity address into the system");
463 } catch (FileNotFoundException ex) {
465 System.out.println("IoTInstaller: Exception: ");
466 ex.printStackTrace();
473 * A method to extract simple addresses information, e.g. www.google.com
475 * Users are supposed to supply the information needed for installation
477 * @param strCfgFileName String config file name for device/entity
480 public void installAddress(String strCfgFileName) {
484 // Parse configuration file
485 Properties prop = new Properties();
486 File file = new File(strCfgFileName);
487 FileInputStream fis = new FileInputStream(file);
490 } catch (IOException ex) {
491 ex.printStackTrace();
493 System.out.println("IoTInstaller: Extracting information from config file: " + strCfgFileName);
495 // We can only install one device address per one time with the following sequence
496 String[] strFields = new String[2];
497 String[] strFieldsAddress = new String[1];
498 strFields[0] = prop.getProperty("ID");
499 strFields[1] = prop.getProperty("ADDRESSFOR");
500 strFieldsAddress[0] = prop.getProperty("ADDRESS");
502 // Insert this entry into the main device address table
503 tbl.setTableName(STR_ADDRESS_TABLE_NAME);
504 tbl.insertEntry(strFields);
506 // Create a new table for a specific device address
507 // e.g. WeatherForecastAdd + WF1 = WeatherForecastAddCM1
508 tbl.setTableName(strFields[1] + strFields[0]);
510 // Table does not exist yet
511 // Set TableProperty for device address (MAC address)
512 TableProperty[] tp = new TableProperty[1];
513 tp[0] = new TableProperty();
514 tp[0].setField("ADDRESS");
515 tp[0].setType("VARCHAR");
516 tp[0].setLength("50");
517 tbl.createTable(tp, "ADDRESS");
519 // Insert new address entry
520 tbl.insertEntry(strFieldsAddress);
522 System.out.println("IoTInstaller: Installing a new device/entity address into the system");
524 } catch (FileNotFoundException ex) {
526 System.out.println("IoTInstaller: Exception: ");
527 ex.printStackTrace();
533 * A method to extract host information for host installation
535 * Users are supposed to supply the information needed for installation
537 * @param strCfgFileName String config file name for device/entity
540 public void installHost(String strCfgFileName) {
542 // Parse configuration file
543 Properties prop = new Properties();
544 File file = new File(strCfgFileName);
545 FileInputStream fis = new FileInputStream(file);
548 } catch (IOException ex) {
549 ex.printStackTrace();
551 System.out.println("IoTInstaller: Extracting information from config file: " + strCfgFileName);
552 // Initialize array of string
553 String[] strFields = new String[3];
554 strFields[0] = prop.getProperty("HOSTADDRESS");
555 strFields[1] = prop.getProperty("PROCESSOR");
556 strFields[2] = prop.getProperty("MEMORY");
557 // Create a new installer object
558 tbl.setTableName(STR_HOST_TABLE_NAME);
559 tbl.insertEntry(strFields);
561 System.out.println("IoTInstaller: Installing a new host into the system");
563 } catch (FileNotFoundException ex) {
565 System.out.println("IoTInstaller: Exception: ");
566 ex.printStackTrace();
572 * A method to delete host information from database by putting in host address
574 * @param strHostAddress String for host address
577 public void deleteHost(String strHostAddress) {
579 tbl.setTableName(STR_HOST_TABLE_NAME);
580 String strWhere = "HOSTADDRESS='" + strHostAddress + "';";
581 tbl.deleteEntry(strWhere);
583 System.out.println("IoTInstaller: Deleting a host from the system");
587 * A method to delete entity information from database
589 * @param strEntID String for entity ID
590 * @param strEntType String for entity type
591 * @param strEntName String for entity name
594 public void deleteEntity(String strEntID, String strEntType, String strEntName) {
596 // Delete from table IoTMain
597 tbl.setTableName(STR_MAIN_TABLE_NAME);
598 String strWhere = "ID='" + strEntID + "';";
599 tbl.deleteEntry(strWhere);
600 System.out.println("IoTInstaller: Removing entity from table " + STR_MAIN_TABLE_NAME);
602 // Delete from table with type name, e.g. Camera
603 tbl.setTableName(strEntType);
604 strWhere = "ID='" + strEntID + "';";
605 tbl.deleteEntry(strWhere);
606 System.out.println("IoTInstaller: Removing entity from table type: " + strEntType);
607 // Drop table if this was the last entry
608 if (tbl.isTableEmpty()) {
610 System.out.println("IoTInstaller: Dropping the table.. It was the last entry!");
613 // Drop the table that contains constructor information
614 tbl.setTableName(strEntName + strEntID);
616 System.out.println("IoTInstaller: Dropping class constructor table...");
618 System.out.println("IoTInstaller: Deleting an entry from the system...");
622 * A method to delete address information from database
624 * @param strTableName String for main table, i.e. IoTAddress, IoTDeviceAddress, or IoTZigbeeAddress
625 * @param strEntID String for entity ID, e.g. CM1
626 * @param strEntAddType String for entity address type, e.g. AmcrestCameraAdd
629 public void deleteAddress(String strTableName, String strEntID, String strEntAddType) {
631 // Delete from main table, e.g. IoTAddress, IoTDeviceAddress, or IoTZigbeeAddress
632 tbl.setTableName(strTableName);
633 String strWhere = "ID='" + strEntID + "';";
634 tbl.deleteEntry(strWhere);
635 System.out.println("IoTInstaller: Removing entity from table " + strTableName);
637 // Drop the table that contains constructor information
638 tbl.setTableName(strEntAddType + strEntID);
640 System.out.println("IoTInstaller: Dropping class constructor table...");
642 System.out.println("IoTInstaller: Deleting an entry from the system...");
647 * A method to install a pair of new devices with their communication pattern
649 * @param strFirstDeviceFile String that contains the file name of the fist device
650 * @param strSecondDeviceFile String that contains the file name of the second device
651 * @param strCommFile String that contains the file name of the communication file
654 public void installPairOfEntities(String strFirstEntityFile,
655 String strSecondEntityFile, String strCommFile) {
656 // TODO: NEED TO DO THE INPUT FAILURE CHECKING HERE
657 // NOW JUST ASSUME THAT THE INPUT FILES ARE GOOD
659 extractTableAndInstall(strFirstEntityFile);
660 extractTableAndInstall(strSecondEntityFile);
661 extractCommAndInstall(strCommFile);
665 * A method to output help messages
669 private void helpMessages() {
670 System.out.println();
671 System.out.println("IoTInstaller: Command line options:");
672 System.out.println("IoTInstaller: 1) Install one device, e.g. java iotinstaller.IoTInstaller -install_ent <filename>");
673 System.out.println("IoTInstaller: 2) Install comm pattern, e.g. java iotinstaller.IoTInstaller -install_comm <filename>");
674 System.out.print("IoTInstaller: 3) Install two devices and comm pattern, e.g. java iotinstaller.IoTInstaller ");
675 System.out.println("-install_comp <first_entity_filename> <second_entity_filename> <communication_filename>");
676 System.out.println("IoTInstaller: 4) Install address, e.g. java iotinstaller.IoTInstaller -install_add <filename>");
677 System.out.println("IoTInstaller: 5) Install device address, e.g. java iotinstaller.IoTInstaller -install_dev_add <filename>");
678 System.out.println("IoTInstaller: 6) Install zigbee device address, e.g. java iotinstaller.IoTInstaller -install_zb_add <filename>");
679 System.out.println("IoTInstaller: 7) Install host, e.g. java iotinstaller.IoTInstaller -install_host <filename>");
680 System.out.println("IoTInstaller: 8) Delete entity, e.g. java iotinstaller.IoTInstaller -delete_ent <ent_id> <ent_type> <ent_name>");
681 System.out.println("IoTInstaller: 9) Delete address, e.g. java iotinstaller.IoTInstaller -delete_add <ent_id>");
682 System.out.println("IoTInstaller: 10) Delete device address, e.g. java iotinstaller.IoTInstaller -delete_dev_add <ent_id>");
683 System.out.println("IoTInstaller: 11) Delete zigbee device address, e.g. java iotinstaller.IoTInstaller -delete_zb_add <ent_id>");
684 System.out.println("IoTInstaller: 12) Delete host, e.g. java iotinstaller.IoTInstaller -delete_host <host_address>");
685 System.out.println("IoTInstaller: Type 'java iotinstaller.IoTInstaller -help' to display this help.");
686 System.out.println();
690 * Main method that accepts inputs for installation
692 * @param args[0] String that contains the command line parameter
693 * @param args[1] String that contains the first file name / entity ID / host address
694 * @param args[2] String that contains the second file name
695 * @param args[3] String that contains the third file name
698 public static void main(String[] args) {
700 // Testing IoTInstaller object
701 IoTInstaller iotinst = new IoTInstaller();
703 // TODO: PROBABLY NEED A BETTER ERROR HANDLING FOR INPUTS HERE
704 // NOW ASSUME MINIMAL ERROR FOR INPUTS
705 if (args.length > 0) {
706 // Check for input parameters
707 if (args[0].equals(STR_INSTALL_ENTITY_CMD)) {
708 iotinst.extractTableAndInstall(args[1]);
710 } else if (args[0].equals(STR_INSTALL_COMMUNICATION_CMD)) {
711 iotinst.extractCommAndInstall(args[1]);
713 } else if (args[0].equals(STR_INSTALL_COMPLETE_CMD)) {
714 iotinst.installPairOfEntities(args[1], args[2], args[3]);
716 } else if (args[0].equals(STR_INSTALL_ADDRESS_CMD)) {
717 iotinst.installAddress(args[1]);
719 } else if (args[0].equals(STR_INSTALL_DEV_ADDRESS_CMD)) {
720 iotinst.installDeviceAddress(args[1]);
722 } else if (args[0].equals(STR_INSTALL_ZB_ADDRESS_CMD)) {
723 iotinst.installZigbeeAddress(args[1]);
725 } else if (args[0].equals(STR_INSTALL_HOST_CMD)) {
726 iotinst.installHost(args[1]);
728 } else if (args[0].equals(STR_DELETE_ENTITY_CMD)) {
729 iotinst.deleteEntity(args[1], args[2], args[3]);
731 } else if (args[0].equals(STR_DELETE_ADDRESS_CMD)) {
732 iotinst.deleteAddress(STR_ADDRESS_TABLE_NAME, args[1], args[2]);
734 } else if (args[0].equals(STR_DELETE_DEV_ADD_CMD)) {
735 iotinst.deleteAddress(STR_DEV_ADD_TABLE_NAME, args[1], args[2]);
737 } else if (args[0].equals(STR_DELETE_ZB_ADD_CMD)) {
738 iotinst.deleteAddress(STR_ZB_ADD_TABLE_NAME, args[1], args[2]);
740 } else if (args[0].equals(STR_DELETE_HOST_CMD)) {
741 iotinst.deleteHost(args[1]);
743 } else if (args[0].equals(STR_HELP_CMD)) {
744 iotinst.helpMessages();
747 System.out.println("IoTInstaller: ERROR: Wrong input parameters!");
748 iotinst.helpMessages();
751 System.out.println("IoTInstaller: ERROR: No input parameters detected!");
752 iotinst.helpMessages();