Remove API features managing databases in the application directories 92/117992/2
authorMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 8 Mar 2017 08:15:37 +0000 (17:15 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 8 Mar 2017 08:35:23 +0000 (17:35 +0900)
Not supported in Tizen 4.0.

Change-Id: Icf003353317c9da1f8c4a14c14a4165ba5447c66
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
17 files changed:
include/ContextStore.h
packaging/context-store.spec
src/client-dummy/ContextStore.cpp
src/client/AppManagedLocalStore.cpp [deleted file]
src/client/AppManagedLocalStore.h [deleted file]
src/client/AppManagedSharedStore.cpp [deleted file]
src/client/AppManagedSharedStore.h [deleted file]
src/client/AppManagedStore.cpp [deleted file]
src/client/AppManagedStore.h [deleted file]
src/client/ContextStore.cpp
src/client/ContextStoreManager.cpp
src/client/PlatformManagedStore.cpp
src/client/PlatformManagedStore.h
src/client/Schema.cpp [deleted file]
src/client/Schema.h [deleted file]
src/client/SchemaConf.cpp [deleted file]
src/client/SchemaConf.h [deleted file]

index cfe97d1..bd1222d 100644 (file)
@@ -28,7 +28,7 @@ namespace ctx {
        public:
                virtual ~ContextStore();
 
-               virtual int insert(const std::vector<std::string>& columns, Tuple& record);
+               virtual int insert(const std::vector<std::string>& columns, Tuple* record);
                virtual int insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records);
                virtual int retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result);
                virtual int remove(const std::string& selection);
index 235067e..573a430 100644 (file)
@@ -9,10 +9,9 @@ Source0:    %{name}-%{version}.tar.gz
 BuildRequires: cmake
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(gio-2.0)
-BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(libxml-2.0)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(capi-base-common)
-BuildRequires: pkgconfig(libtzplatform-config)
 BuildRequires: pkgconfig(context-common-server)
 BuildRequires: pkgconfig(context-common-client)
 Provides:   %{name}-profile_tv = %{version}-%{release}
index 47eca13..dd2b1d2 100644 (file)
@@ -27,7 +27,7 @@ ContextStore::~ContextStore()
 {
 }
 
-int ContextStore::insert(const std::vector<std::string>& columns, Tuple& record)
+int ContextStore::insert(const std::vector<std::string>& columns, Tuple* record)
 {
        return E_SUPPORT;
 }
