[TIZEN] Updated properties of Configuration resource in Things manager.
authorarya.k <arya.kumar@samsung.com>
Thu, 10 Sep 2015 11:58:54 +0000 (17:28 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Fri, 11 Sep 2015 08:08:25 +0000 (08:08 +0000)
"Device Name" and "Location Name" properties are added and "SystemTime" property
is removed.

diagnosticsresource file is renamed to maintenanceresource.

Change-Id: I4fab4b7989a714d2aa1089f22f8adde674597bab
Signed-off-by: arya.k <arya.kumar@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2445
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/things-manager/sampleapp/tizen/ConServerApp/inc/configurationresource.h
service/things-manager/sampleapp/tizen/ConServerApp/inc/conserverapp.h
service/things-manager/sampleapp/tizen/ConServerApp/inc/factorysetresource.h
service/things-manager/sampleapp/tizen/ConServerApp/inc/maintenanceresource.h [moved from service/things-manager/sampleapp/tizen/ConServerApp/inc/diagnosticsresource.h with 90% similarity]
service/things-manager/sampleapp/tizen/ConServerApp/src/configurationresource.cpp
service/things-manager/sampleapp/tizen/ConServerApp/src/conserverapp.cpp
service/things-manager/sampleapp/tizen/ConServerApp/src/factorysetresource.cpp
service/things-manager/sampleapp/tizen/ConServerApp/src/maintenanceresource.cpp [moved from service/things-manager/sampleapp/tizen/ConServerApp/src/diagnosticsresource.cpp with 89% similarity]
service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmsampleapp.h
service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmutil.h
service/things-manager/sampleapp/tizen/TMSampleApp/src/configuration.cpp

index 7c3a424..9601cf8 100755 (executable)
@@ -17,8 +17,8 @@
  * limitations under the License.
  *
  ******************************************************************/
-#ifndef __CONFIGURATION_RESOURCE_H__
-#define __CONFIGURATION_RESOURCE_H__
+#ifndef CONFIGURATION_RESOURCE_H__
+#define CONFIGURATION_RESOURCE_H__
 
 #include <functional>
 
@@ -27,8 +27,9 @@
 
 #pragma once
 
+#define DEFAULT_DEVICENAME "n"
 #define DEFAULT_LOCATION "loc"
-#define DEFAULT_SYSTIME "st"
+#define DEFAULT_LOCATIONNAME "locn"
 #define DEFAULT_CURRENCY "c"
 #define DEFAULT_REGION "r"
 
@@ -40,8 +41,9 @@ ResourceEntityHandler;
 static std::string defaultConURI = "/oic/con";
 static std::string defaultConResourceType = "oic.wk.con";
 
+extern std::string defaultDeviceName;
 extern std::string defaultLocation;
-extern std::string defaultSystemTime;
+extern std::string defaultLocationName;
 extern std::string defaultCurrency;
 extern std::string defaultRegion;
 
@@ -50,8 +52,9 @@ class ConfigurationResource
     public:
         // Configuration members
         std::string m_configurationUri;
+        std::string m_deviceName;
         std::string m_location;
-        std::string m_systemTime;
+        std::string m_locationName;
         std::string m_currency;
         std::string m_region;
         std::vector< std::string > m_configurationTypes;
@@ -76,4 +79,4 @@ class ConfigurationResource
         void deleteResource();
 };
 
-#endif // __CONFIGURATION_RESOURCE_H__
\ No newline at end of file
+#endif // CONFIGURATION_RESOURCE_H__
\ No newline at end of file
index 7558b90..8f35f69 100644 (file)
@@ -18,8 +18,8 @@
  *
  ******************************************************************/
 
-#ifndef __CONSERVERAPP_H__
-#define __CONSERVERAPP_H__
+#ifndef CONSERVERAPP_H__
+#define CONSERVERAPP_H__
 
 #include <app.h>
 #include <Elementary.h>
@@ -41,4 +41,4 @@
 
 #define ELM_DEMO_EDJ "opt/usr/apps/org.tizen.conserverapp/res/ui_controls.edj"
 
-#endif // __CONSERVERAPP_H__
+#endif // CONSERVERAPP_H__
\ No newline at end of file
index eb60060..ce8a995 100644 (file)
@@ -17,8 +17,8 @@
  * limitations under the License.
  *
  ******************************************************************/
-#ifndef __FACTORYSET_RESOURCE_H__
-#define __FACTORYSET_RESOURCE_H__
+#ifndef FACTORYSET_RESOURCE_H__
+#define FACTORYSET_RESOURCE_H__
 
 #include <functional>
 
