DATABASE: remove non-staic variable from DB scheme definition class
authorgreatim <jaewon81.lim@samsung.com>
Thu, 9 Jul 2015 12:27:02 +0000 (21:27 +0900)
committergreatim <jaewon81.lim@samsung.com>
Mon, 13 Jul 2015 06:53:44 +0000 (15:53 +0900)
remove non-static variable from DB scheme definition class
reset temporary variable for each trace

Change-Id: I6419ff6b63dfee3c1665507caabe70dce24773e0
Signed-off-by: greatim <jaewon81.lim@samsung.com>
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkSeriesDBManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/DB/GLBufferSizeDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/DB/GLCommonStateDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/DB/GLStateSharingDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLCommonStateDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLContextSharingDataMaker.java

index 14cb1fb..02d78ee 100644 (file)
@@ -55,6 +55,8 @@ public class NetworkDataManager extends PageDataManager {
 
        private static NetworkDataManager instance = new NetworkDataManager();
 
+       private int rid = 0;
+
        private NetworkDataMaker networkDataMaker = null;
        private NetworkSeriesDBManager seriesDBManager = null;
        private NetworkAPIDBManager apiDBManager = null;
@@ -88,6 +90,7 @@ public class NetworkDataManager extends PageDataManager {
                chartCount = 0;
                accessSeriesSize = 0;
                networkDataMaker.clear();
+               rid = 0;
        }
 
        public LinkedHashMap<String, String> getCheckStatusSeries() {
@@ -115,7 +118,7 @@ public class NetworkDataManager extends PageDataManager {
                                        && seriesType.getFdValue().equals(fd) && seriesType.getAPIType() == apiType
                                        && seriesType.getEndTime() < 0) {
                                seriesList.get(i).setEndTime(endTime);
-                               seriesDBManager.insert(seriesType);
+                               insertToSeriesDB(seriesType);
                                break;
                        }
                }
@@ -128,11 +131,18 @@ public class NetworkDataManager extends PageDataManager {
                for (int i = 0; i < seriesList.size(); i++) {
                        NetworkSeriesType seriesType = seriesList.get(i);
                        if (seriesType.getEndTime() < 0) {
-                               seriesDBManager.insert(seriesType);
+                               insertToSeriesDB(seriesType);
                        }
                }
        }
 
+       private void insertToSeriesDB(NetworkSeriesType insertData) {
+               List<List<Object>> insertDataList = new ArrayList<List<Object>>();
+               insertData.setRid(rid++);
+               insertDataList.add(insertData.getDBInsertData());
+               seriesDBManager.insertData(insertDataList);
+       }
+
        public void openData(Map<String, String> dataMap) {
                // set series list from DB
                if (null == seriesList) {
index 7ee2e58..1bfe568 100644 (file)
@@ -75,8 +75,6 @@ public class NetworkSeriesDBManager extends DBTable {
                        + CommonConstants.COMMA + API_ID + CommonConstants.COMMA + PID
                        + " from " + TABLENAME + " where pid = '%s'"; //$NON-NLS-1$
 
-       private static int rid = 0;
-
        @Override
        public String getTableName() {
                return TABLENAME;
@@ -91,14 +89,6 @@ public class NetworkSeriesDBManager extends DBTable {
                addColumn(new DBColumn(STATUS_TYPE, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
                addColumn(new DBColumn(API_ID, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
                addColumn(new DBColumn(PID, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
-               rid = 0;
-       }
-
-       public void insert(NetworkSeriesType insertData) {
-               List<List<Object>> insertDataList = new ArrayList<List<Object>>();
-               insertData.setRid(rid++);
-               insertDataList.add(insertData.getDBInsertData());
-               insertData(insertDataList);
        }
 
        public List<NetworkSeriesType> select(double visibleStartTime, double visibleEndTime) {
index 49f3e41..d2e9fb6 100644 (file)
@@ -28,7 +28,6 @@ package org.tizen.dynamicanalyzer.ui.opengl.data.DB;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
@@ -36,8 +35,6 @@ import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
 import org.tizen.dynamicanalyzer.database.DBTable;
 import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
-import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData;
-import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLBufferSizeType;
 import org.tizen.dynamicanalyzer.util.Logger;
 
@@ -49,16 +46,6 @@ public class GLBufferSizeDBTableManager extends DBTable {
        private static final String ARRAY_BUFFER_USAGE = "ARRAY_BUFFER_USAGE";//$NON-NLS-1$
        private static final String ELEMENT_ARRAY_BUFFER_SIZE = "ELEMENT_ARRAY_BUFFER_SIZE";//$NON-NLS-1$
        private static final String ELEMENT_ARRAY_BUFFER_USAGE = "ELEMENT_ARRAY_BUFFER_USAGE";//$NON-NLS-1$
-       private final int GL_ARRAY_BUFFER = 34962;
-       
-       private int arrayBufferSize = 0;
-       private int arrayBufferUsage = 0;
-       private int elementArrayBufferSize = 0;
-       private int elementArrayBufferUsage = 0;
-
-       private final int CONTEXT_VALUE_PARSER_TYPE_INDEX = 0;
-       private final int CONTEXT_VALUE_PARSER_SIZE_INDEX = 1;
-       private final int CONTEXT_VALUE_PARSER_USAGE_INDEX = 2;
 
        public final static int TABLE_SEQ_ID_INDEX = 0;
        public final static int TABLE_CONTEXT_ID_INDEX = 1;
@@ -72,7 +59,6 @@ public class GLBufferSizeDBTableManager extends DBTable {
        public final static int SELECT_ELEMENT_ARRARY_BUFFER_SIZE_INDEX = 2;
        public final static int SELECT_ELEMENT_ARRARY_BUFFER_USAGE_INDEX = 3;
 
-       int testCount = 0;
        private static final String SELECT = "select "//$NON-NLS-1$
                        + ARRAY_BUFFER_SIZE + CommonConstants.COMMA
                        + ARRAY_BUFFER_USAGE
@@ -99,92 +85,6 @@ public class GLBufferSizeDBTableManager extends DBTable {
                addColumn(new DBColumn(ELEMENT_ARRAY_BUFFER_USAGE, DBConstants.NOT_NULL,
                                DBConstants.DBTYPE_INT4));
                setIndexColumn(TABLE_CONTEXT_ID_INDEX);
-
-               arrayBufferSize = 0;
-               arrayBufferUsage = 0;
-               elementArrayBufferSize = 0;
-               elementArrayBufferUsage = 0;
-       }
-
-       public void insert(GLES20LogData logData) {
-               List<List<Object>> insertDataList = new ArrayList<List<Object>>();
-               List<Object> data = new ArrayList<Object>();
-               if (isBufferEqualZeroOfGLBindBuffer(logData)
-                               || updateChangedBufferSize(logData.getContextValue().trim())) {
-                       data.add(logData.getSeq());
-                       data.add(logData.getCurrentContextID());
-                       data.add(arrayBufferSize);
-                       data.add(arrayBufferUsage);
-                       data.add(elementArrayBufferSize);
-                       data.add(elementArrayBufferUsage);
-                       insertDataList.add(data);
-                       insertData(insertDataList);
-               }
-       }
-
-       private boolean isBufferEqualZeroOfGLBindBuffer(GLES20LogData logData) {
-               if (!logData.getApiName().equals(GLAPINameDefine.API_GL_BUFFER_BIND)) {
-                       return false;
-               }
-               if (!logData.getArgs().contains(CommonConstants.COMMA)) {
-                       return false;
-               }
-               String argsSplit[] = logData.getArgs().split(CommonConstants.COMMA);
-               if (argsSplit.length != 2) {
-                       return false;
-               }
-               int target = Integer.parseInt(argsSplit[0].trim());
-               int buffer = Integer.parseInt(argsSplit[1].trim());
-               if (buffer == 0) {
-                       if (target == GL_ARRAY_BUFFER) {
-                               arrayBufferSize = 0;
-                               arrayBufferUsage = 0;
-                       } else {
-                               elementArrayBufferSize = 0;
-                               elementArrayBufferUsage = 0;
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-
-       private boolean updateChangedBufferSize(String memorySize) {
-               boolean isChagned = false;
-               if (!memorySize.contains(CommonConstants.COMMA)) {
-                       return isChagned;
-               }
-               String contextValues[] = memorySize.split(CommonConstants.COMMA);
-               if (contextValues.length != 3) {
-                       Logger.error("GL buffer API - size of the parameter of the context log column is not 2");
-                       return isChagned;
-               }
-               if (Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_TYPE_INDEX]) == GL_ARRAY_BUFFER) {
-                       if (arrayBufferSize != Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX])) {
-                               arrayBufferSize = Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX]);
-                               isChagned = true;
-                       }
-                       if (arrayBufferUsage != Integer
-                                       .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX])) {
-                               arrayBufferUsage = Integer
-                                               .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX]);
-                               isChagned = true;
-                       }
-               } else {
-                       if (elementArrayBufferSize != Integer
-                                       .parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX])) {
-                               elementArrayBufferSize = Integer
-                                               .parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX]);
-                               isChagned = true;
-                       }
-                       if (elementArrayBufferUsage != Integer
-                                       .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX])) {
-                               elementArrayBufferUsage = Integer
-                                               .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX]);
-                               isChagned = true;
-                       }
-               }
-               return isChagned;
        }
 
        public GLBufferSizeType getBufferSize(long contextID, long selectedSeq) {
index d9a311f..5f29b75 100644 (file)
@@ -39,7 +39,7 @@ import org.tizen.dynamicanalyzer.util.Logger;
 
 public class GLCommonStateDBTableManager extends DBTable {
        private static final String TABLENAME = "GL_CONTEXT";//$NON-NLS-1$
-       private String[] columnName = null;
+       private final String[] columnName;
        private int rid = 0;
        public final static int TABLE_CONTEXT_ID_INDEX = 1;
        private static final String SELECT_CONTEXT_TABLE__QUERY = "select RID, SEQUENCE_NUMBER, CONTEXT_ID, VIEWPORT, BLEND_ENABLED, BLEND_COLOR, BLEND_DEST_RGB, BLEND_DEST_ALPHA, BLEND_EQUATION_RGB, BLEND_EQUATION_ALPHA, BLEND_SRC_RGB, BLEND_SRC_ALPHA, CULLING_ENABLED, CULLING_ORIENTATION, CULLING_MODE, DEPTH_ENABLED, DEPTH_FUNC, DEPTH_RANGE_N, DEPTH_RANGE_F, DITHER_ENABLED, FRAME_BUFFER_BINDING, LINE_WIDTH, POLY_ENABLED, POLY_FACTOR, POLY_UNITS, SCISSOR_ENABLED, SCISSOR, STENCIL_ENABLED, STENCIL_FRONT_FUNC, STENCIL_FRONT_REF, STENCIL_FRONT_MASK, STENCIL_FRONT_S_FAIL, STENCIL_FRONT_D_FAIL, STENCIL_FRONT_D_PASS, STENCIL_BACK_FUNC, STENCIL_BACK_REF, STENCIL_BACK_MASK, STENCIL_BACK_S_FAIL, STENCIL_BACK_D_FAIL, STENCIL_BACK_D_PASS, PACK_ALIGN, UNPACK_ALIGN, GVA_ENABLED, GVA_SIZE, GVA_TYPE, GVA_NORMAL, GVA_STRIDE, GVA_POINTER, GVA_V0, GVA_V1, GVA_V2, GVA_V3, VBO_ARRAY_BINDING, VBO_ARRAY_ID, VBO_ARRAY_SIZE, VBO_ARRAY_DATA, VBO_ARRAY_USAGE, VBO_ELEMENT_BINDING, VBO_ELEMENT_ID, VBO_ELEMENT_SIZE, VBO_ELEMENT_DATA, VBO_ELEMENT_USAGE, TEXTURE_ACTIVE from "//$NON-NLS-1$
index 68ea452..2a20c6e 100644 (file)
@@ -36,7 +36,6 @@ import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
 import org.tizen.dynamicanalyzer.database.DBTable;
 import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
-import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSharingContextType;
 import org.tizen.dynamicanalyzer.util.Logger;
 
@@ -65,34 +64,6 @@ public class GLStateSharingDBTableManager extends DBTable {
                savedSharingInfoList = new ArrayList<GLSharingContextType>();
        }
 
-       public void insertSharingData(List<GLSharingContextType> sharingInfoList) {
-               List<List<Object>> insertList = new ArrayList<List<Object>>();
-               for (int i = 0; i < sharingInfoList.size(); i++) {
-                       GLSharingContextType insertSharingType = sharingInfoList.get(i);
-                       if (!isSavedSharingData(insertSharingType)) {
-                               List<Object> objectList = new ArrayList<Object>();
-                               objectList.add(insertSharingType.getContextId());
-                               objectList.add(insertSharingType.getSharingContextId());
-                               insertList.add(objectList);
-                               savedSharingInfoList.add(insertSharingType);
-                       }
-               }
-               insertData(insertList);
-               GLDataManager.getInstance().updateSharingContextList();
-       }
-
-       private boolean isSavedSharingData(GLSharingContextType insertSharingType) {
-               for (int j = 0; j < savedSharingInfoList.size(); j++) {
-                       GLSharingContextType savedSharingType = savedSharingInfoList.get(j);
-                       if (savedSharingType.getContextId() == insertSharingType.getContextId()
-                                       && savedSharingType.getSharingContextId() == insertSharingType
-                                                       .getSharingContextId()) {
-                               return true;
-                       }
-               }
-               return false;
-       }
-
        public List<GLSharingContextType> selectSharingData() {
                ResultSet rs = SqlConnectionManager.executeQueryRS(SELECT_QUERY);
                if (rs == null) {
index 3d2d564..94069df 100644 (file)
@@ -26,6 +26,9 @@
 
 package org.tizen.dynamicanalyzer.ui.opengl.data;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine;
@@ -35,8 +38,18 @@ import org.tizen.dynamicanalyzer.util.Logger;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
 public class GLCommonStateDataMaker {
+       private final int GL_ARRAY_BUFFER = 34962;
+       private final int CONTEXT_VALUE_PARSER_TYPE_INDEX = 0;
+       private final int CONTEXT_VALUE_PARSER_SIZE_INDEX = 1;
+       private final int CONTEXT_VALUE_PARSER_USAGE_INDEX = 2;
+
        private GLStateDataManager glStateDataManager = null;
 
+       private int arrayBufferSize = 0;
+       private int arrayBufferUsage = 0;
+       private int elementArrayBufferSize = 0;
+       private int elementArrayBufferUsage = 0;
+
        public GLCommonStateDataMaker(GLStateDataManager glStateDataManager) {
                this.glStateDataManager = glStateDataManager;
        }
@@ -351,14 +364,14 @@ public class GLCommonStateDataMaker {
                                                GLContextNameEnum.VBO_ELEMENT_USAGE.ordinal(),
                                                currentContextValue.vboElementUsage);
                        }
-                       GLDataManager.getInstance().getBufferSizeDBTable().insert(logData);
+                       insertToBufferSizeDB(logData);
                } else if (logData.getApiName().equals(GLAPINameDefine.API_GL_BUFFER_BIND)) {
                        if (parameters.length != 2) {
                                Logger.error("GL extract API parameter  : " + GLAPINameDefine.API_GL_BUFFER_BIND);
                                return;
                        }
                        if (Integer.parseInt(parameters[1]) == 0) {
-                               GLDataManager.getInstance().getBufferSizeDBTable().insert(logData);
+                               insertToBufferSizeDB(logData);
                                return;
                        }
 
@@ -374,7 +387,7 @@ public class GLCommonStateDataMaker {
                                                GLContextNameEnum.VBO_ELEMENT_BINDING.ordinal(),
                                                currentContextValue.vboElementBinding);
                        }
-                       GLDataManager.getInstance().getBufferSizeDBTable().insert(logData);
+                       insertToBufferSizeDB(logData);
                } else if (logData.getApiName().equals(GLAPINameDefine.API_GL_BUFFER_DATA)) {
                        if (parameters.length != 4) {
                                Logger.error("GL extract API parameter  : " + GLAPINameDefine.API_GL_BUFFER_DATA);
@@ -408,7 +421,7 @@ public class GLCommonStateDataMaker {
                                                GLContextNameEnum.VBO_ELEMENT_USAGE.ordinal(),
                                                currentContextValue.vboElementUsage);
                        }
-                       GLDataManager.getInstance().getBufferSizeDBTable().insert(logData);
+                       insertToBufferSizeDB(logData);
                }
        }
 
@@ -675,4 +688,84 @@ public class GLCommonStateDataMaker {
                }
        }
 