diff --git a/src/client/AppManagedLocalStore.cpp b/src/client/AppManagedLocalStore.cpp
deleted file mode 100644 (file)
index 9480c4f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "AppManagedLocalStore.h"
-
-using namespace ctx;
-
-AppManagedLocalStore::AppManagedLocalStore(ServiceProxy* proxy) :
-       AppManagedStore(proxy)
-{
-}
-
-AppManagedLocalStore::~AppManagedLocalStore()
-{
-}
-
-int AppManagedLocalStore::init(Schema& schema)
-{
-       //TODO
-       return E_SUPPORT;
-}
-
-int AppManagedLocalStore::insert(const std::vector<std::string>& columns, Tuple& record)
-{
-       //TODO
-       return E_SUPPORT;
-}
-
-int AppManagedLocalStore::insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records)
-{
-       //TODO
-       return E_SUPPORT;
-}
-
-int AppManagedLocalStore::remove(const std::string& selection)
-{
-       //TODO
-       return E_SUPPORT;
-}
-
-int AppManagedLocalStore::destroy(const std::string& uri, ServiceProxy* proxy)
-{
-       //TODO
-       return E_NONE;
-}
diff --git a/src/client/AppManagedLocalStore.h b/src/client/AppManagedLocalStore.h
deleted file mode 100644 (file)
index 8ae4cc1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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 __CONTEXT_STORE_APP_MANAGED_LOCAL_STORE_H__
-#define __CONTEXT_STORE_APP_MANAGED_LOCAL_STORE_H__
-
-#include <ServiceProxy.h>
-#include <ContextStore.h>
-#include <ContextStoreTypesPrivate.h>
-#include "AppManagedStore.h"
-#include "Schema.h"
-
-namespace ctx {
-
-       class AppManagedLocalStore : public AppManagedStore {
-       public:
-               AppManagedLocalStore(ServiceProxy* proxy);
-               ~AppManagedLocalStore();
-
-               int init(Schema& schema);
-
-               int insert(const std::vector<std::string>& columns, Tuple& record);
-               int insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records);
-               int remove(const std::string& selection);
-
-               static int destroy(const std::string& uri, ServiceProxy* proxy);
-       };
-
-}
-
-#endif /* __CONTEXT_STORE_APP_MANAGED_LOCAL_STORE_H__ */
diff --git a/src/client/AppManagedSharedStore.cpp b/src/client/AppManagedSharedStore.cpp
deleted file mode 100644 (file)
index 0943d6b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "AppManagedSharedStore.h"
-
-using namespace ctx;
-
-AppManagedSharedStore::AppManagedSharedStore(ServiceProxy* proxy) :
-       AppManagedStore(proxy)
-{
-}
-
-AppManagedSharedStore::~AppManagedSharedStore()
-{
-}
-
-int AppManagedSharedStore::init(Schema& schema)
-{
-       //TODO
-       return E_SUPPORT;
-}
-
-int AppManagedSharedStore::insert(const std::vector<std::string>& columns, Tuple& record)
-{
-       return E_PRIVIL;
-}
-
-int AppManagedSharedStore::insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records)
-{
-       return E_PRIVIL;
-}
-
-int AppManagedSharedStore::remove(const std::string& selection)
-{
-       return E_PRIVIL;
-}
diff --git a/src/client/AppManagedSharedStore.h b/src/client/AppManagedSharedStore.h
deleted file mode 100644 (file)
index 26168ba..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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 __CONTEXT_STORE_APP_MANAGED_SHARED_STORE_H__
-#define __CONTEXT_STORE_APP_MANAGED_SHARED_STORE_H__
-
-#include <ServiceProxy.h>
-#include <ContextStore.h>
-#include <ContextStoreTypesPrivate.h>
-#include "AppManagedStore.h"
-#include "Schema.h"
-
-namespace ctx {
-
-       class AppManagedSharedStore : public AppManagedStore {
-       public:
-               AppManagedSharedStore(ServiceProxy* proxy);
-               ~AppManagedSharedStore();
-
-               int init(Schema& schema);
-
-               int insert(const std::vector<std::string>& columns, Tuple& record);
-               int insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records);
-               int remove(const std::string& selection);
-       };
-
-}
-
-#endif /* __CONTEXT_STORE_APP_MANAGED_SHARED_STORE_H__ */
diff --git a/src/client/AppManagedStore.cpp b/src/client/AppManagedStore.cpp
deleted file mode 100644 (file)
index 3ba01fd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "AppManagedStore.h"
-
-using namespace ctx;
-
-AppManagedStore::AppManagedStore(ServiceProxy* proxy) :
-       __proxy(proxy)
-{
-}
-
-AppManagedStore::~AppManagedStore()
-{
-}
-
-int AppManagedStore::retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result)
-{
-       // TODO
-       return E_SUPPORT;
-}
diff --git a/src/client/AppManagedStore.h b/src/client/AppManagedStore.h
deleted file mode 100644 (file)
index 6fd1035..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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 __CONTEXT_STORE_APP_MANAGED_STORE_H__
-#define __CONTEXT_STORE_APP_MANAGED_STORE_H__
-
-#include <ServiceProxy.h>
-#include <ContextStore.h>
-#include <ContextStoreTypesPrivate.h>
-#include "Schema.h"
-
-namespace ctx {
-
-       class AppManagedStore : public ContextStore {
-       public:
-               AppManagedStore(ServiceProxy* proxy);
-               virtual ~AppManagedStore();
-
-               int retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result);
-
-       private:
-               ServiceProxy* __proxy;
-       };
-
-}
-
-#endif /* __CONTEXT_STORE_APP_MANAGED_STORE_H__ */
index 47eca13..dd2b1d2 100644 (file)
@@ -27,7 +27,7 @@ ContextStore::~ContextStore()
 {
 }
 
-int ContextStore::insert(const std::vector<std::string>& columns, Tuple& record)
+int ContextStore::insert(const std::vector<std::string>& columns, Tuple* record)
 {
        return E_SUPPORT;
 }
index 692c582..69679f4 100644 (file)
 #include <IServiceSignalListener.h>
 #include <ContextStoreTypesPrivate.h>
 #include <ContextStoreManager.h>
-#include "SchemaConf.h"
-#include "AppManagedLocalStore.h"
-#include "AppManagedSharedStore.h"
 #include "PlatformManagedStore.h"
 
 using namespace ctx;
 
-static SchemaConf __schemaConf;
-
 static ServiceProxy* __getServiceProxy()
 {
        static ServiceProxy proxy(CTX_CONTEXT_STORE);
@@ -35,19 +30,20 @@ static ServiceProxy* __getServiceProxy()
 }
 
 template<typename StoreType>
