iotivity 0.9.0
[platform/upstream/iotivity.git] / service / protocol-plugin / plugin-manager / src / FelixAdapter.cpp
1 //******************************************************************
2 //
3 // Copyright 2014 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
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
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
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.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 /// @file FelixAdapter.cpp
22
23 /// @brief
24
25 #include "FelixAdapter.h"
26
27 using namespace OIC;
28
29 FelixAdapter *FelixAdapter::s_pinstance;
30
31 FelixAdapter::FelixAdapter()
32 {
33     config = Config::Getinstance();
34     std::string pluginpath = config->getPluginPath();
35     if (pluginpath != "")
36     {
37         printf("Current path is %s\n", pluginpath.c_str());
38     }
39     else
40     {
41         fprintf(stderr, "Pluing path is not exist\n");
42         pluginpath = "";
43     }
44     registerAllPlugin(pluginpath);
45 }
46
47 FelixAdapter::~FelixAdapter(void)
48 {
49     s_pinstance->deleteinstance();
50 }
51
52 int FelixAdapter::installPlugin(const std::string path)
53 {
54     return 1;
55 }
56
57 int FelixAdapter::findPluginRecursive(const std::string path)
58 {
59     return 1;
60 }
61
62 int FelixAdapter::loadPluginInfoToManager(const std::string path)
63 {
64     return 1;
65 }
66
67 int FelixAdapter::registerPlugin(const std::string path)
68 {
69     return 1;
70 }
71
72 int FelixAdapter::registerAllPlugin(const std::string path)
73 {
74     return 1;
75 }
76
77 int FelixAdapter::unregisterPlugin(Plugin *const plugin)
78 {
79     return 1;
80 }
81
82 int FelixAdapter::unregisterAllPlugin(void)
83 {
84     return 1;
85 }
86
87 std::vector<Plugin> &FelixAdapter::getAllPlugins(void)
88 {
89     return m_plugins;
90 }
91
92 std::vector<Plugin> *FelixAdapter::findPlugins(const std::string key, const std::string value)
93 {
94     return nullptr;
95 }
96 /*
97 Plugin *FelixAdapter::getPlugin(const std::string plugID)
98 {
99     return nullptr;
100 }
101 */
102 bool FelixAdapter::getFileList(File_list &list, const std::string strDir)
103 {
104     return true;
105 }
106
107
108 void FelixAdapter::printPluginList(cp_plugin_info_t **plugins)
109 {
110
111 }
112
113 int FelixAdapter::start(Plugin *const plugin, void *const arg)
114 {
115     return TRUE;
116 }
117
118 int FelixAdapter::stop(Plugin *const plugin)
119 {
120     return TRUE;
121 }
122
123 bool FelixAdapter::isStarted(Plugin *plugin)
124 {
125     return FALSE;
126 }
127 /*
128 void FelixAdapter::observePluginPath(void *str)
129 {
130
131 }
132 */
133 const std::string FelixAdapter::getState(const std::string plugID)
134 {
135     return "";
136 }