+       public void insertToBufferSizeDB(GLES20LogData logData) {
+               List<List<Object>> insertDataList = new ArrayList<List<Object>>();
+               List<Object> data = new ArrayList<Object>();
+               if (isBufferEqualZeroOfGLBindBuffer(logData)
+                               || updateChangedBufferSize(logData.getContextValue().trim())) {
+                       data.add(logData.getSeq());
+                       data.add(logData.getCurrentContextID());
+                       data.add(arrayBufferSize);
+                       data.add(arrayBufferUsage);
+                       data.add(elementArrayBufferSize);
+                       data.add(elementArrayBufferUsage);
+                       insertDataList.add(data);
+                       GLDataManager.getInstance().getBufferSizeDBTable().insertData(insertDataList);
+               }
+       }
+
+       private boolean isBufferEqualZeroOfGLBindBuffer(GLES20LogData logData) {
+               if (!logData.getApiName().equals(GLAPINameDefine.API_GL_BUFFER_BIND)) {
+                       return false;
+               }
+               if (!logData.getArgs().contains(CommonConstants.COMMA)) {
+                       return false;
+               }
+               String argsSplit[] = logData.getArgs().split(CommonConstants.COMMA);
+               if (argsSplit.length != 2) {
+                       return false;
+               }
+               int target = Integer.parseInt(argsSplit[0].trim());
+               int buffer = Integer.parseInt(argsSplit[1].trim());
+               if (buffer == 0) {
+                       if (target == GL_ARRAY_BUFFER) {
+                               arrayBufferSize = 0;
+                               arrayBufferUsage = 0;
+                       } else {
+                               elementArrayBufferSize = 0;
+                               elementArrayBufferUsage = 0;
+                       }
+                       return true;
+               } else {
+                       return false;
+               }
+       }
+
+       private boolean updateChangedBufferSize(String memorySize) {
+               boolean isChanged = false;
+               if (!memorySize.contains(CommonConstants.COMMA)) {
+                       return isChanged;
+               }
+               String contextValues[] = memorySize.split(CommonConstants.COMMA);
+               if (contextValues.length != 3) {
+                       Logger.error("GL buffer API - size of the parameter of the context log column is not 2");
+                       return isChanged;
+               }
+               if (Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_TYPE_INDEX]) == GL_ARRAY_BUFFER) {
+                       if (arrayBufferSize != Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX])) {
+                               arrayBufferSize = Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX]);
+                               isChanged = true;
+                       }
+                       if (arrayBufferUsage != Integer
+                                       .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX])) {
+                               arrayBufferUsage = Integer
+                                               .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX]);
+                               isChanged = true;
+                       }
+               } else {
+                       if (elementArrayBufferSize != Integer
+                                       .parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX])) {
+                               elementArrayBufferSize = Integer
+                                               .parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX]);
+                               isChanged = true;
+                       }
+                       if (elementArrayBufferUsage != Integer
+                                       .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX])) {
+                               elementArrayBufferUsage = Integer
+                                               .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX]);
+                               isChanged = true;
+                       }
+               }
+               return isChanged;
+       }
 }