-static ContextStore* __createStore(Schema& schema, int* error)
+static ContextStore* __createStore(const std::string& uri, int* error)
 {
        StoreType* store = new(std::nothrow) StoreType(__getServiceProxy());
 
        if (!store) {
                *error = E_NO_MEM;
-               _E("Memory allocation failed");
+               _E("%s", CTX_ERROR_STR(*error));
                return NULL;
        }
 
-       *error = store->init(schema);
+       *error = store->init(uri);
 
        if (*error != E_NONE) {
+               _E("%s", CTX_ERROR_STR(*error));
                delete store;
                return NULL;
        }
@@ -66,21 +62,12 @@ ContextStoreManager::~ContextStoreManager()
 int ContextStoreManager::getStore(const std::string& uri, ContextStore** store)
 {
        IF_FAIL_RETURN(store, E_PARAM);
-       IF_FAIL_RETURN(__schemaConf.init(), E_FAILED);
-
-       Schema& schema = __schemaConf.getSchema(uri);
+       _D("Getting the store %s", uri.c_str());
 
        int error = E_NONE;
        ContextStore* _store = NULL;
 
-       _store = __createStore<AppManagedLocalStore>(schema, &error);
-
-       if (error == E_PARAM)
-               _store = __createStore<PlatformManagedStore>(schema, &error);
-
-       if (error == E_PARAM)
-               _store = __createStore<AppManagedSharedStore>(schema, &error);
-
+       _store = __createStore<PlatformManagedStore>(uri, &error);
        IF_FAIL_RETURN(_store, error);
 
        *store = _store;
@@ -89,10 +76,14 @@ int ContextStoreManager::getStore(const std::string& uri, ContextStore** store)
 
 int ContextStoreManager::removeStore(const std::string& uri)
 {
-       int error = AppManagedLocalStore::destroy(uri, __getServiceProxy());
+       _D("Dropping the store %s", uri.c_str());
+
+       int error = E_NONE;
+
+       error = PlatformManagedStore::destroy(uri, __getServiceProxy());
 
-       if (error == E_PARAM)
-               error = PlatformManagedStore::destroy(uri, __getServiceProxy());
+       if (error != E_NONE)
+               _E("%s", CTX_ERROR_STR(error));
 
        return error;
 }
index bf856c8..575d29e 100644 (file)
@@ -27,13 +27,13 @@ PlatformManagedStore::~PlatformManagedStore()
 {
 }
 
-int PlatformManagedStore::init(Schema& schema)
+int PlatformManagedStore::init(const std::string& uri)
 {
        // TODO
        return E_SUPPORT;
 }
 
-int PlatformManagedStore::insert(const std::vector<std::string>& columns, Tuple& record)
+int PlatformManagedStore::insert(const std::vector<std::string>& columns, Tuple* record)
 {
        // TODO
        return E_SUPPORT;
index 990f951..fbc7bcd 100644 (file)
@@ -20,7 +20,6 @@
 #include <ServiceProxy.h>
 #include <ContextStore.h>
 #include <ContextStoreTypesPrivate.h>
-#include "Schema.h"
 
 namespace ctx {
 
@@ -29,9 +28,9 @@ namespace ctx {
                PlatformManagedStore(ServiceProxy* proxy);
                ~PlatformManagedStore();
 
-               int init(Schema& schema);
+               int init(const std::string& uri);
 
-               int insert(const std::vector<std::string>& columns, Tuple& record);
+               int insert(const std::vector<std::string>& columns, Tuple* record);
                int insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records);
                int retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result);
                int remove(const std::string& selection);
diff --git a/src/client/Schema.cpp b/src/client/Schema.cpp
deleted file mode 100644 (file)
index cfbe505..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "Schema.h"
-
-using namespace ctx;
-
-Schema::Schema()
-{
-}
-
-Schema::~Schema()
-{
-}
diff --git a/src/client/Schema.h b/src/client/Schema.h
deleted file mode 100644 (file)
index 1e94e3b..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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 __CONTEXT_STORE_SCHEMA_H__
-#define __CONTEXT_STORE_SCHEMA_H__
-
-#include <string>
-#include <ContextStoreTypesPrivate.h>
-
-namespace ctx {
-
-       class Schema {
-       public:
-               ~Schema();
-
-       private:
-               Schema();
-
-               friend class SchemaConf;
-       };
-
-}
-
-#endif /* __CONTEXT_STORE_SCHEMA_H__ */
diff --git a/src/client/SchemaConf.cpp b/src/client/SchemaConf.cpp
deleted file mode 100644 (file)
index bccebdf..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "SchemaConf.h"
-
-using namespace ctx;
-
-SchemaConf::SchemaConf()
-{
-}
-
-SchemaConf::~SchemaConf()
-{
-}
-
-bool SchemaConf::init()
-{
-       return true;
-}
-
-Schema& SchemaConf::getSchema(const std::string& uri)
-{
-       static Schema dummy;
-       return dummy;
-}
diff --git a/src/client/SchemaConf.h b/src/client/SchemaConf.h
deleted file mode 100644 (file)
index 3bb0674..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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 __CONTEXT_STORE_SCHEMA_CONF_H__
-#define __CONTEXT_STORE_SCHEMA_CONF_H__
-
-#include <string>
-#include <ContextStoreTypesPrivate.h>
-#include "Schema.h"
-
-namespace ctx {
-
-       class SchemaConf {
-       public:
-               SchemaConf();
-               ~SchemaConf();
-
-               bool init();
-
-               Schema& getSchema(const std::string& uri);
-       };
-
-}
-
-#endif /* __CONTEXT_STORE_SCHEMA_CONF_H__ */