1 /******************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 ******************************************************************/
20 package com.tm.sample;
22 import java.util.ArrayList;
23 import java.util.HashMap;
24 import java.util.List;
26 import java.util.Vector;
28 import org.iotivity.base.OcException;
29 import org.iotivity.base.OcHeaderOption;
30 import org.iotivity.base.OcPlatform;
31 import org.iotivity.base.OcRepresentation;
32 import org.iotivity.base.OcResource;
33 import org.iotivity.base.OcResourceHandle;
34 import org.iotivity.service.tm.IConfigurationListener;
35 import org.iotivity.service.tm.IDiagnosticsListener;
36 import org.iotivity.service.tm.IFindCandidateResourceListener;
37 import org.iotivity.service.tm.OCStackResult;
38 import org.iotivity.service.tm.ThingsManager;
40 import android.app.Activity;
41 import android.app.Dialog;
42 import android.content.Context;
43 import android.os.Bundle;
44 import android.os.Handler;
45 import android.os.Message;
46 import android.util.Log;
47 import android.view.View;
48 import android.view.View.OnClickListener;
49 import android.widget.AdapterView;
50 import android.widget.AdapterView.OnItemClickListener;
51 import android.widget.ArrayAdapter;
52 import android.widget.Button;
53 import android.widget.EditText;
54 import android.widget.ListView;
55 import android.widget.Toast;
58 * Activity for Handling all Configuration Apis as per user's selection on the UI.
61 public class ConfigurationApiActivity extends Activity {
63 private class ResourceInformation {
64 OcResource resource = null;
65 OcResourceHandle resourceHandle = null;
68 private final String LOG_TAG = "[TMSample] "
72 private final String CONFIGURATION_COLLECTION_RESOURCE_URI = "/core/configuration/resourceset";
73 private final String CONFIGURATION_COLLECTION_RESOURCE_TYPE = "core.configuration.resourceset";
74 private final String DIAGNOSTIC_COLLECTION_RESOURCE_URI = "/core/diagnostics/resourceset";
75 private final String DIAGNOSTIC_COLLECTION_RESOURCE_TYPE = "core.diagnostics.resourceset";
76 private final String FACTORYSET_COLLECTION_RESOURCE_URI = "/core/factoryset/resourceset";
77 private final String FACTORYSET_COLLECTION_RESOURCE_TYPE = "core.factoryset.resourceset";
79 private final String CONFIGURATION_RESOURCE_URI = "/oic/con";
80 private final String DIAGNOSTIC_RESOURCE_URI = "/oic/diag";
81 private final String FACTORYSET_RESOURCE_URI = "/factorySet";
83 private ListView list;
84 private ArrayAdapter<String> configurationApis;
85 private ArrayList<String> configurationApisList;
87 private static int messageCount = 0;
88 private static EditText logs;
89 private static String logMessage = "";
90 private static Handler mHandler;
91 private static Message msg;
93 private ThingsManager thingsManager = null;
94 private Map<String, ResourceInformation> resourceList = null;
95 private Map<String, ResourceInformation> collectionList = null;
97 public boolean configurationResourceFlag = false;
98 public boolean factorySetResourceFlag = false;
99 public boolean diagnosticsResourceFlag = false;
101 public static Context mcontext;
102 public String region = "";
103 public boolean findGroupPressedFlag = false;
106 protected void onCreate(Bundle savedInstanceState) {
107 super.onCreate(savedInstanceState);
108 setContentView(R.layout.configapis);
111 thingsManager = new ThingsManager();
114 setResourceListener();
115 setConfigurationListener();
116 setDiagnosticsListener();
118 // Create API menu list
119 configurationApisList = new ArrayList<String>();
121 logs = (EditText) findViewById(R.id.EditText);
123 list = (ListView) findViewById(R.id.configApisList);
124 configurationApisList.add("Find All Groups");
125 configurationApisList.add("Find All Resources");
126 configurationApisList.add("Get a Configuration Resource");
127 configurationApisList.add("Update Attribute (Region)");
128 configurationApisList.add("Factory Reset");
129 configurationApisList.add("Reboot");
130 configurationApisList.add("Get Supported Configuration Units");
131 configurationApis = new ArrayAdapter<String>(this,
132 android.R.layout.simple_list_item_1, configurationApisList);
133 list.setAdapter(configurationApis);
135 // setting the Listener for calling the APIs as per User selection
136 list.setOnItemClickListener(new OnItemClickListener() {
139 public void onItemClick(AdapterView<?> parent, View view,
140 int position, long id) {
144 Vector<String> resourceTypes = new Vector<String>();
145 resourceTypes.add("core.configuration.resourceset");
146 findCandidateResources(resourceTypes);
152 resourceTypes.clear();
153 resourceTypes.add("core.diagnostics.resourceset");
154 findCandidateResources(resourceTypes);
158 resourceTypes.clear();
159 resourceTypes.add("core.factoryset.resourceset");
160 findCandidateResources(resourceTypes);
164 } else if (position == 1) { // Find All Resources
165 if (false == findGroupPressedFlag) {
166 displayToastMessage("Configuration collection resource does not exist!");
168 Vector<String> resourceTypes = new Vector<String>();
169 resourceTypes.add("oic.con");
170 findCandidateResources(resourceTypes);
176 resourceTypes.clear();
177 resourceTypes.add("oic.diag");
178 findCandidateResources(resourceTypes);
182 resourceTypes.clear();
183 resourceTypes.add("factorySet");
184 findCandidateResources(resourceTypes);
188 } else if (position == 2) { // Get Configuration
190 } else if (position == 3) { // Update Attribute (Region)
192 } else if (position == 4) { // Factory Reset
194 } else if (position == 5) { // Reboot
196 } else if (position == 6) { // Get Supported Configuration Units
197 String configurationUnits;
198 configurationUnits = getListOfSupportedConfigurationUnits();
199 Log.i(LOG_TAG, "Configuration Units:" + configurationUnits);
200 logMessage = configurationUnits;
202 logs.setText(logMessage);
208 resourceList = new HashMap<String, ResourceInformation>();
209 collectionList = new HashMap<String, ResourceInformation>();
212 createResourceCollection(CONFIGURATION_COLLECTION_RESOURCE_URI,
213 CONFIGURATION_COLLECTION_RESOURCE_TYPE);
214 createResourceCollection(DIAGNOSTIC_COLLECTION_RESOURCE_URI,
215 DIAGNOSTIC_COLLECTION_RESOURCE_TYPE);
216 createResourceCollection(FACTORYSET_COLLECTION_RESOURCE_URI,
217 FACTORYSET_COLLECTION_RESOURCE_TYPE);
218 } catch (OcException e) {
219 Log.e(LOG_TAG, "OcException occured! " + e.toString());
222 // handler for updating the UI i.e. LogMessage TextBox
223 mHandler = new Handler() {
225 public void handleMessage(Message msg) {
229 logs.setText(logMessage);
230 Log.i(LOG_TAG, logMessage);
237 private void userInputDialog() {
239 ResourceInformation configurationCollection = collectionList
240 .get(CONFIGURATION_COLLECTION_RESOURCE_URI);
241 if (null == configurationCollection
242 || null == configurationCollection.resource) {
243 displayToastMessage("Configuration collection resource does not exist!");
245 if (false == configurationResourceFlag) {
246 displayToastMessage("Configuration resource does not exist!");
248 final Dialog dialog = new Dialog(mcontext);
249 dialog.setContentView(R.layout.userinputforregionvalue);
250 dialog.setTitle("Enter the Region Value");
252 dialog.setCancelable(false);
254 Button ok = (Button) dialog.findViewById(R.id.ok);
255 Button cancel = (Button) dialog.findViewById(R.id.cancel);
257 ok.setOnClickListener(new OnClickListener() {
259 public void onClick(View v) {
261 EditText regionValue = (EditText) dialog
262 .findViewById(R.id.region);
263 region = regionValue.getText().toString();
264 if (region.equalsIgnoreCase("")) {
265 String toastmessage = "Please enter the Region Value";
266 displayToastMessage(toastmessage);
269 updateConfiguration(region);
273 cancel.setOnClickListener(new OnClickListener() {
275 public void onClick(View v) {
283 public void onBackPressed() {
284 super.onBackPressed();
286 // unregistering resource from the platform
288 resourceList.clear();
290 collectionList.clear();
291 collectionList = null;
294 private void setResourceListener() {
296 .setFindCandidateResourceListener(new IFindCandidateResourceListener() {
299 synchronized public void onResourceCallback(
300 Vector<OcResource> resources) {
301 Log.i(LOG_TAG, "onResourceCallback: enter");
302 for (int i = 0; i < resources.size(); i++) {
303 OcResource resource = resources.get(i);
304 String uri = resource.getUri();
305 String host = resource.getHost();
307 // Display resource information
308 Log.i(LOG_TAG, "Resource URI:" + uri);
309 Log.i(LOG_TAG, "Resource HOST: " + host);
310 Log.i(LOG_TAG, "Resource types: ");
311 logMessage = logMessage + "Resource URI : " + uri
313 logMessage = logMessage + "Resource Host : " + host
316 List<String> resourcetypes = resource
318 for (int j = 0; j < resourcetypes.size(); j++) {
319 Log.i(LOG_TAG, resourcetypes.get(j));
320 logMessage = logMessage + "ResourceType "
322 + resourcetypes.get(j) + "\n";
325 Log.i(LOG_TAG, "Interface types: ");
326 List<String> interfacetypes = resource
327 .getResourceInterfaces();
328 for (int j = 0; j < interfacetypes.size(); j++) {
329 Log.i(LOG_TAG, interfacetypes.get(j));
330 logMessage = logMessage + "interfacetype "
332 + interfacetypes.get(j) + "\n";
336 if (true == uri.contains("/resourceset")) {
337 collectionFound(resource);
339 resourceFound(resource);
341 } catch (OcException e) {
343 "OcExcepion occured! " + e.toString());
346 if (messageCount == 3) {
347 msg = Message.obtain();
349 mHandler.sendMessage(msg);
355 private void setConfigurationListener() {
356 thingsManager.setConfigurationListener(new IConfigurationListener() {
358 public void onBootStrapCallback(
359 Vector<OcHeaderOption> headerOptions, OcRepresentation rep,
361 Log.i(LOG_TAG, "onBootStrapCallback: enter");
365 public void onUpdateConfigurationsCallback(
366 Vector<OcHeaderOption> headerOptions, OcRepresentation rep,
368 Log.i(LOG_TAG, "onUpdateConfigurationsCallback: enter");
369 Log.i(LOG_TAG, "Resource URI: " + rep.getUri());
370 if (rep.hasAttribute("loc")) {
371 logMessage = logMessage + "Location : "
372 + rep.getValueString("loc") + "\n";
374 if (rep.hasAttribute("st")) {
375 logMessage = logMessage + "System Time : "
376 + rep.getValueString("loc") + "\n";
378 if (rep.hasAttribute("c")) {
379 logMessage = logMessage + "Currency : "
380 + rep.getValueString("c") + "\n";
382 if (rep.hasAttribute("r")) {
383 logMessage = logMessage + "Region : "
384 + rep.getValueString("r") + "\n";
390 public void onGetConfigurationsCallback(
391 Vector<OcHeaderOption> headerOptions, OcRepresentation rep,
393 Log.i(LOG_TAG, "onGetConfigurationsCallback: enter");
394 Log.i(LOG_TAG, "Resource URI: " + rep.getUri());
395 logMessage = logMessage + "Resource URI : " + rep.getUri()
398 if (rep.hasAttribute("loc")) {
399 logMessage = logMessage + "Location : "
400 + rep.getValueString("loc") + "\n";
402 if (rep.hasAttribute("st")) {
403 logMessage = logMessage + "System Time : "
404 + rep.getValueString("st") + "\n";
406 if (rep.hasAttribute("c")) {
407 logMessage = logMessage + "Currency : "
408 + rep.getValueString("c") + "\n";
410 if (rep.hasAttribute("r")) {
411 logMessage = logMessage + "Region : "
412 + rep.getValueString("r") + "\n";
415 msg = Message.obtain();
417 mHandler.sendMessage(msg);
422 private void setDiagnosticsListener() {
423 thingsManager.setDiagnosticsListener(new IDiagnosticsListener() {
426 public void onRebootCallback(Vector<OcHeaderOption> headerOptions,
427 OcRepresentation rep, int errorValue) {
428 Log.i(LOG_TAG, "onRebootCallback: enter");
432 public void onFactoryResetCallback(
433 Vector<OcHeaderOption> headerOptions, OcRepresentation rep,
435 Log.i(LOG_TAG, "onFactoryResetCallback: enter");
441 * This method find the resources available in network.
443 private void findCandidateResources(Vector<String> resourceTypes) {
444 OCStackResult result = thingsManager.findCandidateResources(
446 if (OCStackResult.OC_STACK_OK != result) {
447 Log.e(LOG_TAG, "Error while calling findCandidateResources");
448 String toastmessage = "findCandidateResources API returned error! ["
450 displayToastMessage(toastmessage);
452 if (messageCount == 1)
453 logMessage = logMessage + "API RESULT : " + result.toString()
458 * This method gets the configuration data from con-server.
460 private void getConfiguration() {
461 Log.i(LOG_TAG, "There are " + resourceList.size()
462 + " servers present in network");
463 ResourceInformation configurationCollection = collectionList
464 .get(CONFIGURATION_COLLECTION_RESOURCE_URI);
465 if (null == configurationCollection
466 || null == configurationCollection.resource) {
467 displayToastMessage("Configuration collection resource does not exist!");
470 if (false == configurationResourceFlag) {
472 displayToastMessage("Configuration resource does not exist!");
477 Vector<String> configs = new Vector<String>();
480 OCStackResult result = OCStackResult.OC_STACK_ERROR;
482 result = thingsManager.getConfigurations(
483 configurationCollection.resource, configs);
484 } catch (OcException e) {
488 if (OCStackResult.OC_STACK_OK != result) {
489 Log.e(LOG_TAG, "getConfigurations failed!");
490 String toastmessage = "getConfigurations API returned error! ["
492 displayToastMessage(toastmessage);
494 logMessage = "API RESULT : " + result.toString() + "\n";
495 msg = Message.obtain();
497 mHandler.sendMessage(msg);
501 * This method update the configuration resource region attribute to given
506 private void updateConfiguration(String region) {
507 ResourceInformation configurationCollection = collectionList
508 .get(CONFIGURATION_COLLECTION_RESOURCE_URI);
510 Map<String, String> configurations = new HashMap<String, String>();
513 configurations.put(name, region);
514 } catch (Exception e) {
515 Log.e(LOG_TAG, "Exception occured! " + e.toString());
518 OCStackResult result = OCStackResult.OC_STACK_ERROR;
520 result = thingsManager.updateConfigurations(
521 configurationCollection.resource, configurations);
522 } catch (OcException e) {
525 if (OCStackResult.OC_STACK_OK != result) {
526 Log.e(LOG_TAG, "updateConfigurations failed!");
527 String toastmessage = "updateConfigurations API returned error! ["
529 displayToastMessage(toastmessage);
531 logMessage = "API RESULT : " + result.toString() + "\n";
532 logMessage = logMessage + "Updating region to " + region;
533 msg = Message.obtain();
535 mHandler.sendMessage(msg);
539 * This method send request to reset all the configuration attribute values
542 private void factoryReset() {
543 ResourceInformation diagnosticsCollection = collectionList
544 .get(DIAGNOSTIC_COLLECTION_RESOURCE_URI);
545 if (null == diagnosticsCollection
546 || null == diagnosticsCollection.resource) {
547 displayToastMessage("Diagnostic collection does not exist!");
551 if (false == diagnosticsResourceFlag) {
552 displayToastMessage("Diagnostic resource does not exist!");
556 OCStackResult result = OCStackResult.values()[30];
559 result = thingsManager.factoryReset(diagnosticsCollection.resource);
560 } catch (OcException e) {
564 if (OCStackResult.OC_STACK_OK != result) {
565 Log.e(LOG_TAG, "factoryReset failed!");
566 String toastmessage = "factoryReset API returned error! [" + result
568 displayToastMessage(toastmessage);
571 logMessage = "API RESULT : " + result.toString() + "\n";
572 msg = Message.obtain();
574 mHandler.sendMessage(msg);
578 * This method send request to reboot server.
580 private void reboot() {
581 ResourceInformation diagnosticsCollection = collectionList
582 .get(DIAGNOSTIC_COLLECTION_RESOURCE_URI);
583 if (null == diagnosticsCollection
584 || null == diagnosticsCollection.resource) {
585 displayToastMessage("Diagnostic collection does not exist!");
588 if (false == diagnosticsResourceFlag) {
589 displayToastMessage("Diagnostic resource does not exist!");
593 OCStackResult result = OCStackResult.OC_STACK_ERROR;
595 result = thingsManager.reboot(diagnosticsCollection.resource);
596 } catch (OcException e) {
600 if (OCStackResult.OC_STACK_OK != result) {
601 Log.e(LOG_TAG, "reboot failed!");
602 String toastmessage = "reboot API returned error! [" + result + "]";
603 displayToastMessage(toastmessage);
605 logMessage = "API RESULT : " + result.toString() + "\n";
606 msg = Message.obtain();
608 mHandler.sendMessage(msg);
612 * This method is for getting list of all supported configuration values.
613 * Response will be in JSON format (key-value pair).
615 private String getListOfSupportedConfigurationUnits() {
616 return thingsManager.getListOfSupportedConfigurationUnits();
619 private void displayToastMessage(String message) {
620 Toast toast = Toast.makeText(this, message, Toast.LENGTH_SHORT);
622 Log.i(LOG_TAG, message);
625 private void collectionFound(OcResource resource) {
626 String uri = resource.getUri();
627 ResourceInformation resourceInfo = collectionList.get(uri);
628 if (null == resourceInfo) {
629 Log.e(LOG_TAG, "Collection is not created!");
633 if (null != resourceInfo.resource) {
634 Log.e(LOG_TAG, "Collection resource already updated!");
638 resourceInfo.resource = resource;
639 if (3 == messageCount) {
640 findGroupPressedFlag = true;
645 * This callback will be invoked when the interested resource discovered in
648 private void resourceFound(OcResource resource) throws OcException {
649 String uri = resource.getUri();
650 String host = resource.getHost();
652 // Check if the resource already exist in the map table
653 ResourceInformation resourceInfo = resourceList.get(uri + host);
654 if (null != resourceInfo) {
655 Log.e(LOG_TAG, "Resource already exists!");
660 resourceInfo = new ResourceInformation();
661 resourceInfo.resource = resource;
662 if (uri.equalsIgnoreCase("/oic/con")) {
663 ResourceInformation collectionResource = collectionList
664 .get(CONFIGURATION_COLLECTION_RESOURCE_URI);
665 if (null == collectionResource
666 || null == collectionResource.resourceHandle) {
667 Log.e(LOG_TAG, "Invalid Configuration collection!");
671 ResourceInformation resourceInfoCollection;
672 resourceInfoCollection = collectionList
673 .get(CONFIGURATION_COLLECTION_RESOURCE_URI);
674 OcResourceHandle handle;
675 handle = resourceInfoCollection.resourceHandle;
676 resourceInfo.resourceHandle = handle;
677 resourceInfo.resourceHandle = thingsManager.bindResourceToGroup(
680 resourceList.put(uri + host, resourceInfo);
681 configurationResourceFlag = true;
682 } else if (uri.equalsIgnoreCase("/oic/diag")) {
683 ResourceInformation diagnosticResource = collectionList
684 .get(DIAGNOSTIC_COLLECTION_RESOURCE_URI);
685 if (null == diagnosticResource
686 || null == diagnosticResource.resourceHandle) {
687 Log.e(LOG_TAG, "Invalid Configuration collection!");
691 ResourceInformation resourceInfoCollection;
692 resourceInfoCollection = collectionList
693 .get(DIAGNOSTIC_COLLECTION_RESOURCE_URI);
694 OcResourceHandle handle;
695 handle = resourceInfoCollection.resourceHandle;
696 resourceInfo.resourceHandle = handle;
697 resourceInfo.resourceHandle = thingsManager.bindResourceToGroup(
700 resourceList.put(uri + host, resourceInfo);
701 diagnosticsResourceFlag = true;
702 } else if (uri.equalsIgnoreCase("/factorySet")) {
703 ResourceInformation factorysetResource = collectionList
704 .get(FACTORYSET_COLLECTION_RESOURCE_URI);
705 if (null == factorysetResource
706 || null == factorysetResource.resourceHandle) {
707 Log.e(LOG_TAG, "Invalid Configuration collection!");
711 ResourceInformation resourceInfoCollection;
712 resourceInfoCollection = collectionList
713 .get(FACTORYSET_COLLECTION_RESOURCE_URI);
714 OcResourceHandle handle;
715 handle = resourceInfoCollection.resourceHandle;
716 resourceInfo.resourceHandle = handle;
717 resourceInfo.resourceHandle = thingsManager.bindResourceToGroup(
720 resourceList.put(uri + host, resourceInfo);
721 factorySetResourceFlag = true;
723 Log.e(LOG_TAG, "Resource is of different type: " + uri);
728 private void createResourceCollection(String uri, String typename)
731 Map<String, OcResourceHandle> groupList = new HashMap<String, OcResourceHandle>();
733 Log.i(LOG_TAG, "createGroup: " + typename);
734 // Check if the resource collection is already created
735 if (null != collectionList.get(uri)) {
736 Log.e(LOG_TAG, "Collection is already exist!");
740 OcResourceHandle resourceHandle = null;
743 OCStackResult result = thingsManager.createGroup(typename);
744 if ((OCStackResult.OC_STACK_OK != result)) {
745 Log.e(LOG_TAG, "createGroup returned error: " + result.name());
748 Log.e(LOG_TAG, "createGroup returned: " + result.name());
750 groupList = thingsManager.getGroupList();
751 if (groupList.containsKey(typename)) {
752 resourceHandle = groupList.get(typename);
754 Log.e(LOG_TAG, "group does not contain groupResourceType: "
758 if (null == resourceHandle) {
759 Log.e(LOG_TAG, " createResourceCollection : resourceHandle is NULL");
762 // Add the collection resource to map table
763 ResourceInformation resourceInfo = new ResourceInformation();
764 resourceInfo.resourceHandle = resourceHandle;
765 collectionList.put(uri, resourceInfo);
766 Log.i(LOG_TAG, "size of collectionList : " + collectionList.size());
769 private void deleteResources() {
770 Log.i(LOG_TAG, "deleteResources: enter");
772 // unregister all resources
773 for (ResourceInformation resource : resourceList.values()) {
774 if (null != resource.resourceHandle) {
775 if (resource.resource.getUri().equalsIgnoreCase(
776 CONFIGURATION_RESOURCE_URI)) {
777 ResourceInformation collectionResource = collectionList
778 .get(CONFIGURATION_COLLECTION_RESOURCE_URI);
779 if (null != collectionResource
780 && null != collectionResource.resourceHandle) {
782 .unregisterResource(resource.resourceHandle);
783 Log.i(LOG_TAG, "unregistered resource"
784 + CONFIGURATION_COLLECTION_RESOURCE_URI);
787 } else if (resource.resource.getUri().equalsIgnoreCase(
788 DIAGNOSTIC_RESOURCE_URI)) {
789 ResourceInformation diagnosticResource = collectionList
790 .get(DIAGNOSTIC_COLLECTION_RESOURCE_URI);
791 if (null != diagnosticResource
792 && null != diagnosticResource.resourceHandle) {
794 .unregisterResource(resource.resourceHandle);
795 Log.i(LOG_TAG, "unregistered resource"
796 + CONFIGURATION_COLLECTION_RESOURCE_URI);
798 } else if (resource.resource.getUri().equalsIgnoreCase(
799 FACTORYSET_RESOURCE_URI)) {
800 ResourceInformation factorysetResource = collectionList
801 .get(FACTORYSET_COLLECTION_RESOURCE_URI);
802 if (null != factorysetResource
803 && null != factorysetResource.resourceHandle) {
805 .unregisterResource(resource.resourceHandle);
806 Log.i(LOG_TAG, "unregistered resource"
807 + CONFIGURATION_COLLECTION_RESOURCE_URI);
814 // delete all the groups
815 thingsManager.deleteGroup(CONFIGURATION_COLLECTION_RESOURCE_TYPE);
816 thingsManager.deleteGroup(DIAGNOSTIC_COLLECTION_RESOURCE_TYPE);
817 thingsManager.deleteGroup(FACTORYSET_COLLECTION_RESOURCE_TYPE);
818 } catch (OcException e) {
819 Log.e(LOG_TAG, "OcException occured! " + e.toString());