1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __DMTJAVAPLUGINTREE_H__
18#define __DMTJAVAPLUGINTREE_H__
19
20#include "dmt.hpp"
21#include "jem_defs.hpp"
22#include "plugin/dmtRWPlugin.hpp"
23
24class DmtJavaPluginManager;
25
26class DmtJavaPluginTree : public DmtRWPluginTree
27{
28public:
29    DmtJavaPluginTree(const char* rootPath, DMMap<DMString, DMString>& mapParameters);
30    virtual SYNCML_DM_RET_STATUS_T DeleteNode(const char* path);
31    virtual SYNCML_DM_RET_STATUS_T CreateInteriorNode(const char* path, PDmtNode& ptrCreatedNode);
32    virtual SYNCML_DM_RET_STATUS_T CreateLeafNode(const char* path, PDmtNode& ptrCreatedNode, const DmtData& value);
33    virtual SYNCML_DM_RET_STATUS_T CreateLeafNode(const char* path, PDmtNode& ptrCreatedNode, const DmtData& value, BOOLEAN isESN);
34    virtual SYNCML_DM_RET_STATUS_T CreateInteriorNodeInternal(const char* path, PDmtNode& ptrCreatedNode, const DMStringVector& childNodeNames);
35    virtual SYNCML_DM_RET_STATUS_T CreateLeafNodeInternal(const char* path, PDmtNode& ptrCreatedNode, const DmtData& value);
36    virtual SYNCML_DM_RET_STATUS_T CreateLeafNodeInternal(const char* path, PDmtNode& ptrCreatedNode, const DmtData& value, BOOLEAN isESN);
37    virtual SYNCML_DM_RET_STATUS_T RenameNode(const char* path, const char* szNewNodeName);
38    virtual SYNCML_DM_RET_STATUS_T GetNode(const char* path, PDmtNode& ptrNode);
39    SYNCML_DM_RET_STATUS_T BuildPluginTree();
40    DMMap<DMString, DMString>& GetParameters();
41    DMString& GetRootPath();
42    SYNCML_DM_RET_STATUS_T GetNodeValueInternal(const char* path, DmtData& value);
43    SYNCML_DM_RET_STATUS_T SetNodeValueInternal(const char* path, const DmtData& value);
44    virtual BOOLEAN IsAtomic();
45    virtual SYNCML_DM_RET_STATUS_T Flush();
46    virtual SYNCML_DM_RET_STATUS_T Commit();
47    virtual SYNCML_DM_RET_STATUS_T Begin();
48    virtual SYNCML_DM_RET_STATUS_T Rollback();
49
50protected:
51    virtual ~DmtJavaPluginTree();
52
53private:
54    JemSmartPtr<DmtJavaPluginManager> m_pluginManager;
55    DMMap<DMString, DMString> m_parameters;
56    BOOLEAN mIsAtomic;
57};
58
59typedef JemSmartPtr<DmtJavaPluginTree> PDmtJavaPluginTree;
60
61#endif //__DMTJAVAPLUGINTREE_H__
62