From d5670ab3ce3e0f1cc3a860cc19cb719122b4c58f Mon Sep 17 00:00:00 2001 From: rtrimana Date: Wed, 22 Feb 2017 13:42:48 -0800 Subject: [PATCH] Removing callback port feature from master and slave --- iotjava/iotruntime/cpp/iotslave/IoTSlave.cpp | 17 ---- iotjava/iotruntime/cpp/iotslave/IoTSlave.hpp | 2 - .../master/CommunicationHandler.java | 64 --------------- iotjava/iotruntime/master/IoTMaster.java | 63 +++------------ .../iotruntime/master/ObjectInitHandler.java | 9 +-- iotjava/iotruntime/master/ObjectInitInfo.java | 11 +-- .../iotruntime/messages/MessageGetObject.java | 23 +----- iotjava/iotruntime/slave/IoTSlave.java | 81 ------------------- localconfig/iotruntime/IoTMaster.config | 3 - 9 files changed, 17 insertions(+), 256 deletions(-) diff --git a/iotjava/iotruntime/cpp/iotslave/IoTSlave.cpp b/iotjava/iotruntime/cpp/iotslave/IoTSlave.cpp index e4d4864..89d9997 100644 --- a/iotjava/iotruntime/cpp/iotslave/IoTSlave.cpp +++ b/iotjava/iotruntime/cpp/iotslave/IoTSlave.cpp @@ -246,9 +246,6 @@ void IoTSlave::instantiateSkelObject() { void* params[SKELPARAMSIZE]; params[0] = objMainCls; - //string callbackAddress = LOCALHOST; - //params[1] = &callbackAddress; - //params[2] = &objectStubPort; params[1] = &objectStubPort; params[2] = &objectRegPort; writeToFile("Skeleton Object " + objectSkelClass + " created for " + objectClassName); @@ -264,15 +261,10 @@ void IoTSlave::instantiateStubObject() { params[0] = &objectStubPort; params[1] = &objectRegPort; params[2] = &hostAddress; - //params[0] = &objectStubPort; - //params[1] = &hostAddress; - //string callbackAddress = LOCALHOST; - //params[2] = &callbackAddress; int rev = 0; params[3] = &rev; bool result = false; params[4] = &result; - //params[5] = ports; writeToFile("Stub Object " + objectStubClass + " created for " + objectClassName); writeToFile("Success 1!"); objStubCls = create_object(params); @@ -489,8 +481,6 @@ void IoTSlave::createStub() { instantiateStubObject(); mapObjNameStub.insert(make_pair(objectName,objStubCls)); writeToFile("=> Map has: " + to_string(mapObjNameStub.size()) + " members"); - // vector for ports has been copied - now delete it - delete ports; } } @@ -559,13 +549,6 @@ void IoTSlave::getIoTSetRelationObject() { writeToFile("=> Driver object registry port: " + to_string(objectRegPort)); objectStubPort = recvInteger(); sendAck(); writeToFile("=> Driver object stub port: " + to_string(objectStubPort)); - int numOfPorts = recvInteger(); sendAck(); - ports = new vector(); - for (int i = 0; i < numOfPorts; i++) { - int port = recvInteger(); sendAck(); - ports->push_back(port); - writeToFile("==> Got a new port: " + to_string(port)); - } } diff --git a/iotjava/iotruntime/cpp/iotslave/IoTSlave.hpp b/iotjava/iotruntime/cpp/iotslave/IoTSlave.hpp index 1d14eac..834580a 100644 --- a/iotjava/iotruntime/cpp/iotslave/IoTSlave.hpp +++ b/iotjava/iotruntime/cpp/iotslave/IoTSlave.hpp @@ -60,7 +60,6 @@ class IoTSlave { // Constants const static int RCVBUFSIZE = 1024; // Size of receive buffer const static int SKELPARAMSIZE = 3; // Number of params for skeleton - //const static int STUBPARAMSIZE = 6; // Number of params for stub const static int STUBPARAMSIZE = 5; // Number of params for stub const static string FILEPATH; // File path const static string FILEEXT; // File extension @@ -85,7 +84,6 @@ class IoTSlave { string objectStubClass; // Need to send from Java IoTSlave: sMessage.getObjectStubInterfaceName() + STUB_CLASS_SUFFIX int objectRegPort; int objectStubPort; - vector* ports; // Now used to contain callback ports string objectFieldName; // Field name that is going to be initialized with IoTSet or IoTRelation unordered_set* isetObject; // Set of object IoTSet* iotsetObject; // IoTSet of object diff --git a/iotjava/iotruntime/master/CommunicationHandler.java b/iotjava/iotruntime/master/CommunicationHandler.java index def3e77..15db690 100644 --- a/iotjava/iotruntime/master/CommunicationHandler.java +++ b/iotjava/iotruntime/master/CommunicationHandler.java @@ -67,8 +67,6 @@ public final class CommunicationHandler { private Map hmRMIRegPort; private Map hmRMIStubPort; private Set hsDevicePort; - private Set hsCallbackPort; - private Map hmCallbackPort; private Map hmAdditionalPort; private int iNumOfObjects; private int iNumOfHosts; @@ -98,8 +96,6 @@ public final class CommunicationHandler { hmRMIRegPort = new HashMap(); hmRMIStubPort = new HashMap(); hsDevicePort = new HashSet(); - hsCallbackPort = new HashSet(); - hmCallbackPort = new HashMap(); hmAdditionalPort = new HashMap(); iNumOfObjects = 0; iNumOfHosts = 0; @@ -186,61 +182,6 @@ public final class CommunicationHandler { listObjCrtInfo.add(objCrtInfo); } - - /** - * Method getCallbackPort() - *

- * Get a new port for new connections for callback objects in the program. - * This newly generated port number will be recorded. - * - * @return int[] A set of callback ports - */ - public int[] getCallbackPorts(int numOfPorts) { - - int[] ports = new int[numOfPorts]; - - for(int i = 0; i < numOfPorts; i++) { - do { - ports[i] = random.nextInt(INT_MAX_PORT - INT_MIN_PORT + 1) + INT_MIN_PORT; - // Check port existence in HashMap - } while (portIsAvailable(ports[i]) == false); - hsCallbackPort.add(ports[i]); - } - - return ports; - } - - - /** - * Method getCallbackPorts() - *

- * Get a set of new ports for new connections for callback objects in the program. - * This newly generated port number will be recorded. - * - * @return int[] A set of callback ports - */ - public Integer[] getCallbackPorts(String sAObject, int numOfPorts) { - - Integer[] ports = new Integer[numOfPorts]; - int iNumOfObject = hmActiveObj.get(sAObject); - - if (!hmCallbackPort.containsKey(iNumOfObject)) { - for(int i = 0; i < numOfPorts; i++) { - do { - ports[i] = random.nextInt(INT_MAX_PORT - INT_MIN_PORT + 1) + INT_MIN_PORT; - // Check port existence in HashMap - } while (portIsAvailable(ports[i]) == false); - hsCallbackPort.add(ports[i]); - } - hmCallbackPort.put(iNumOfObject, ports); - } else { - ports = hmCallbackPort.get(iNumOfObject); - } - - return ports; - } - - /** * Method addDevicePort() *

@@ -302,8 +243,6 @@ public final class CommunicationHandler { return false; } else if (hsDevicePort.contains(iPortNumber) == true) { return false; - } else if (hsCallbackPort.contains(iPortNumber) == true) { - return false; } else { return true; } @@ -523,9 +462,6 @@ public final class CommunicationHandler { RuntimeOutput.print("\n", bVerbose); } } - for(Integer i : hsCallbackPort) - RuntimeOutput.print("RMI callback Port: " + i, bVerbose); - RuntimeOutput.print("\n", bVerbose); for(int iPort : hsDevicePort) { RuntimeOutput.print("Device Port: " + iPort, bVerbose); diff --git a/iotjava/iotruntime/master/IoTMaster.java b/iotjava/iotruntime/master/IoTMaster.java index 5fb9178..6a66039 100644 --- a/iotjava/iotruntime/master/IoTMaster.java +++ b/iotjava/iotruntime/master/IoTMaster.java @@ -96,7 +96,6 @@ public class IoTMaster { private static String STR_ZB_GATEWAY_ADDRESS; private static String STR_ZB_GATEWAY_PORT; private static String STR_ZB_IOTMASTER_PORT; - private static String STR_NUM_CALLBACK_PORTS; private static String STR_JVM_INIT_HEAP_SIZE; private static String STR_JVM_MAX_HEAP_SIZE; private static String STR_LANGUAGE_CONTROLLER; @@ -188,7 +187,6 @@ public class IoTMaster { STR_ZB_GATEWAY_ADDRESS = null; STR_ZB_GATEWAY_PORT = null; STR_ZB_IOTMASTER_PORT = null; - STR_NUM_CALLBACK_PORTS = null; STR_JVM_INIT_HEAP_SIZE = null; STR_JVM_MAX_HEAP_SIZE = null; STR_LANGUAGE_CONTROLLER = null; @@ -247,10 +245,8 @@ public class IoTMaster { STR_ZB_GATEWAY_ADDRESS = prop.getProperty("ZIGBEE_GATEWAY_ADDRESS"); STR_ZB_GATEWAY_PORT = prop.getProperty("ZIGBEE_GATEWAY_PORT"); STR_ZB_IOTMASTER_PORT = prop.getProperty("ZIGBEE_IOTMASTER_PORT"); - STR_NUM_CALLBACK_PORTS = prop.getProperty("NUMBER_CALLBACK_PORTS"); STR_JVM_INIT_HEAP_SIZE = prop.getProperty("JVM_INIT_HEAP_SIZE"); STR_JVM_MAX_HEAP_SIZE = prop.getProperty("JVM_MAX_HEAP_SIZE"); - //STR_LANGUAGE = prop.getProperty("LANGUAGE"); STR_SKEL_CLASS_SUFFIX = prop.getProperty("SKEL_CLASS_SUFFIX"); STR_STUB_CLASS_SUFFIX = prop.getProperty("STUB_CLASS_SUFFIX"); if(prop.getProperty("VERBOSE").equals(STR_YES)) { @@ -273,10 +269,8 @@ public class IoTMaster { RuntimeOutput.print("STR_ZB_GATEWAY_ADDRESS=" + STR_ZB_GATEWAY_ADDRESS, BOOL_VERBOSE); RuntimeOutput.print("STR_ZB_GATEWAY_PORT=" + STR_ZB_GATEWAY_PORT, BOOL_VERBOSE); RuntimeOutput.print("STR_ZB_IOTMASTER_PORT=" + STR_ZB_IOTMASTER_PORT, BOOL_VERBOSE); - RuntimeOutput.print("STR_NUM_CALLBACK_PORTS=" + STR_NUM_CALLBACK_PORTS, BOOL_VERBOSE); RuntimeOutput.print("STR_JVM_INIT_HEAP_SIZE=" + STR_JVM_INIT_HEAP_SIZE, BOOL_VERBOSE); RuntimeOutput.print("STR_JVM_MAX_HEAP_SIZE=" + STR_JVM_MAX_HEAP_SIZE, BOOL_VERBOSE); - //RuntimeOutput.print("STR_LANGUAGE=" + STR_LANGUAGE, BOOL_VERBOSE); RuntimeOutput.print("STR_SKEL_CLASS_SUFFIX=" + STR_SKEL_CLASS_SUFFIX, BOOL_VERBOSE); RuntimeOutput.print("STR_STUB_CLASS_SUFFIX=" + STR_STUB_CLASS_SUFFIX, BOOL_VERBOSE); RuntimeOutput.print("BOOL_VERBOSE=" + BOOL_VERBOSE, BOOL_VERBOSE); @@ -628,35 +622,8 @@ public class IoTMaster { STR_TCP_PROTOCOL, commHan.getRMIStubPort(strObjName)); routerConfig.configureHostMainPolicies(strIoTSlaveObjectHostAdd, strIoTSlaveControllerHostAdd, strIoTSlaveObjectHostAdd, STR_TCP_PROTOCOL, commHan.getRMIStubPort(strObjName)); - // Send the same set of routing policies for callback ports - setCallbackPortsPolicy(strObjName, STR_ROUTER_ADD, strIoTSlaveControllerHostAdd, strIoTSlaveObjectHostAdd, STR_TCP_PROTOCOL); } - /** - * A private method to set router policies for callback ports - * - * @params strRouterAdd String router address - * @params strIoTSlaveControllerHostAdd String slave controller host address - * @params strIoTSlaveObjectHostAdd String slave object host address - * @params strProtocol String protocol - * @return iPort Integer port number - */ - private void setCallbackPortsPolicy(String strObjName, String strRouterAdd, String strIoTSlaveControllerHostAdd, - String strIoTSlaveObjectHostAdd, String strProtocol) { - - int iNumCallbackPorts = Integer.parseInt(STR_NUM_CALLBACK_PORTS); - Integer[] rmiCallbackPorts = commHan.getCallbackPorts(strObjName, iNumCallbackPorts); - - // Iterate over port numbers and set up policies - for (int i=0; i list = listFieldToObject.get(iFieldIndex); // Create a new ObjectInitInfo for a new object in the field ObjectInitInfo objInitInfo = new ObjectInitInfo(strIoTSlaveObjectHostAdd, strObjName, - strObjClassName, strObjClassInterfaceName, strObjStubClsIntfaceName, iRMIRegPort, iRMIStubPort, iRMICallbackPorts); + strObjClassName, strObjClassInterfaceName, strObjStubClsIntfaceName, iRMIRegPort, iRMIStubPort); // Add the new ObjectInitInfo list.add(objInitInfo); } @@ -150,7 +149,7 @@ public final class ObjectInitHandler { */ public void addSecondObjectIntoField(String strField, String strIoTSlaveObjectHostAdd, String strObjName, String strObjClassName, String strObjClassInterfaceName, - String strObjStubClsIntfaceName, int iRMIRegPort, int iRMIStubPort, Integer[] iRMICallbackPorts) { + String strObjStubClsIntfaceName, int iRMIRegPort, int iRMIStubPort) { // Get index of strField int iFieldIndex = listField.indexOf(strField); @@ -158,7 +157,7 @@ public final class ObjectInitHandler { List list = mapFieldToSecondObject.get(iFieldIndex); // Create a new ObjectInitInfo for a new object in the field ObjectInitInfo objInitInfo = new ObjectInitInfo(strIoTSlaveObjectHostAdd, strObjName, - strObjClassName, strObjClassInterfaceName, strObjStubClsIntfaceName, iRMIRegPort, iRMIStubPort, iRMICallbackPorts); + strObjClassName, strObjClassInterfaceName, strObjStubClsIntfaceName, iRMIRegPort, iRMIStubPort); // Add the new ObjectInitInfo list.add(objInitInfo); } diff --git a/iotjava/iotruntime/master/ObjectInitInfo.java b/iotjava/iotruntime/master/ObjectInitInfo.java index b40ad23..39b58dc 100644 --- a/iotjava/iotruntime/master/ObjectInitInfo.java +++ b/iotjava/iotruntime/master/ObjectInitInfo.java @@ -14,7 +14,6 @@ public class ObjectInitInfo extends ObjectCreationInfo { */ protected int iRMIRegPort; protected int iRMIStubPort; - protected Integer[] iRMICallbackPorts; /** @@ -22,12 +21,11 @@ public class ObjectInitInfo extends ObjectCreationInfo { */ public ObjectInitInfo(String _strIoTSlaveObjectHostAdd, String _strObjName, String _strObjClassName, String _strObjClassInterfaceName, String _strObjStubClsIntfaceName, - int _iRMIRegPort, int _iRMIStubPort, Integer[] _iRMICallbackPorts) { + int _iRMIRegPort, int _iRMIStubPort) { super(_strIoTSlaveObjectHostAdd, _strObjName, _strObjClassName, _strObjClassInterfaceName, _strObjStubClsIntfaceName); iRMIRegPort = _iRMIRegPort; iRMIStubPort = _iRMIStubPort; - iRMICallbackPorts = _iRMICallbackPorts; } /** @@ -43,11 +41,4 @@ public class ObjectInitInfo extends ObjectCreationInfo { public int getRMIStubPort() { return iRMIStubPort; } - - /** - * Method getRMICallbackPorts() - */ - public Integer[] getRMICallbackPorts() { - return iRMICallbackPorts; - } } diff --git a/iotjava/iotruntime/messages/MessageGetObject.java b/iotjava/iotruntime/messages/MessageGetObject.java index bd8504f..4a5e045 100644 --- a/iotjava/iotruntime/messages/MessageGetObject.java +++ b/iotjava/iotruntime/messages/MessageGetObject.java @@ -21,7 +21,6 @@ public class MessageGetObject extends Message { private String sObjStubIntName; private int iRMIRegPort; private int iRMIStubPort; - private Integer[] iRMICallbackPorts; private Object[] arrObjFields; private Class[] arrObjFldCls; @@ -29,7 +28,7 @@ public class MessageGetObject extends Message { * Class constructor (to tell IoTSlave controller to get objects for IoTSet/IoTRelation) */ public MessageGetObject(IoTCommCode sMsg, String sHAddress, String sOName, - String sOClass, String sOIName, String sOSIName, int iRRPort, int iRSPort, Integer[] iCBPort) { + String sOClass, String sOIName, String sOSIName, int iRRPort, int iRSPort) { super(sMsg); @@ -40,7 +39,6 @@ public class MessageGetObject extends Message { sObjStubIntName = sOSIName; iRMIRegPort = iRRPort; iRMIStubPort = iRSPort; - iRMICallbackPorts = iCBPort; } /** @@ -108,16 +106,6 @@ public class MessageGetObject extends Message { return iRMIStubPort; } - /** - - * getRMICallbackPorts() method - * - * @return Integer[] - */ - public Integer[] getRMICallbackPorts() { - return iRMICallbackPorts; - } - /** * setHostAddress() method * @@ -188,13 +176,4 @@ public class MessageGetObject extends Message { iRMIStubPort = iRSPort; } - /** - * setRMICallbackPorts() method - * - * @param iCBPort RMI callback port numbers - * @return void - */ - public void setRMICallbackPorts(Integer[] iCBPort) { - iRMICallbackPorts = iCBPort; - } } diff --git a/iotjava/iotruntime/slave/IoTSlave.java b/iotjava/iotruntime/slave/IoTSlave.java index 0b6401d..1a6fa9f 100644 --- a/iotjava/iotruntime/slave/IoTSlave.java +++ b/iotjava/iotruntime/slave/IoTSlave.java @@ -207,18 +207,6 @@ public class IoTSlave { private void createCapabBasedRMIJava(MessageCreateObject sMessage) throws ClassNotFoundException, NoSuchMethodException, UnknownHostException { - // TODO: DEBUG - System.out.println("\n\nDEBUG: Create capab based RMI here!"); - System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress()); - System.out.println("DEBUG: sMessage object class: " + sMessage.getObjectClass()); - System.out.println("DEBUG: sMessage object name: " + sMessage.getObjectName()); - System.out.println("DEBUG: sMessage interface name: " + sMessage.getObjectInterfaceName()); - System.out.println("DEBUG: sMessage reg port: " + sMessage.getRMIRegPort()); - System.out.println("DEBUG: sMessage stub port: " + sMessage.getRMIStubPort()); - System.out.println("DEBUG: sMessage object fields: " + Arrays.toString(sMessage.getObjectFields())); - System.out.println("DEBUG: sMessage object fields: " + Arrays.toString(sMessage.getObjectFldCls())); - System.out.println("\n\n"); - // Instantiate the skeleton and put in the object String strObjSkelName = STR_OBJ_CLS_PFX + "." + sMessage.getObjectClass() + "." + sMessage.getObjectInterfaceName() + SKEL_CLASS_SUFFIX; @@ -255,9 +243,6 @@ public class IoTSlave { RemoteException, AlreadyBoundException, IllegalAccessException, InvocationTargetException { - // TODO: DEBUG - System.out.println("\n\nDEBUG: CREATE DRIVER OBJECT!!!\n\n"); - // Translating into the actual Message class MessageCreateObject sMessage = (MessageCreateObject) sIoTMasterMsg; // Instantiate object using reflection @@ -342,10 +327,6 @@ public class IoTSlave { // Translating into the actual Message class MessageCreateMainObject sMessage = (MessageCreateMainObject) sIoTMasterMsg; - // TODO: DEBUG - System.out.println("\n\nDEBUG: CREATE MAIN OBJECT!!!"); - System.out.println("DEBUG: sMessage object name: " + sMessage.getObjectName()); - // Getting controller class File file = new File(STR_JAR_FILE_PATH + sMessage.getObjectName() + STR_JAR_FILE_EXT); RuntimeOutput.print("IoTSlave: DEBUG print path: " + STR_JAR_FILE_PATH + @@ -374,10 +355,6 @@ public class IoTSlave { // Translating into the actual Message class MessageCreateSetRelation sMessage = (MessageCreateSetRelation) sIoTMasterMsg; - // TODO: DEBUG - System.out.println("\n\nDEBUG: CREATE NEW IOT SET!!!"); - System.out.println("DEBUG: sMessage object field name: " + sMessage.getObjectFieldName()); - // Initialize field name strFieldName = sMessage.getObjectFieldName(); RuntimeOutput.print("IoTSlave: Setting up field " + strFieldName, BOOL_VERBOSE); @@ -401,10 +378,6 @@ public class IoTSlave { // Translating into the actual Message class MessageCreateSetRelation sMessage = (MessageCreateSetRelation) sIoTMasterMsg; - // TODO: DEBUG - System.out.println("\n\nDEBUG: CREATE NEW IOT RELATION!!!"); - System.out.println("DEBUG: sMessage object field name: " + sMessage.getObjectFieldName()); - // Initialize field name strFieldName = sMessage.getObjectFieldName(); RuntimeOutput.print("IoTSlave: Setting up field " + strFieldName, BOOL_VERBOSE); @@ -461,16 +434,6 @@ public class IoTSlave { // Translating into the actual Message class MessageGetObject sMessage = (MessageGetObject) sIoTMasterMsg; - - System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress()); - System.out.println("DEBUG: sMessage object class: " + sMessage.getObjectClass()); - System.out.println("DEBUG: sMessage object name: " + sMessage.getObjectName()); - System.out.println("DEBUG: sMessage interface name: " + sMessage.getObjectInterfaceName()); - System.out.println("DEBUG: sMessage reg port: " + sMessage.getRMIRegPort()); - System.out.println("DEBUG: sMessage stub port: " + sMessage.getRMIStubPort()); - System.out.println("DEBUG: sMessage callback ports: " + Arrays.toString(sMessage.getRMICallbackPorts())); - System.out.println("\n\n"); - Object stubObjConv = null; String strObjectName = sMessage.getObjectName(); String strObjClassInterfaceName = STR_OBJ_CLS_PFX + "." + STR_INTERFACE_PFX + "." + @@ -510,10 +473,6 @@ public class IoTSlave { private void getIoTSetObject() throws IOException, ClassNotFoundException, RemoteException, NotBoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { - - // TODO: DEBUG - System.out.println("\n\nDEBUG: GET IOT SET OBJECT!!!"); - Object objRegistry = null; if (CAPAB_BASED_RMI) objRegistry = getObjectFromStub(); @@ -535,10 +494,6 @@ public class IoTSlave { private void getIoTRelationFirstObject() throws IOException, ClassNotFoundException, RemoteException, NotBoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { - - // TODO: DEBUG - System.out.println("\n\nDEBUG: GET IOT RELATION FIRST OBJECT!!!"); - Object objRegistry = null; if (CAPAB_BASED_RMI) objRegistry = getObjectFromStub(); @@ -560,10 +515,6 @@ public class IoTSlave { private void getIoTRelationSecondObject() throws IOException, ClassNotFoundException, RemoteException, NotBoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { - - // TODO: DEBUG - System.out.println("\n\nDEBUG: GET IOT RELATION SECOND OBJECT!!!"); - Object objRegistry = null; if (CAPAB_BASED_RMI) objRegistry = getObjectFromStub(); @@ -591,11 +542,6 @@ public class IoTSlave { // Reinitialize IoTSet field after getting all the objects iotsetObject = new IoTSet(isetObject.values()); - - // TODO: DEBUG - System.out.println("\n\nDEBUG: REINITIALIZE IOT SET FIELD!!!"); - System.out.println("DEBUG: Field name: " + strFieldName + "\n\n"); - // Private fields need getDeclaredField(), while public fields use getField() Field fld = clsMain.getDeclaredField(strFieldName); boolean bAccess = fld.isAccessible(); @@ -620,11 +566,6 @@ public class IoTSlave { // Reinitialize IoTSet field after getting all the objects iotrelObject = new IoTRelation(irelObject.relationMap(), irelObject.size()); - - // TODO: DEBUG - System.out.println("\n\nDEBUG: REINITIALIZE IOT RELATION FIELD!!!"); - System.out.println("DEBUG: Field name: " + strFieldName + "\n\n"); - // Private fields need getDeclaredField(), while public fields use getField() Field fld = clsMain.getDeclaredField(strFieldName); boolean bAccess = fld.isAccessible(); @@ -650,15 +591,6 @@ public class IoTSlave { // Translating into the actual Message class MessageGetDeviceObject sMessage = (MessageGetDeviceObject) sIoTMasterMsg; - - // TODO: DEBUG - System.out.println("\n\nDEBUG: GET DEVICE IOT SET OBJECT!!!"); - System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress()); - System.out.println("DEBUG: sMessage source port: " + sMessage.getSourceDeviceDriverPort()); - System.out.println("DEBUG: sMessage destination port: " + sMessage.getDestinationDeviceDriverPort()); - System.out.println("DEBUG: sMessage source wild card: " + sMessage.isSourcePortWildCard()); - System.out.println("DEBUG: sMessage desination wild card: " + sMessage.isDestinationPortWildCard() + "\n\n"); - // Get IoTSet objects for IP address set on device driver/controller IoTDeviceAddress objDeviceAddress = new IoTDeviceAddress(sMessage.getHostAddress(), sMessage.getSourceDeviceDriverPort(), @@ -686,11 +618,6 @@ public class IoTSlave { // Translating into the actual Message class MessageGetSimpleDeviceObject sMessage = (MessageGetSimpleDeviceObject) sIoTMasterMsg; - - // TODO: DEBUG - System.out.println("\n\nDEBUG: GET ZIGBEE DEVICE IOT SET OBJECT!!!"); - System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress() + "\n\n"); - // Get IoTSet objects for IP address set on device driver/controller IoTZigbeeAddress objZBDevAddress = new IoTZigbeeAddress(sMessage.getHostAddress()); RuntimeOutput.print("IoTSlave: Device address transferred: " + sMessage.getHostAddress(), BOOL_VERBOSE); @@ -713,11 +640,6 @@ public class IoTSlave { // Translating into the actual Message class MessageGetSimpleDeviceObject sMessage = (MessageGetSimpleDeviceObject) sIoTMasterMsg; - - // TODO: DEBUG - System.out.println("\n\nDEBUG: GET ADD IOT SET OBJECT!!!"); - System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress() + "\n\n"); - // Get IoTSet objects for IP address set on device driver/controller IoTAddress objAddress = new IoTAddress(sMessage.getHostAddress()); RuntimeOutput.print("IoTSlave: Address transferred: " + sMessage.getHostAddress(), BOOL_VERBOSE); @@ -736,9 +658,6 @@ public class IoTSlave { */ private void invokeInitMethod() throws IOException { - // TODO: DEBUG - System.out.println("\n\nDEBUG: INVOKE INIT METHOD!!!\n\n"); - new Thread() { public void run() { try { diff --git a/localconfig/iotruntime/IoTMaster.config b/localconfig/iotruntime/IoTMaster.config index 87c9fa1..70b25d3 100644 --- a/localconfig/iotruntime/IoTMaster.config +++ b/localconfig/iotruntime/IoTMaster.config @@ -28,9 +28,6 @@ ZIGBEE_IOTMASTER_PORT=12345 #Verboseness of runtime messages VERBOSE=Yes -#Number of callback ports -NUMBER_CALLBACK_PORTS=1 - #Language: C++ or Java LANGUAGE=Java -- 2.34.1