@@ -52,4 +52,4 @@ class FactorySetResource : public ConfigurationResource
         void deleteResource();
 };
 
-#endif // __FACTORYSET_RESOURCE_H__
\ No newline at end of file
+#endif // FACTORYSET_RESOURCE_H__
\ No newline at end of file
@@ -17,8 +17,8 @@
  * limitations under the License.
  *
  ******************************************************************/
-#ifndef __DIAGNOSTICS_RESOURCE_H__
-#define __DIAGNOSTICS_RESOURCE_H__
+#ifndef MAINTENANCE_RESOURCE_H__
+#define MAINTENANCE_RESOURCE_H__
 
 #include <functional>
 #include <thread>
 
 #pragma once
 
+#define DEFAULT_REBOOT "rb"
+#define DEFAULT_FACTORYRESET "fr"
+#define DEFAULT_STARTCOLLECTION "ssc"
+
 using namespace OC;
 
 typedef std::function<OCEntityHandlerResult(std::shared_ptr< OCResourceRequest > request)>
@@ -70,4 +74,4 @@ class MaintenanceResource
         void deleteResource();
 };
 
-#endif // __DIAGNOSTICS_RESOURCE_H__
\ No newline at end of file
+#endif // MAINTENANCE_RESOURCE_H__
\ No newline at end of file
index a025e96..1f56a2e 100755 (executable)
@@ -30,14 +30,16 @@ using namespace OC;
 
 // Constructor
 ConfigurationResource::ConfigurationResource() :
