Add missing public headers of the resource container API
authorMarkus Jung <markus.jung@samsung.com>
Thu, 16 Jul 2015 00:20:08 +0000 (09:20 +0900)
committerUze Choi <uzchoi@samsung.com>
Thu, 16 Jul 2015 02:15:43 +0000 (02:15 +0000)
Change-Id: I54bf4c3dc228ebb1cf9c5c811bb8e1369cc90549
Signed-off-by: Markus Jung <markus.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1685
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
service/resource-manipulation/include/BundleInfo.h [new file with mode: 0644]
service/resource-manipulation/include/ResourceContainer.h [new file with mode: 0644]

diff --git a/service/resource-manipulation/include/BundleInfo.h b/service/resource-manipulation/include/BundleInfo.h
new file mode 100644 (file)
index 0000000..fba9a08
--- /dev/null
@@ -0,0 +1,57 @@
+//******************************************************************
+//
+// Copyright 2015 Samsung Electronics All Rights Reserved.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+#ifndef BUNDLEINFO_H_
+#define BUNDLEINFO_H_
+
+#include <string>
+
+using namespace std;
+
+namespace OIC
+{
+    namespace Service
+    {
+        /*
+         * Describes a bundle with resources, that can be loaded dynamically.
+         */
+        class BundleInfo
+        {
+        public:
+            BundleInfo();
+            virtual ~BundleInfo();
+            virtual void setID(string name) = 0;
+            virtual string getID() = 0;
+            virtual void setPath(string path) = 0;
+            virtual string getPath() = 0;
+            virtual void setActivatorName(string activator) = 0;
+            virtual string getActivatorName() = 0;
+            virtual void setLibraryPath(string libpath) = 0;
+            virtual string getLibraryPath() = 0;
+            virtual void setVersion(string version) = 0;
+            virtual string getVersion() = 0;
+            static BundleInfo* build();
+        protected:
+            string m_ID, m_path, m_version;
+        };
+    }
+}
+
+#endif /* BUNDLEINFO_H_ */
diff --git a/service/resource-manipulation/include/ResourceContainer.h b/service/resource-manipulation/include/ResourceContainer.h
new file mode 100644 (file)
index 0000000..5636d39
--- /dev/null
@@ -0,0 +1,66 @@
+//******************************************************************
+//
+// Copyright 2015 Samsung Electronics All Rights Reserved.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+#ifndef RESOURCECONTAINER_H_
+#define RESOURCECONTAINER_H_
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include <map>
+#include <list>
+
+#include "BundleInfo.h"
+
+using namespace std;
+
+namespace OIC
+{
+    namespace Service
+    {
+        class ResourceContainer
+        {
+        public:
+            ResourceContainer();
+            virtual ~ResourceContainer();
+            //virtual void initializeResourceContainer() = 0;
+            virtual void startContainer(string configFile) = 0;
+            virtual void stopContainer() = 0;
+
+            // list of bundle ids
+            virtual std::list<BundleInfo*> listBundles() = 0;
+            virtual void startBundle(string bundleId) = 0;
+            virtual void stopBundle(string bundleId) = 0;
+
+            // dynamic configuration
+            virtual void addBundle(string bundleId, string bundleUri, string bundlePath, std::map<string, string> params) =0;
+            virtual void removeBundle(string bundleId) = 0;
+
+            virtual void addResourceConfig(string bundleId, string resourceUri, std::map<string, string> params)  = 0;
+            virtual void removeResourceConfig(string bundleId, string resourceUri)  = 0;
+
+            virtual std::list<string> listBundleResources(string bundleId) = 0;
+
+            static ResourceContainer *getInstance();
+        };
+    }
+}
+
+#endif /* RESOURCECONTAINER_H_ */