diff --git a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java index d5db8993cc..5cdedb5a6a 100644 --- a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java +++ b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConfiguration.java @@ -28,15 +28,12 @@ public class AgentConfiguration { private String deviceOwner; private String deviceId; private String deviceName; - private String controllerContext; - private String scepContext; private String HTTPS_ServerEndpoint; private String HTTP_ServerEndpoint; private String apimGatewayEndpoint; private String mqttBrokerEndpoint; private String xmppServerEndpoint; private String apiApplicationKey; - private String authMethod; private String authToken; private String refreshToken; private int dataPushInterval; @@ -83,14 +80,6 @@ public class AgentConfiguration { this.deviceName = deviceName; } - public String getControllerContext() { - return controllerContext; - } - - public void setControllerContext(String controllerContext) { - this.controllerContext = controllerContext; - } - public String getHTTPS_ServerEndpoint() { return HTTPS_ServerEndpoint; } @@ -139,14 +128,6 @@ public class AgentConfiguration { this.apiApplicationKey = apiApplicationKey; } - public String getAuthMethod() { - return authMethod; - } - - public void setAuthMethod(String authMethod) { - this.authMethod = authMethod; - } - public String getAuthToken() { return authToken; } @@ -170,15 +151,7 @@ public class AgentConfiguration { public void setDataPushInterval(int dataPushInterval) { this.dataPushInterval = dataPushInterval; } - - public String getScepContext() { - return scepContext; - } - - public void setScepContext(String scepContext) { - this.scepContext = scepContext; - } - + public String getXmppServerName() { return xmppServerName; } @@ -186,6 +159,7 @@ public class AgentConfiguration { public void setXmppServerName(String xmppServerName) { this.xmppServerName = xmppServerName; } + } diff --git a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java index f1372b25a0..cdf0d52a00 100644 --- a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java +++ b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java @@ -73,8 +73,6 @@ public class AgentConstants { public static final String DEVICE_ID_PROPERTY = "deviceId"; public static final String SERVER_JID_PROPERTY = "server-jid"; public static final String DEVICE_NAME_PROPERTY = "device-name"; - public static final String DEVICE_CONTROLLER_CONTEXT_PROPERTY = "controller-context"; - public static final String DEVICE_SCEP_CONTEXT_PROPERTY = "scep-context"; public static final String SERVER_HTTPS_EP_PROPERTY = "https-ep"; public static final String SERVER_HTTP_EP_PROPERTY = "http-ep"; public static final String APIM_GATEWAY_EP_PROPERTY = "apim-ep"; @@ -82,7 +80,6 @@ public class AgentConstants { public static final String XMPP_SERVER_EP_PROPERTY = "xmpp-ep"; public static final String XMPP_SERVER_NAME_PROPERTY = "xmpp-server-name"; public static final String API_APPLICATION_KEY = "application-key"; - public static final String AUTH_METHOD_PROPERTY = "auth-method"; public static final String AUTH_TOKEN_PROPERTY = "auth-token"; public static final String REFRESH_TOKEN_PROPERTY = "refresh-token"; public static final String NETWORK_INTERFACE_PROPERTY = "network-interface"; diff --git a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java index 6ee95dceb9..69348b1956 100644 --- a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java +++ b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentManager.java @@ -96,9 +96,6 @@ public class AgentManager { AgentConstants.DEVICE_TYPE, agentConfigs.getDeviceId()); - this.deviceMgtAnalyticUrl = agentConfigs.getHTTPS_ServerEndpoint() + analyticsPageContext; - this.deviceMgtControlUrl = agentConfigs.getHTTPS_ServerEndpoint() + controlPageContext; - this.agentStatus = AgentConstants.NOT_REGISTERED; this.deviceName = this.agentConfigs.getDeviceName(); diff --git a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java index 8f6fe409b7..26bec9e503 100644 --- a/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java +++ b/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java @@ -108,10 +108,6 @@ public class AgentUtilOperations { AgentConstants.SERVER_JID_PROPERTY)); iotServerConfigs.setDeviceName(properties.getProperty( AgentConstants.DEVICE_NAME_PROPERTY)); - iotServerConfigs.setControllerContext(properties.getProperty( - AgentConstants.DEVICE_CONTROLLER_CONTEXT_PROPERTY)); - iotServerConfigs.setScepContext(properties.getProperty( - AgentConstants.DEVICE_SCEP_CONTEXT_PROPERTY)); iotServerConfigs.setHTTPS_ServerEndpoint(properties.getProperty( AgentConstants.SERVER_HTTPS_EP_PROPERTY)); iotServerConfigs.setHTTP_ServerEndpoint(properties.getProperty( @@ -126,8 +122,6 @@ public class AgentUtilOperations { AgentConstants.XMPP_SERVER_NAME_PROPERTY)); iotServerConfigs.setApiApplicationKey(properties.getProperty( AgentConstants.API_APPLICATION_KEY)); - iotServerConfigs.setAuthMethod(properties.getProperty( - AgentConstants.AUTH_METHOD_PROPERTY)); iotServerConfigs.setAuthToken(properties.getProperty( AgentConstants.AUTH_TOKEN_PROPERTY)); iotServerConfigs.setRefreshToken(properties.getProperty( @@ -139,11 +133,10 @@ public class AgentUtilOperations { iotServerConfigs.getTenantDomain()); log.info(AgentConstants.LOG_APPENDER + "Device Owner: " + iotServerConfigs.getDeviceOwner()); - log.info(AgentConstants.LOG_APPENDER + "Device ID: " + iotServerConfigs.getDeviceId()); + log.info(AgentConstants.LOG_APPENDER + "Device ID: " + + iotServerConfigs.getDeviceId()); log.info(AgentConstants.LOG_APPENDER + "Device Name: " + iotServerConfigs.getDeviceName()); - log.info(AgentConstants.LOG_APPENDER + "Device Controller Context: " + - iotServerConfigs.getControllerContext()); log.info(AgentConstants.LOG_APPENDER + "IoT Server HTTPS EndPoint: " + iotServerConfigs.getHTTPS_ServerEndpoint()); log.info(AgentConstants.LOG_APPENDER + "IoT Server HTTP EndPoint: " + @@ -154,8 +147,6 @@ public class AgentUtilOperations { iotServerConfigs.getMqttBrokerEndpoint()); log.info(AgentConstants.LOG_APPENDER + "XMPP Server EndPoint: " + iotServerConfigs.getXmppServerEndpoint()); - log.info(AgentConstants.LOG_APPENDER + "Authentication Method: " + - iotServerConfigs.getAuthMethod()); log.info(AgentConstants.LOG_APPENDER + "Base64Encoded API Application Key: " + iotServerConfigs.getApiApplicationKey()); log.info(AgentConstants.LOG_APPENDER + "Authentication Token: " + @@ -202,8 +193,8 @@ public class AgentUtilOperations { AgentManager agentManager = AgentManager.getInstance(); String serverSecureEndpoint = agentManager.getAgentConfigs().getHTTPS_ServerEndpoint(); String serverUnSecureEndpoint = agentManager.getAgentConfigs().getHTTP_ServerEndpoint(); - String backEndContext = agentManager.getAgentConfigs().getControllerContext(); - String scepBackEndContext = agentManager.getAgentConfigs().getScepContext(); + String backEndContext = "/virtual_firealarm/device"; + String scepBackEndContext = "/virtual_firealarm_scep"; String deviceControllerAPIEndpoint = serverSecureEndpoint + backEndContext; @@ -312,7 +303,7 @@ public class AgentUtilOperations { } public static String getAuthenticationMethod() { - String authMethod = AgentManager.getInstance().getAgentConfigs().getAuthMethod(); + String authMethod = "token"; switch (authMethod) { case AgentConstants.TOKEN_AUTHENTICATION_METHOD: return AgentConstants.TOKEN_AUTHENTICATION_METHOD; diff --git a/src/main/ui/nbproject/build-impl.xml b/src/main/ui/nbproject/build-impl.xml index 1124542077..67a63a7f46 100644 --- a/src/main/ui/nbproject/build-impl.xml +++ b/src/main/ui/nbproject/build-impl.xml @@ -46,8 +46,8 @@ is divided into following sections: - - + + @@ -76,7 +76,7 @@ is divided into following sections: - + @@ -156,6 +156,7 @@ is divided into following sections: + @@ -191,7 +192,12 @@ is divided into following sections: - + + + + + + @@ -217,6 +223,7 @@ is divided into following sections: + @@ -693,7 +700,7 @@ is divided into following sections: - + @@ -768,7 +775,7 @@ is divided into following sections: - + @@ -795,7 +802,7 @@ is divided into following sections: - + @@ -834,7 +841,7 @@ is divided into following sections: - + @@ -846,7 +853,7 @@ is divided into following sections: - + @@ -969,15 +976,15 @@ is divided into following sections: - + - + - + @@ -985,7 +992,7 @@ is divided into following sections: - + @@ -1180,7 +1187,7 @@ is divided into following sections: Must select one file in the IDE or set run.class - + Must select one file in the IDE or set applet.url diff --git a/src/main/ui/nbproject/genfiles.properties b/src/main/ui/nbproject/genfiles.properties index a6df38fd89..1a7c9fdefb 100644 --- a/src/main/ui/nbproject/genfiles.properties +++ b/src/main/ui/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=8064a381@1.75.2.48 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=e60df945 -nbproject/build-impl.xml.script.CRC32=4fa004f7 -nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 +nbproject/build-impl.xml.script.CRC32=18800575 +nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 diff --git a/src/main/ui/nbproject/private/private.properties b/src/main/ui/nbproject/private/private.properties index e59ac1df68..eda34e66d7 100644 --- a/src/main/ui/nbproject/private/private.properties +++ b/src/main/ui/nbproject/private/private.properties @@ -1,2 +1,2 @@ compile.on.save=true -user.properties.file=/home/charitha/.netbeans/8.0.2/build.properties +user.properties.file=/home/lahiru/.netbeans/8.2/build.properties diff --git a/src/main/ui/nbproject/private/private.xml b/src/main/ui/nbproject/private/private.xml index 2f9a6910bd..89be386ccb 100644 --- a/src/main/ui/nbproject/private/private.xml +++ b/src/main/ui/nbproject/private/private.xml @@ -3,7 +3,8 @@ - file:/home/charitha/git/IoT/iot-server-agents/FireAlarmVirtualAgent/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.java + file:/home/lahiru/WSO2IOT/carbon-device-mgt-plugins/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/VirtualAgentUI.java + file:/home/lahiru/WSO2IOT/carbon-device-mgt-plugins/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.java diff --git a/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.form b/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.form index 23b70e036e..43bc3e62ec 100644 --- a/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.form +++ b/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.form @@ -364,11 +364,7 @@ - - - - - + @@ -377,12 +373,8 @@ - - - - - - + + @@ -396,22 +388,6 @@ - - - - - - - - - - - - - - - - diff --git a/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.java b/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.java index 470a7d8fe9..e3b4e89f66 100644 --- a/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.java +++ b/src/main/ui/src/org/wso2/carbon/device/mgt/iot/agent/virtual/ui/AgentUI.java @@ -47,8 +47,6 @@ public class AgentUI extends javax.swing.JFrame { chkbxTemperatureSmooth = new javax.swing.JCheckBox(); jPanel6 = new javax.swing.JPanel(); jLabel20 = new javax.swing.JLabel(); - btnView = new javax.swing.JButton(); - btnControl = new javax.swing.JButton(); lblStatus = new javax.swing.JLabel(); jPanel8 = new javax.swing.JPanel(); jLabel23 = new javax.swing.JLabel(); @@ -272,20 +270,6 @@ public class AgentUI extends javax.swing.JFrame { jLabel20.setText("Connection Status:"); jLabel20.setVerticalTextPosition(javax.swing.SwingConstants.TOP); - btnView.setText("View Device Data"); - btnView.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - btnViewMouseClicked(evt); - } - }); - - btnControl.setText("Control Device"); - btnControl.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - btnControlMouseClicked(evt); - } - }); - lblStatus.setFont(new java.awt.Font("Cantarell", 1, 15)); // NOI18N lblStatus.setText("Not Connected"); @@ -298,22 +282,15 @@ public class AgentUI extends javax.swing.JFrame { .addComponent(jLabel20) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnControl) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnView) - .addContainerGap()) + .addGap(273, 273, 273)) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnView, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnControl) - .addComponent(lblStatus))) + .addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE) + .addComponent(lblStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); @@ -463,7 +440,7 @@ public class AgentUI extends javax.swing.JFrame { jLabel7.setText("Data Push Interval:"); - spinnerInterval.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(5), Integer.valueOf(1), null, Integer.valueOf(1))); + spinnerInterval.setModel(new javax.swing.SpinnerNumberModel(5, 1, null, 1)); spinnerInterval.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { spinnerIntervalStateChanged(evt); @@ -615,14 +592,6 @@ public class AgentUI extends javax.swing.JFrame { pack(); }// //GEN-END:initComponents - private void btnControlMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnControlMouseClicked - // TODO add your handling code here: - }//GEN-LAST:event_btnControlMouseClicked - - private void btnViewMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnViewMouseClicked - // TODO add your handling code here: - }//GEN-LAST:event_btnViewMouseClicked - private void chkbxTemperatureRandomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkbxTemperatureRandomActionPerformed // TODO add your handling code here: }//GEN-LAST:event_chkbxTemperatureRandomActionPerformed @@ -692,8 +661,6 @@ public class AgentUI extends javax.swing.JFrame { }//GEN-LAST:event_chkbxEmulateActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton btnControl; - private javax.swing.JButton btnView; private javax.swing.JCheckBox chkbxEmulate; private javax.swing.JCheckBox chkbxHumidityRandom; private javax.swing.JCheckBox chkbxHumiditySmooth;