Not supported in Tizen 4.0.
Change-Id: Icf003353317c9da1f8c4a14c14a4165ba5447c66
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
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);
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}
{
}
-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;
}
+++ /dev/null
-/*
- * 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;
-}
+++ /dev/null
-/*
- * 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__ */
+++ /dev/null
-/*
- * 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;
-}
+++ /dev/null
-/*
- * 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__ */
+++ /dev/null
-/*
- * 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;
-}
+++ /dev/null
-/*
- * 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__ */
{
}
-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;
}
#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);
}
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;
}
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;
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;
}
{
}
-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;
#include <ServiceProxy.h>
#include <ContextStore.h>
#include <ContextStoreTypesPrivate.h>
-#include "Schema.h"
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);
+++ /dev/null
-/*
- * 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()
-{
-}
+++ /dev/null
-/*
- * 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__ */
+++ /dev/null
-/*
- * 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;
-}
+++ /dev/null
-/*
- * 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__ */