index 208b4d3..4ece9ff 100644 (file)
@@ -44,6 +44,8 @@ import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 public class GLContextSharingDataMaker {
        private GLStateDataManager glStateDataManager = null;
 
+       List<GLSharingContextType> savedSharingInfoList = new ArrayList<GLSharingContextType>();
+
        public GLContextSharingDataMaker(GLStateDataManager glStateDataManager) {
                this.glStateDataManager = glStateDataManager;
        }
@@ -142,8 +144,36 @@ public class GLContextSharingDataMaker {
                                        .next();
                        insertSharingInfoList.addAll(getInsertSharingInfoList(e.getValue()));
                }
-               GLDataManager.getInstance().getStateSharingDBTableManage()
-                               .insertSharingData(insertSharingInfoList);
+               insertSharingDataToDB(insertSharingInfoList);
+       }
+
+       public void insertSharingDataToDB(List<GLSharingContextType> sharingInfoList) {
+               List<List<Object>> insertList = new ArrayList<List<Object>>();
+               for (int i = 0; i < sharingInfoList.size(); i++) {
+                       GLSharingContextType insertSharingType = sharingInfoList.get(i);
+                       if (!isSavedSharingData(insertSharingType)) {
+                               List<Object> objectList = new ArrayList<Object>();
+                               objectList.add(insertSharingType.getContextId());
+                               objectList.add(insertSharingType.getSharingContextId());
+                               insertList.add(objectList);
+                               savedSharingInfoList.add(insertSharingType);
+                       }
+               }
+
+               GLDataManager.getInstance().getStateSharingDBTableManage().insertData(insertList);
+               GLDataManager.getInstance().updateSharingContextList();
+       }
+
+       private boolean isSavedSharingData(GLSharingContextType insertSharingType) {
+               for (int j = 0; j < savedSharingInfoList.size(); j++) {
+                       GLSharingContextType savedSharingType = savedSharingInfoList.get(j);
+                       if (savedSharingType.getContextId() == insertSharingType.getContextId()
+                                       && savedSharingType.getSharingContextId() == insertSharingType
+                                                       .getSharingContextId()) {
+                               return true;
+                       }
+               }
+               return false;
        }
 
        private List<GLSharingContextType> getInsertSharingInfoList(GLContextDataManager contextValue) {