gt: 			String res = mDao.removeUser(memoryName, userToRemove);
context: //+----------------------------------------------------------------------------+
  //|  Copyright Notice:                                                         |
  //|                                                                            |
  //|      Copyright (C) 1990-2016, International Business Machines              |
  //|      Corporation and others. All rights reserved                           |
  //+----------------------------------------------------------------------------+
  package com.otm.webservice;
  
  import java.beans.PropertyVetoException;
  import java.io.IOException;
  import java.sql.SQLException;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.List;
  import java.util.Map;
  
  import javax.xml.parsers.ParserConfigurationException;
  
  import org.apache.log4j.Logger;
  import org.xml.sax.SAXException;
  
  import com.otm.db.Dao;
  import com.otm.db.DaoFactory;
  import com.otm.db.TU;
  import com.otm.log.ServiceLogger;
  import com.otm.util.SyncParameters;
  import com.otm.util.TmxSaxParser;
  
  // this class should be thread safe
  // it's a single instance
  
  public class OtmTMServiceSynchronizes {
  	
  	// an immutable object
  	private final Dao mDao = DaoFactory.getInstance();
  	//private final Object mLockObj = new Object();
      //private volatile boolean mDbExisted = false;
  	private static Logger mLogger = Logger.getLogger(ServiceLogger.class.getName());
  	
  	/**
  	 * 
  	 * @param paramHash
  	 * @return
  	 */
  	public HashMap<String, String> create(HashMap<String, String> paramHash) {
  		HashMap<String, String> result = new HashMap<String, String>();
  
  		try {
  			String memoryname = paramHash.get(SyncParameters.DATASOURCENAME);
  			String user = paramHash.get(SyncParameters.USER_ID);
  			String password = paramHash.get(SyncParameters.PASSWORD);
              String userList = paramHash.get(SyncParameters.USERIDLIST);
             
              // to compatible for older version "userIdList"
              if(null==userList || userList.isEmpty()) {
              	userList = paramHash.get("user-id-list");
              }
              // to compatible for older version ";" to ","
              if(userList!=null && !userList.isEmpty()) {
              	userList = userList.replaceAll(";",",");
              }
              
  			result.put("method",  paramHash.get(SyncParameters.METHOD));
  			result.put(SyncParameters.DATASOURCENAME, memoryname);
             
  			try {
  				mDao.createMemory(memoryname, user,password,userList);
  			} catch (PropertyVetoException e) {
  				e.printStackTrace();
  				result.put(SyncParameters.RESPONSESTATUSMSG, e.getMessage());
  				mLogger.error(result);
  				return result;
  			}
  
  		} catch (SQLException e) {
  			result.put(SyncParameters.RESPONSESTATUSMSG, e.getMessage());
  			mLogger.error(result);
  			return result;
  		}
  
  		result.put(SyncParameters.RESPONSESTATUSMSG, "success");
  		mLogger.info(result);
  		return result;
  	}
  	
  	
  	/**
  	 * 
  	 * @param paramHash
  	 * @return
  	 */
  	public HashMap<String, String> delete(HashMap<String, String> paramHash) {
  		HashMap<String, String> result = new HashMap<String, String>();
  		String userid = paramHash.get(SyncParameters.USER_ID);
  		String memoryName = paramHash.get(SyncParameters.DATASOURCENAME);
  		String user = paramHash.get(SyncParameters.USER_ID);
  		
  		result.put("method",  paramHash.get(SyncParameters.METHOD));
  		result.put(SyncParameters.DATASOURCENAME, memoryName);
  
  		try {
  			// no user accessed memory, returned directly
  			String memories = mDao.listMemories(user);
  			if(memories==null || memories.indexOf(memoryName)==-1 ) {
  				result.put(SyncParameters.RESPONSESTATUSMSG, "no such memory existed or user can't access to it");
  				mLogger.error(result);
  				return result;
  			}	
  						
  			String creatorName = mDao.getCreatorName(memoryName);
  			//mLogger.info(creatorName);
  			if(creatorName!=null && creatorName.equals(userid)) {
  				mDao.deleteMemory(memoryName);
  			}
  		} catch (SQLException e) {
  			e.printStackTrace();
  			result.put(SyncParameters.RESPONSESTATUSMSG,e.getMessage());
  			mLogger.error(result);
  			return result;
  		}
  		
  		result.put(SyncParameters.RESPONSESTATUSMSG, "success");
  		mLogger.info(result);
  		
  		return result;
  	}
  	
  	
  	/**
  	 * 
  	 * @param paramHash
  	 * @return
  	 */
  	public HashMap<String, String> listUser(HashMap<String, String> paramHash) {
  		HashMap<String, String> result = new HashMap<String, String>();
  		
  		String memoryName = paramHash.get(SyncParameters.DATASOURCENAME);
  		String user = paramHash.get(SyncParameters.USER_ID);
  		result.put("method", paramHash.get(SyncParameters.METHOD));
  		result.put(SyncParameters.DATASOURCENAME, memoryName);
  		
  		mLogger.debug(result);
  		
  		try {
  			// no user accessed memory, returned directly
  			String memories = mDao.listMemories(user);
  			if(memories==null || memories.indexOf(memoryName)==-1 ) {
  				result.put(SyncParameters.RESPONSESTATUSMSG, "no such memory existed or user can't access to it");
                  mLogger.error(result);
  				return result;
  			}	
  			
  			String users = mDao.getUserList(memoryName);
  			result.put(SyncParameters.USERIDLIST,users);
  			
  			// to compatible with old version, also passed this
              result.put("user-id-list",users);          
  
  		} catch (SQLException e) {
  		    result.put(SyncParameters.RESPONSESTATUSMSG, e.getMessage());
  			e.printStackTrace();
  			mLogger.error(result);
  			return result;
  		}
  		
  		result.put(SyncParameters.RESPONSESTATUSMSG, "success");
  		mLogger.info(result);
  		
  		return result;
  		
  	}
  
  	
  	/**
  	 * 
  	 * @param paramHash
  	 * @return
  	 */
  	public HashMap<String, String> addUser(HashMap<String, String> paramHash) {
  		HashMap<String, String> result = new HashMap<String, String>();
  		
  		String memoryName = paramHash.get(SyncParameters.DATASOURCENAME);
  		String userToAdd = paramHash.get(SyncParameters.USERTOADD);
  		String user = paramHash.get(SyncParameters.USER_ID);
  		result.put("method", paramHash.get(SyncParameters.METHOD));
  		result.put(SyncParameters.DATASOURCENAME, memoryName);
  
  		try {
  			
  			// no user accessed memory, returned directly
  			String memories = mDao.listMemories(user);
  			if(memories==null || memories.indexOf(memoryName)==-1 ) {
  				result.put(SyncParameters.RESPONSESTATUSMSG, "no such memory existed or user can't access to it");
                  mLogger.error(result);
  				return result;
  			}	
  			
  			String res = mDao.addUser(memoryName, userToAdd);
  			if(res != null) {
  				result.put(SyncParameters.RESPONSESTATUSMSG, res);
  				mLogger.error(result);
  				return result;
  			}
  		} catch (SQLException e) {
  		    result.put(SyncParameters.RESPONSESTATUSMSG, e.getMessage());
  		    mLogger.error(result);
  			e.printStackTrace();
  			return result;
  		}
  		
  		result.put(SyncParameters.RESPONSESTATUSMSG, "success");
  		mLogger.info(result);
  		return result;
  		
  	}
  	
  	
  	/**
  	 * 
  	 * @param paramHash
  	 * @return
  	 */
  	public HashMap<String, String> removeUser(HashMap<String, String> paramHash) {
  		HashMap<String, String> result = new HashMap<String, String>();
  		
  		String memoryName = paramHash.get(SyncParameters.DATASOURCENAME);
  		String userToRemove = paramHash.get(SyncParameters.USERTOREMOVE);
  		String user = paramHash.get(SyncParameters.USER_ID);
  		result.put("method", paramHash.get(SyncParameters.METHOD));
  		result.put(SyncParameters.DATASOURCENAME, memoryName);
  		
  		try {
  			// no user accessed memory, returned directly
  			String memories = mDao.listMemories(user);
  			if(memories==null || memories.indexOf(memoryName)==-1 ) {
  				result.put(SyncParameters.RESPONSESTATUSMSG, "no such memory existed or user can't access to it");
  				mLogger.error(result);
  				return result;
  			}	
  						
  