-    m_location(defaultLocation), m_systemTime(defaultSystemTime), m_currency(
-        defaultCurrency), m_region(defaultRegion)
+    m_deviceName(defaultDeviceName), m_location(defaultLocation),
+    m_locationName(defaultLocationName), m_currency(defaultCurrency),
+    m_region(defaultRegion)
 {
     m_configurationUri = defaultConURI; // URI of the resource
     m_configurationTypes.push_back(defaultConResourceType); // resource type name
     m_configurationInterfaces.push_back(DEFAULT_INTERFACE); // resource interface
+    m_configurationRep.setValue(DEFAULT_DEVICENAME, m_deviceName);
     m_configurationRep.setValue(DEFAULT_LOCATION, m_location);
-    m_configurationRep.setValue(DEFAULT_SYSTIME, m_systemTime);
+    m_configurationRep.setValue(DEFAULT_LOCATIONNAME, m_locationName);
     m_configurationRep.setValue(DEFAULT_CURRENCY, m_currency);
     m_configurationRep.setValue(DEFAULT_REGION, m_region);
     m_configurationRep.setUri(m_configurationUri);
@@ -76,6 +78,13 @@ void ConfigurationResource::setConfigurationRepresentation(OCRepresentation &rep
 {
     std::string value;
 
+    if (rep.getValue(DEFAULT_DEVICENAME, value))
+    {
+        m_deviceName = value;
+        dlog_print(DLOG_INFO, "ConfigurationResource", "#### m_deviceName: %s",
+                   m_deviceName.c_str());
+    }
+
     if (rep.getValue(DEFAULT_LOCATION, value))
     {
         m_location = value;
@@ -83,10 +92,11 @@ void ConfigurationResource::setConfigurationRepresentation(OCRepresentation &rep
                    m_location.c_str());
     }
 
-    if (rep.getValue(DEFAULT_SYSTIME, value))
+    if (rep.getValue(DEFAULT_LOCATIONNAME, value))
     {
-        dlog_print(DLOG_INFO, "ConfigurationResource", "#### SystemTime is not"
-                   "allowed to be written");
+        m_locationName = value;
+        dlog_print(DLOG_INFO, "ConfigurationResource", "#### m_locationName: %s",
+                   m_locationName.c_str());
     }
 
     if (rep.getValue(DEFAULT_CURRENCY, value))
@@ -106,8 +116,9 @@ void ConfigurationResource::setConfigurationRepresentation(OCRepresentation &rep
 
 OCRepresentation ConfigurationResource::getConfigurationRepresentation()
 {
+    m_configurationRep.setValue(DEFAULT_DEVICENAME, m_deviceName);
     m_configurationRep.setValue(DEFAULT_LOCATION, m_location);
-    m_configurationRep.setValue(DEFAULT_SYSTIME, m_systemTime);
+    m_configurationRep.setValue(DEFAULT_LOCATIONNAME, m_locationName);
     m_configurationRep.setValue(DEFAULT_CURRENCY, m_currency);
     m_configurationRep.setValue(DEFAULT_REGION, m_region);
 
@@ -122,8 +133,9 @@ std::string ConfigurationResource::getUri()
 // Assigns default values to all the attributes of the configuration resource
 void ConfigurationResource::factoryReset()
 {
+    m_deviceName = defaultDeviceName;
     m_location = defaultLocation;
-    m_systemTime = defaultSystemTime;
+    m_locationName = defaultLocationName;
     m_currency = defaultCurrency;
     m_region = defaultRegion;
 }
index 0361109..88d223d 100644 (file)
@@ -26,7 +26,7 @@
 #include "ThingsConfiguration.h"
 #include "ThingsMaintenance.h"
 #include "configurationresource.h"
-#include "diagnosticsresource.h"
+#include "maintenanceresource.h"
 #include "factorysetresource.h"
 
 using namespace OC;
@@ -37,9 +37,10 @@ namespace PH = std::placeholders;
 /* Default system configuration value's variables
    The variable's names should be same as the names of "extern" variables defined in
    "configurationresource.h" */
+std::string defaultDeviceName;
 std::string defaultLocation;
+std::string defaultLocationName;
 std::string defaultRegion;
-std::string defaultSystemTime;
 std::string defaultCurrency;
 
 static ThingsConfiguration *g_thingsConf;
@@ -298,12 +299,14 @@ void onBootStrapCallback(const HeaderOptions &headerOptions, const OCRepresentat
     logMessage += "URI : " + rep.getUri() + "<br>";
 
     defaultRegion = rep.getValue< std::string >(DEFAULT_REGION);
-    defaultSystemTime = rep.getValue< std::string >(DEFAULT_SYSTIME);
     defaultCurrency = rep.getValue< std::string >(DEFAULT_CURRENCY);
     defaultLocation = rep.getValue< std::string >(DEFAULT_LOCATION);
+    defaultLocationName = rep.getValue< std::string >(DEFAULT_LOCATIONNAME);
+    defaultDeviceName = rep.getValue< std::string >(DEFAULT_DEVICENAME);
 
+    logMessage += "Device Name : " + defaultDeviceName + "<br>";
     logMessage += "Location : " + defaultLocation + "<br>";
-    logMessage += "SystemTime : " + defaultSystemTime + "<br>";
+    logMessage += "Location Name : " + defaultLocationName + "<br>";
     logMessage += "currency : " + defaultCurrency + "<br>";
     logMessage += "Region : " + defaultRegion + "<br>";
 
index 3271609..b856107 100644 (file)
@@ -71,6 +71,13 @@ void FactorySetResource::setFactorySetRepresentation(OCRepresentation &rep)
 {
     std::string value;
 
+    if (rep.getValue(DEFAULT_DEVICENAME, value))
+    {
+        m_deviceName = value;
+        dlog_print(DLOG_INFO, "FactorySetResource", "#### m_deviceName: %s",
+                   m_deviceName.c_str());
+    }
+
     if (rep.getValue(DEFAULT_LOCATION, value))
     {
         m_location = value;
@@ -78,10 +85,11 @@ void FactorySetResource::setFactorySetRepresentation(OCRepresentation &rep)
                    m_location.c_str());
     }
 
-    if (rep.getValue(DEFAULT_SYSTIME, value))
+    if (rep.getValue(DEFAULT_LOCATIONNAME, value))
     {
-        dlog_print(DLOG_INFO, "FactorySetResource", "#### SystemTime is not"
-                   "allowed to be written");
+        m_locationName = value;
+        dlog_print(DLOG_INFO, "FactorySetResource", "#### m_locationName: %s",
+                   m_locationName.c_str());
     }
 
     if (rep.getValue(DEFAULT_CURRENCY, value))
@@ -101,8 +109,9 @@ void FactorySetResource::setFactorySetRepresentation(OCRepresentation &rep)
 
 OCRepresentation FactorySetResource::getFactorySetRepresentation()
 {
+    m_configurationRep.setValue(DEFAULT_DEVICENAME, m_deviceName);
     m_configurationRep.setValue(DEFAULT_LOCATION, m_location);
-    m_configurationRep.setValue(DEFAULT_SYSTIME, m_systemTime);
+    m_configurationRep.setValue(DEFAULT_LOCATIONNAME, m_locationName);
     m_configurationRep.setValue(DEFAULT_CURRENCY, m_currency);
     m_configurationRep.setValue(DEFAULT_REGION, m_region);
 
@@ -18,7 +18,7 @@
  *
  ******************************************************************/
 
-#include "diagnosticsresource.h"
+#include "maintenanceresource.h"
 
 #include <functional>
 #include <dlog.h>
@@ -46,9 +46,9 @@ MaintenanceResource::MaintenanceResource() :
     m_maintenanceUri = defaultMntURI; // URI of the resource
     m_maintenanceTypes.push_back(defaultMntResourceType); // resource type name
     m_maintenanceInterfaces.push_back(DEFAULT_INTERFACE); // resource interface
-    m_maintenanceRep.setValue("fr", m_factoryReset);
-    m_maintenanceRep.setValue("rb", m_reboot);
-    m_maintenanceRep.setValue("ssc", m_startStatCollection);
+    m_maintenanceRep.setValue(DEFAULT_FACTORYRESET, m_factoryReset);
+    m_maintenanceRep.setValue(DEFAULT_REBOOT, m_reboot);
+    m_maintenanceRep.setValue(DEFAULT_STARTCOLLECTION, m_startStatCollection);
     m_maintenanceRep.setUri(m_maintenanceUri);
     m_maintenanceRep.setResourceTypes(m_maintenanceTypes);
     m_maintenanceRep.setResourceInterfaces(m_maintenanceInterfaces);
@@ -91,20 +91,20 @@ void MaintenanceResource::setMaintenanceRepresentation(OCRepresentation &rep)
 {
     std::string value;
 
-    if (rep.getValue("fr", value))
+    if (rep.getValue(DEFAULT_FACTORYRESET, value))
     {
         m_factoryReset = value;
         dlog_print(DLOG_INFO, "MaintenanceResource", "#### m_factoryReset: %s",
                    m_factoryReset.c_str());
     }
 
-    if (rep.getValue("rb", value))
+    if (rep.getValue(DEFAULT_REBOOT, value))
     {
         m_reboot = value;
         dlog_print(DLOG_INFO, "MaintenanceResource", "#### m_reboot: %s", m_reboot.c_str());
     }
 
-    if (rep.getValue("ssc", value))
+    if (rep.getValue(DEFAULT_STARTCOLLECTION, value))
     {
         m_startStatCollection = value;
         dlog_print(DLOG_INFO, "MaintenanceResource", "#### m_startStatCollection: %s",
@@ -114,9 +114,9 @@ void MaintenanceResource::setMaintenanceRepresentation(OCRepresentation &rep)
 
 OCRepresentation MaintenanceResource::getMaintenanceRepresentation()
 {
-    m_maintenanceRep.setValue("fr", m_factoryReset);
-    m_maintenanceRep.setValue("rb", m_reboot);
-    m_maintenanceRep.setValue("ssc", m_startStatCollection);
+    m_maintenanceRep.setValue(DEFAULT_FACTORYRESET, m_factoryReset);
+    m_maintenanceRep.setValue(DEFAULT_REBOOT, m_reboot);
+    m_maintenanceRep.setValue(DEFAULT_STARTCOLLECTION, m_startStatCollection);
 
     return m_maintenanceRep;
 }
index 8655eea..0742dab 100644 (file)
@@ -18,8 +18,8 @@
  *
  ******************************************************************/
 
-#ifndef __TMSAMPLEAPP_H__
-#define __TMSAMPLEAPP_H__
+#ifndef TMSAMPLEAPP_H__
+#define TMSAMPLEAPP_H__
 
 #include <app.h>
 #include <Elementary.h>
 #define FINDGROUP_TIMEOUT 5
 #define FINDRESOURCE_TIMEOUT 6
 
+#define DEFAULT_DEVICENAME "n"
 #define DEFAULT_LOCATION "loc"
-#define DEFAULT_SYSTIME "st"
+#define DEFAULT_LOCATIONNAME "locn"
 #define DEFAULT_CURRENCY "c"
 #define DEFAULT_REGION "r"
 
 void group_cb(void *data, Evas_Object *obj, void *event_info);
 void configuration_cb(void *data, Evas_Object *obj, void *event_info);
 
-#endif // __TMSAMPLEAPP_H__
\ No newline at end of file
+#endif // TMSAMPLEAPP_H__
\ No newline at end of file
index 373ec4f..47346f3 100644 (file)
@@ -22,9 +22,9 @@
 
 using namespace std;
 
-#ifndef __TMUTIL_H__
-#define __TMUTIL_H__
+#ifndef TMUTIL_H__
+#define TMUTIL_H__
 
 extern std::string getOCStackResultStringFromInt(int result);
 
-#endif // __TMUTIL_H__
\ No newline at end of file
+#endif // TMUTIL_H__
\ No newline at end of file
index ef1ee8d..bdeccb0 100644 (file)
@@ -62,9 +62,9 @@ string CONFIGURATION_RESOURCE_URI             = "/oic/con";
 string MAINTENANCE_RESOURCE_URI                = "/oic/mnt";
 string FACTORYSET_RESOURCE_URI                = "/factorySet";
 
-GroupManager *g_groupManager = new GroupManager();
-ThingsConfiguration *g_thingsConfig = new ThingsConfiguration();
-ThingsMaintenance *g_thingsMnt = new ThingsMaintenance();
+GroupManager *g_groupManager = nullptr;
+ThingsConfiguration *g_thingsConfig = nullptr;
+ThingsMaintenance *g_thingsMnt = nullptr;
 
 
 typedef struct region_popup
@@ -276,29 +276,40 @@ static void onUpdateConfigurationsCallback(const HeaderOptions &headerOptions,
     string logMessage = "Resource URI: " + rep.getUri() + "<br>";
     dlog_print(DLOG_INFO, LOG_TAG, "#### Resource URI: %s", rep.getUri().c_str());
 
+    if (rep.hasAttribute(DEFAULT_DEVICENAME))
+    {
+        dlog_print(DLOG_INFO, LOG_TAG, "#### Device Name : %s",
+                   rep.getValue< std::string >(DEFAULT_DEVICENAME).c_str());
+        logMessage = logMessage + "Device Name : " +
+                     rep.getValue< std::string >(DEFAULT_DEVICENAME) + "<br>";
+    }
     if (rep.hasAttribute(DEFAULT_LOCATION))
     {
         dlog_print(DLOG_INFO, LOG_TAG, "#### Location : %s",
-                   rep.getValue< std::string >("loc").c_str());
-        logMessage = logMessage + "Location : " + rep.getValue< std::string >("loc") + "<br>";
+                   rep.getValue< std::string >(DEFAULT_LOCATION).c_str());
+        logMessage = logMessage + "Location : " +
+                     rep.getValue< std::string >(DEFAULT_LOCATION) + "<br>";
     }
-    if (rep.hasAttribute(DEFAULT_SYSTIME))
+    if (rep.hasAttribute(DEFAULT_LOCATIONNAME))
     {
-        dlog_print(DLOG_INFO, LOG_TAG, "#### SystemTime : %s",
-                   rep.getValue< std::string >("st").c_str());
-        logMessage = logMessage + "SystemTime : " + rep.getValue< std::string >("st") + "<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, "#### Location Name : %s",
+                   rep.getValue< std::string >(DEFAULT_LOCATIONNAME).c_str());
+        logMessage = logMessage + "Location Name: " +
+                     rep.getValue< std::string >(DEFAULT_LOCATIONNAME) + "<br>";
     }
     if (rep.hasAttribute(DEFAULT_CURRENCY))
     {
         dlog_print(DLOG_INFO, LOG_TAG, "#### Currency : %s",
-                   rep.getValue< std::string >("c").c_str());
-        logMessage = logMessage + "Currency : " + rep.getValue< std::string >("c") + "<br>";
+                   rep.getValue< std::string >(DEFAULT_CURRENCY).c_str());
+        logMessage = logMessage + "Currency : " +
+                     rep.getValue< std::string >(DEFAULT_CURRENCY) + "<br>";
     }
     if (rep.hasAttribute(DEFAULT_REGION))
     {
         dlog_print(DLOG_INFO, LOG_TAG, "#### Region : %s",
-                   rep.getValue< std::string >("r").c_str());
-        logMessage = logMessage + "Region : " + rep.getValue< std::string >("r") + "<br>";
+                   rep.getValue< std::string >(DEFAULT_REGION).c_str());
+        logMessage = logMessage + "Region : " +
+                     rep.getValue< std::string >(DEFAULT_REGION) + "<br>";
     }
     logMessage += "----------------------<br>";
     dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
@@ -325,29 +336,40 @@ static void onGetConfigurationsCallback(const HeaderOptions &headerOptions,
     string logMessage = "Resource URI: " + rep.getUri() + "<br>";
     dlog_print(DLOG_INFO, LOG_TAG, "#### Resource URI: %s", rep.getUri().c_str());
 
+    if (rep.hasAttribute(DEFAULT_DEVICENAME))
+    {
+        dlog_print(DLOG_INFO, LOG_TAG, "#### Device Name : %s",
+                   rep.getValue< std::string >(DEFAULT_DEVICENAME).c_str());
+        logMessage = logMessage + "Device Name : "
+                     + rep.getValue< std::string >(DEFAULT_DEVICENAME) + "<br>";
+    }
     if (rep.hasAttribute(DEFAULT_LOCATION))
     {
         dlog_print(DLOG_INFO, LOG_TAG, "#### Location : %s",
                    rep.getValue< std::string >(DEFAULT_LOCATION).c_str());
-        logMessage = logMessage + "Location : " + rep.getValue< std::string >(DEFAULT_LOCATION) + "<br>";
+        logMessage = logMessage + "Location : "
+                     + rep.getValue< std::string >(DEFAULT_LOCATION) + "<br>";
     }
-    if (rep.hasAttribute(DEFAULT_SYSTIME))
+    if (rep.hasAttribute(DEFAULT_LOCATIONNAME))
     {
-        dlog_print(DLOG_INFO, LOG_TAG, "#### SystemTime : %s",
-                   rep.getValue< std::string >(DEFAULT_SYSTIME).c_str());
-        logMessage = logMessage + "SystemTime : " + rep.getValue< std::string >(DEFAULT_SYSTIME) + "<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, "#### Location Name : %s",
+                   rep.getValue< std::string >(DEFAULT_LOCATIONNAME).c_str());
+        logMessage = logMessage + "Location Name : "
+                     + rep.getValue< std::string >(DEFAULT_LOCATIONNAME) + "<br>";
     }
     if (rep.hasAttribute(DEFAULT_CURRENCY))
     {
         dlog_print(DLOG_INFO, LOG_TAG, "#### Currency : %s",
                    rep.getValue< std::string >(DEFAULT_CURRENCY).c_str());
-        logMessage = logMessage + "Currency : " + rep.getValue< std::string >(DEFAULT_CURRENCY) + "<br>";
+        logMessage = logMessage + "Currency : "
+                     + rep.getValue< std::string >(DEFAULT_CURRENCY) + "<br>";
     }
     if (rep.hasAttribute(DEFAULT_REGION))
     {
         dlog_print(DLOG_INFO, LOG_TAG, "#### Region : %s",
                    rep.getValue< std::string >(DEFAULT_REGION).c_str());
-        logMessage = logMessage + "Region : " + rep.getValue< std::string >(DEFAULT_REGION) + "<br>";
+        logMessage = logMessage + "Region : "
+                     + rep.getValue< std::string >(DEFAULT_REGION) + "<br>";
     }
 
     logMessage += "----------------------<br>";
@@ -574,7 +596,7 @@ static void updateConfiguration(std::string newRegionValue)
     }
 
     OCStackResult result;
-    ConfigurationName name = "r";
+    ConfigurationName name = DEFAULT_REGION;
     ConfigurationValue value = newRegionValue;
 
     std::map< ConfigurationName, ConfigurationValue > configurations;
@@ -701,6 +723,10 @@ static void onStartConfigure()
     createResourceCollection(FACTORYSET_COLLECTION_RESOURCE_URI,
                              FACTORYSET_COLLECTION_RESOURCE_TYPE,
                              setCollectionHandle);
+
+    g_groupManager = new GroupManager();
+    g_thingsConfig = new ThingsConfiguration();
+    g_thingsMnt = new ThingsMaintenance();
 }
 
 // Deletes all the resources
@@ -708,11 +734,15 @@ static void onDestroyConfigure()
 {
     dlog_print(DLOG_INFO, LOG_TAG, "#### Destroy sequence called");
 
-    deleteResource(configurationCollectionHandle, configurationFoundHandle);
+    deleteResource(setCollectionHandle, setFoundHandle);
 
     deleteResource(maintenanceCollectionHandle, maintenanceFoundHandle);
 
-    deleteResource(setCollectionHandle, setFoundHandle);
+    deleteResource(configurationCollectionHandle, configurationFoundHandle);
+
+    delete g_thingsMnt;
+    delete g_thingsConfig;
+    delete g_groupManager;
 
     dlog_print(DLOG_INFO, LOG_TAG, "#### Resources destroyed successfully");
 }