PageRenderTime 60ms CodeModel.GetById 3ms app.highlight 48ms RepoModel.GetById 1ms app.codeStats 1ms

/src/com/sogou/qadev/service/cynthia/service/impl/DataAccessSessionMemory.java

https://github.com/zphj1987/Cynthia
Java | 1586 lines | 569 code | 129 blank | 888 comment | 17 complexity | dc15f24966e8289355db2f3a134319f7 MD5 | raw file
   1package com.sogou.qadev.service.cynthia.service.impl;
   2
   3import java.sql.Timestamp;
   4import java.util.List;
   5import java.util.Map;
   6
   7import org.w3c.dom.Document;
   8import org.w3c.dom.Node;
   9
  10import com.sogou.qadev.service.cynthia.bean.Attachment;
  11import com.sogou.qadev.service.cynthia.bean.ChangeLog;
  12import com.sogou.qadev.service.cynthia.bean.Data;
  13import com.sogou.qadev.service.cynthia.bean.DataAccessAction;
  14import com.sogou.qadev.service.cynthia.bean.Filter;
  15import com.sogou.qadev.service.cynthia.bean.GuideBean;
  16import com.sogou.qadev.service.cynthia.bean.JSTree;
  17import com.sogou.qadev.service.cynthia.bean.Script;
  18import com.sogou.qadev.service.cynthia.bean.TagBean;
  19import com.sogou.qadev.service.cynthia.bean.Timer;
  20import com.sogou.qadev.service.cynthia.bean.TimerAction;
  21import com.sogou.qadev.service.cynthia.bean.UUID;
  22import com.sogou.qadev.service.cynthia.bean.UserInfo;
  23import com.sogou.qadev.service.cynthia.dao.AttachmentAccessSessionMySQL;
  24import com.sogou.qadev.service.cynthia.dao.BackRightAccessSessionMySQL;
  25import com.sogou.qadev.service.cynthia.dao.DataAccessSessionMySQL;
  26import com.sogou.qadev.service.cynthia.dao.DefaultValueAccessSessionMySQL;
  27import com.sogou.qadev.service.cynthia.dao.EventUserAccessSessionMySQL;
  28import com.sogou.qadev.service.cynthia.dao.FieldNameAccessSessionMySQL;
  29import com.sogou.qadev.service.cynthia.dao.FilterAccessSessionMySQL;
  30import com.sogou.qadev.service.cynthia.dao.FlowAccessSessionMySQL;
  31import com.sogou.qadev.service.cynthia.dao.GuideAccessSessionMySQL;
  32import com.sogou.qadev.service.cynthia.dao.HomeFilterAccessSessionMySQL;
  33import com.sogou.qadev.service.cynthia.dao.JSTreeAccessSessionMySQL;
  34import com.sogou.qadev.service.cynthia.dao.LogAccessSessionMySQL;
  35import com.sogou.qadev.service.cynthia.dao.NewDataNotifyAccessSessionMySQL;
  36import com.sogou.qadev.service.cynthia.dao.ScriptAccessSessionMySQL;
  37import com.sogou.qadev.service.cynthia.dao.TagAccessSessionMySQL;
  38import com.sogou.qadev.service.cynthia.dao.TimerAccessSessionMySQL;
  39import com.sogou.qadev.service.cynthia.dao.TimerActionAccessSessionMySQL;
  40import com.sogou.qadev.service.cynthia.dao.UserDefaultTemplateMySQL;
  41import com.sogou.qadev.service.cynthia.dao.UserInfoAccessSessionMySQL;
  42import com.sogou.qadev.service.cynthia.factory.DataAccessFactory;
  43import com.sogou.qadev.service.cynthia.factory.ScriptAccessFactory;
  44import com.sogou.qadev.service.cynthia.service.DataFilter;
  45import com.sogou.qadev.service.cynthia.service.ScriptAccessSession;
  46import com.sogou.qadev.service.cynthia.util.ConfigUtil;
  47import com.sohu.rd.td.util.xml.XMLUtil;
  48
  49public class DataAccessSessionMemory extends AbstractDataAccessSession
  50{
  51	/**
  52	 * <h1> Title:</h1>
  53	 * <p> Description:</p>
  54	 * @date:2014-5-6 
  55	 * @param username
  56	 * @param agent
  57	 * @param keyId
  58	 */
  59	public DataAccessSessionMemory(String username, String agent, long keyId)
  60	{
  61		super(username, agent, keyId);
  62	}
  63
  64	/**
  65	 * (non-Javadoc)
  66	 * <p> Title:getDataFilter</p>
  67	 * @return
  68	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getDataFilter()
  69	 */
  70	public DataFilter getDataFilter()
  71	{
  72		if (dataFilter == null)
  73			dataFilter = new DataFilterMemory(this);
  74
  75		return dataFilter;
  76	}
  77
  78	/**
  79	 * (non-Javadoc)
  80	 * <p> Title:createScriptAccessSession</p>
  81	 * @return
  82	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#createScriptAccessSession()
  83	 */
  84	public ScriptAccessSession createScriptAccessSession()
  85	{
  86		return ScriptAccessFactory.getInstance().createScriptAccessSession(username, keyId);
  87	}
  88
  89	/**
  90	 * (non-Javadoc)
  91	 * <p> Title:createAttachment</p>
  92	 * @param name
  93	 * @param data
  94	 * @return
  95	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#createAttachment(java.lang.String, byte[])
  96	 */
  97	public Attachment createAttachment(String name, byte[] data)
  98	{
  99		return new AttachmentAccessSessionMySQL().createAttachment(name, username, data);
 100	}
 101	
 102	/**
 103	 * (non-Javadoc)
 104	 * <p> Title:queryAttachment</p>
 105	 * @param id
 106	 * @param needData
 107	 * @return
 108	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryAttachment(com.sogou.qadev.service.cynthia.bean.UUID, boolean)
 109	 */
 110	public Attachment queryAttachment(UUID id, boolean needData)
 111	{
 112		Attachment[] attachmentArray = this.queryAttachments(new UUID[]{id}, needData);
 113		if(attachmentArray.length > 0){
 114			return attachmentArray[0];
 115		}
 116		
 117		return null;
 118	}
 119
 120	/**
 121	 * (non-Javadoc)
 122	 * <p> Title:queryAttachments</p>
 123	 * @param ids
 124	 * @param needData
 125	 * @return
 126	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryAttachments(com.sogou.qadev.service.cynthia.bean.UUID[], boolean)
 127	 */
 128	public Attachment[] queryAttachments(UUID[] ids, boolean needData)
 129	{
 130		return new AttachmentAccessSessionMySQL().queryAttachments(ids, needData);
 131	}
 132
 133	/**
 134	 * (non-Javadoc)
 135	 * <p> Title:addFilter</p>
 136	 * @param filter
 137	 * @return
 138	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addFilter(com.sogou.qadev.service.cynthia.bean.Filter)
 139	 */
 140	public Filter addFilter(Filter filter)
 141	{
 142		return new FilterAccessSessionMySQL().addFilter(filter);
 143	}
 144
 145	/**
 146	 * (non-Javadoc)
 147	 * <p> Title:queryFilters</p>
 148	 * @param username
 149	 * @return
 150	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryFilters(java.lang.String)
 151	 */
 152	public Filter[] queryFilters(String username)
 153	{
 154		return new FilterAccessSessionMySQL().queryFilters(username);
 155	}
 156	
 157	/**
 158	 * (non-Javadoc)
 159	 * <p> Title:queryFilterIdNameMap</p>
 160	 * @param userName
 161	 * @return
 162	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryFilterIdNameMap(java.lang.String)
 163	 */
 164	public Map<String,String> queryFilterIdNameMap(String userName)
 165	{
 166		return new FilterAccessSessionMySQL().queryFilterIdAndName(userName);
 167	}
 168	
 169	/**
 170	 * (non-Javadoc)
 171	 * <p> Title:querySysFilters</p>
 172	 * @param username
 173	 * @return
 174	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#querySysFilters(java.lang.String)
 175	 */
 176	public Filter[] querySysFilters(String username)
 177	{
 178		return new FilterAccessSessionMySQL().querySysFilters(username, this);
 179	}
 180	
 181	/**
 182	 * (non-Javadoc)
 183	 * <p> Title:queryFocusFilters</p>
 184	 * @param username
 185	 * @return
 186	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryFocusFilters(java.lang.String)
 187	 */
 188	public Filter[] queryFocusFilters(String username)
 189	{
 190		return new FilterAccessSessionMySQL().queryFocusFilters(username, this);
 191	}
 192
 193	/**
 194	 * (non-Javadoc)
 195	 * <p> Title:queryFilter</p>
 196	 * @param filterId
 197	 * @return
 198	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryFilter(com.sogou.qadev.service.cynthia.bean.UUID)
 199	 */
 200	public Filter queryFilter(UUID filterId)
 201	{
 202		return new FilterAccessSessionMySQL().queryFilter(filterId);
 203	}
 204
 205	/**
 206	 * (non-Javadoc)
 207	 * <p> Title:queryAllFilters</p>
 208	 * @return
 209	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryAllFilters()
 210	 */
 211	@Override
 212	public List<Filter> queryAllFilters()
 213	{
 214		return new FilterAccessSessionMySQL().queryAllFilters();
 215	}
 216	
 217	/**
 218	 * (non-Javadoc)
 219	 * <p> Title:removeFilter</p>
 220	 * @param filterId
 221	 * @return
 222	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeFilter(com.sogou.qadev.service.cynthia.bean.UUID)
 223	 */
 224	public ErrorCode removeFilter(UUID filterId)
 225	{
 226		Filter filter = this.queryFilter(filterId);
 227		if(filter == null){
 228			return ErrorCode.success;
 229		}
 230		
 231		return new FilterAccessSessionMySQL().removeFilter(filterId);
 232	}
 233
 234	/**
 235	 * (non-Javadoc)
 236	 * <p> Title:updateFilter</p>
 237	 * @param filter
 238	 * @return
 239	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateFilter(com.sogou.qadev.service.cynthia.bean.Filter)
 240	 */
 241	public ErrorCode updateFilter(Filter filter)
 242	{
 243		Document doc = null;
 244		try {
 245			doc = XMLUtil.string2Document(filter.getXml(), "UTF-8");
 246			if (doc != null) {
 247				String fieldSql = DataFilterMemory.getFilterSql(filter);
 248				
 249				if (fieldSql != null && fieldSql != "") {
 250					try {
 251						doc = XMLUtil.string2Document(filter.getXml(), "UTF-8");
 252						if (doc != null) {
 253							Node queryNode = XMLUtil.getSingleNode(doc, "query");
 254							Node sqlNode = XMLUtil.getSingleNode(queryNode, "sql");
 255							Node envNode = XMLUtil.getSingleNode(queryNode, "env");
 256							
 257							if (sqlNode != null ) {
 258								sqlNode.setTextContent(fieldSql);
 259							}else {
 260								Node sqlElement = doc.createElement("sql");  //将查询语句作为节点放到filter中
 261								sqlElement.setTextContent(fieldSql);
 262								queryNode.insertBefore(sqlElement, envNode);
 263							}
 264							
 265							filter.setXml(XMLUtil.document2String(doc, "UTF-8"));
 266						}
 267					} catch (Exception e) {
 268						e.printStackTrace();
 269					}
 270				}
 271			}
 272		}  catch (Exception e) {
 273			e.printStackTrace();
 274		}
 275		return new FilterAccessSessionMySQL().updateFilter(filter);
 276	}
 277
 278	/**
 279	 * (non-Javadoc)
 280	 * <p> Title:createFilter</p>
 281	 * @param createUser
 282	 * @param createTime
 283	 * @param fatherId
 284	 * @return
 285	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#createFilter(java.lang.String, java.sql.Timestamp, com.sogou.qadev.service.cynthia.bean.UUID)
 286	 */
 287	public Filter createFilter(String createUser, Timestamp createTime, UUID fatherId)
 288	{
 289		return new FilterAccessSessionMySQL().createFilter(createUser, createTime, fatherId);
 290	}
 291	
 292	/**
 293	 * (non-Javadoc)
 294	 * <p> Title:queryFlowSvg</p>
 295	 * @param flowId
 296	 * @return
 297	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryFlowSvg(com.sogou.qadev.service.cynthia.bean.UUID)
 298	 */
 299	public String queryFlowSvg(UUID flowId)
 300	{
 301		return new FlowAccessSessionMySQL().querySvg(flowId);
 302	}
 303	
 304	/**
 305	 * (non-Javadoc)
 306	 * <p> Title:createTempFilter</p>
 307	 * @param createUser
 308	 * @param createTime
 309	 * @param fatherId
 310	 * @return
 311	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#createTempFilter(java.lang.String, java.sql.Timestamp, com.sogou.qadev.service.cynthia.bean.UUID)
 312	 */
 313	public Filter createTempFilter(String createUser, Timestamp createTime, UUID fatherId)
 314	{
 315		return new FilterAccessSessionMySQL().creatTempFilter(createUser, createTime, fatherId);
 316	}
 317	
 318	/**
 319	 * (non-Javadoc)
 320	 * <p> Title:queryUserFocusFilters</p>
 321	 * @param username
 322	 * @return
 323	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryUserFocusFilters(java.lang.String)
 324	 */
 325	public UUID[] queryUserFocusFilters(String username)
 326	{
 327		return new FilterAccessSessionMySQL().queryUserFocusFilters(username);
 328	}
 329
 330	/**
 331	 * (non-Javadoc)
 332	 * <p> Title:removeUserFocusFilter</p>
 333	 * @param username
 334	 * @param filterId
 335	 * @return
 336	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeUserFocusFilter(java.lang.String, com.sogou.qadev.service.cynthia.bean.UUID)
 337	 */
 338	public ErrorCode removeUserFocusFilter(String username, UUID filterId)
 339	{
 340		return new FilterAccessSessionMySQL().removeUserFocusFilter(username, filterId);
 341	}
 342	
 343	/**
 344	 * (non-Javadoc)
 345	 * <p> Title:addUserFocusFilter</p>
 346	 * @param username
 347	 * @param filterId
 348	 * @return
 349	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addUserFocusFilter(java.lang.String, com.sogou.qadev.service.cynthia.bean.UUID)
 350	 */
 351	public ErrorCode addUserFocusFilter(String username, UUID filterId)
 352	{
 353		return new FilterAccessSessionMySQL().addUserFocusFilter(username, filterId);
 354	}
 355	
 356	/**
 357	 * (non-Javadoc)
 358	 * <p> Title:removeRelatedUser</p>
 359	 * @param username
 360	 * @return
 361	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeRelatedUser(java.lang.String)
 362	 */
 363	public ErrorCode removeRelatedUser(String username)
 364	{
 365		return new UserInfoAccessSessionMySQL().removeRelatedUser(username);
 366	}
 367	
 368	/**
 369	 * (non-Javadoc)
 370	 * <p> Title:getNewTaskIdsByFilterAndUser</p>
 371	 * @param filterIdArray
 372	 * @param username
 373	 * @return
 374	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getNewTaskIdsByFilterAndUser(com.sogou.qadev.service.cynthia.bean.UUID[], java.lang.String)
 375	 */
 376	public String getNewTaskIdsByFilterAndUser(UUID[] filterIdArray, String username)
 377	{
 378		return new NewDataNotifyAccessSessionMySQL(this).getNewTaskIdsByFilterAndUser(filterIdArray, username);
 379	}
 380	
 381	/**
 382	 * (non-Javadoc)
 383	 * <p> Title:deleteFilterUserTasks</p>
 384	 * @param dataId
 385	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#deleteFilterUserTasks(com.sogou.qadev.service.cynthia.bean.UUID)
 386	 */
 387	public void deleteFilterUserTasks(UUID dataId)
 388	{
 389		new NewDataNotifyAccessSessionMySQL(this).deleteFilterUserTasks(dataId);
 390	}
 391	
 392	/**
 393	 * (non-Javadoc)
 394	 * <p> Title:cleanNewTagByTaskIds</p>
 395	 * @param filterId
 396	 * @param taskIdArray
 397	 * @param username
 398	 * @return
 399	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#cleanNewTagByTaskIds(com.sogou.qadev.service.cynthia.bean.UUID, com.sogou.qadev.service.cynthia.bean.UUID[], java.lang.String)
 400	 */
 401	public String cleanNewTagByTaskIds(UUID filterId, UUID[] taskIdArray, String username)
 402	{
 403		return new NewDataNotifyAccessSessionMySQL(this).cleanNewTagByTaskIds(filterId, taskIdArray, username);
 404	}
 405	
 406	/**
 407	 * (non-Javadoc)
 408	 * <p> Title:createTimer</p>
 409	 * @param createUser
 410	 * @return
 411	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#createTimer(java.lang.String)
 412	 */
 413	public Timer createTimer(String createUser)
 414	{
 415		return new TimerAccessSessionMySQL().createTimer(createUser);
 416	}
 417	
 418	/**
 419	 * (non-Javadoc)
 420	 * <p> Title:addTimer</p>
 421	 * @param timer
 422	 * @return
 423	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addTimer(com.sogou.qadev.service.cynthia.bean.Timer)
 424	 */
 425	public ErrorCode addTimer(Timer timer)
 426	{
 427		return new TimerAccessSessionMySQL().addTimer(timer);
 428	}
 429	
 430	/**
 431	 * (non-Javadoc)
 432	 * <p> Title:removeTimer</p>
 433	 * @param timerId
 434	 * @return
 435	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeTimer(com.sogou.qadev.service.cynthia.bean.UUID)
 436	 */
 437	public ErrorCode removeTimer(UUID timerId)
 438	{
 439		return new TimerAccessSessionMySQL().removeTimer(timerId);
 440	}
 441	
 442	/**
 443	 * (non-Javadoc)
 444	 * <p> Title:modifyTimer</p>
 445	 * @param timer
 446	 * @return
 447	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#modifyTimer(com.sogou.qadev.service.cynthia.bean.Timer)
 448	 */
 449	public ErrorCode modifyTimer(Timer timer)
 450	{
 451		return new TimerAccessSessionMySQL().modifyTimer(timer);
 452	}
 453	
 454	/**
 455	 * (non-Javadoc)
 456	 * <p> Title:queryTimer</p>
 457	 * @param timerId
 458	 * @return
 459	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryTimer(com.sogou.qadev.service.cynthia.bean.UUID)
 460	 */
 461	public Timer queryTimer(UUID timerId)
 462	{
 463		return new TimerAccessSessionMySQL().queryTimer(timerId);
 464	}
 465	
 466	/**
 467	 * (non-Javadoc)
 468	 * <p> Title:queryTimers</p>
 469	 * @param createUser
 470	 * @return
 471	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryTimers(java.lang.String)
 472	 */
 473	public Timer[] queryTimers(String createUser)
 474	{
 475		return new TimerAccessSessionMySQL().queryTimers(createUser);
 476	}
 477	
 478	/**
 479	 * (non-Javadoc)
 480	 * <p> Title:queryTimers</p>
 481	 * @return
 482	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryTimers()
 483	 */
 484	public Timer[] queryTimers()
 485	{
 486		return new TimerAccessSessionMySQL().queryTimers();
 487	}
 488	
 489	/**
 490	 * (non-Javadoc)
 491	 * <p> Title:queryTimersByActionId</p>
 492	 * @param timerActionId
 493	 * @return
 494	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryTimersByActionId(com.sogou.qadev.service.cynthia.bean.UUID)
 495	 */
 496	public Timer[] queryTimersByActionId(UUID timerActionId)
 497	{
 498		return new TimerAccessSessionMySQL().queryTimersByActionId(timerActionId);
 499	}
 500	
 501	/**
 502	 * (non-Javadoc)
 503	 * <p> Title:createTimerAction</p>
 504	 * @return
 505	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#createTimerAction()
 506	 */
 507	public TimerAction createTimerAction()
 508	{
 509		return new TimerActionAccessSessionMySQL().createTimerAction();
 510	}
 511	
 512	/**
 513	 * (non-Javadoc)
 514	 * <p> Title:addTimerAction</p>
 515	 * @param timerAction
 516	 * @return
 517	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addTimerAction(com.sogou.qadev.service.cynthia.bean.TimerAction)
 518	 */
 519	public ErrorCode addTimerAction(TimerAction timerAction)
 520	{
 521		return new TimerActionAccessSessionMySQL().addTimerAction(timerAction);
 522	}
 523	
 524	/**
 525	 * (non-Javadoc)
 526	 * <p> Title:removeTimerAction</p>
 527	 * @param timerActionId
 528	 * @return
 529	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeTimerAction(com.sogou.qadev.service.cynthia.bean.UUID)
 530	 */
 531	public ErrorCode removeTimerAction(UUID timerActionId)
 532	{
 533		return new TimerActionAccessSessionMySQL().removeTimerAction(timerActionId);
 534	}
 535	
 536	/**
 537	 * (non-Javadoc)
 538	 * <p> Title:modifyTimerAction</p>
 539	 * @param timerAction
 540	 * @return
 541	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#modifyTimerAction(com.sogou.qadev.service.cynthia.bean.TimerAction)
 542	 */
 543	public ErrorCode modifyTimerAction(TimerAction timerAction)
 544	{
 545		return new TimerActionAccessSessionMySQL().modifyTimerAction(timerAction);
 546	}
 547	
 548	/**
 549	 * (non-Javadoc)
 550	 * <p> Title:queryTimerAction</p>
 551	 * @param timerActionId
 552	 * @return
 553	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryTimerAction(com.sogou.qadev.service.cynthia.bean.UUID)
 554	 */
 555	public TimerAction queryTimerAction(UUID timerActionId)
 556	{
 557		return new TimerActionAccessSessionMySQL().queryTimerAction(timerActionId);
 558	}
 559	
 560	/**
 561	 * (non-Javadoc)
 562	 * <p> Title:queryTimerActions</p>
 563	 * @return
 564	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryTimerActions()
 565	 */
 566	public TimerAction[] queryTimerActions()
 567	{
 568		return new TimerActionAccessSessionMySQL().queryTimerActions();
 569	}
 570	
 571	/**
 572	 * (non-Javadoc)
 573	 * <p> Title:isDataExist</p>
 574	 * @param dataId
 575	 * @return
 576	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#isDataExist(com.sogou.qadev.service.cynthia.bean.UUID)
 577	 */
 578	@Override
 579	public boolean isDataExist(UUID dataId) {
 580		return new DataAccessSessionMySQL().isExist(dataId);
 581	}
 582
 583	/**
 584	 * (non-Javadoc)
 585	 * <p> Title:queryFocusUsersByFilter</p>
 586	 * @param filterId
 587	 * @return
 588	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryFocusUsersByFilter(com.sogou.qadev.service.cynthia.bean.UUID)
 589	 */
 590	@Override
 591	public List<String> queryFocusUsersByFilter(UUID filterId) {
 592		return new FilterAccessSessionMySQL().queryFocusUsersByFilter(filterId);
 593	}
 594	
 595	/**
 596	 * (non-Javadoc)
 597	 * <p> Title:queryChilderNodes</p>
 598	 * @param id
 599	 * @param userName
 600	 * @return
 601	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryChilderNodes(int, java.lang.String)
 602	 */
 603	@Override
 604	public List<JSTree> queryChilderNodes(int id,String userName) {
 605		return new JSTreeAccessSessionMySQL().getNodeChilden(id, userName);
 606	}
 607	
 608	/**
 609	 * (non-Javadoc)
 610	 * <p> Title:queryJSTreeNodeById</p>
 611	 * @param id
 612	 * @return
 613	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryJSTreeNodeById(int)
 614	 */
 615	@Override
 616	public JSTree queryJSTreeNodeById(int id) {
 617		return new JSTreeAccessSessionMySQL().getNodeById(id);
 618	}
 619	
 620	/**
 621	 * (non-Javadoc)
 622	 * <p> Title:addJSTreeNode</p>
 623	 * @param parentId
 624	 * @param position
 625	 * @param title
 626	 * @param userName
 627	 * @return
 628	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addJSTreeNode(int, int, java.lang.String, java.lang.String)
 629	 */
 630	@Override
 631	public int addJSTreeNode(int parentId, int position, String title,String userName) {
 632		return new JSTreeAccessSessionMySQL().addNode(parentId, position, title,userName);
 633	}
 634	
 635	/**
 636	 * (non-Javadoc)
 637	 * <p> Title:removJSTreeNode</p>
 638	 * @param id
 639	 * @param userName
 640	 * @return
 641	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removJSTreeNode(int, java.lang.String)
 642	 */
 643	@Override
 644	public boolean removJSTreeNode(int id,String userName) {
 645		return new JSTreeAccessSessionMySQL().removeNode(id,userName);
 646	}
 647	
 648	/**
 649	 * (non-Javadoc)
 650	 * <p> Title:moveJSTreeNode</p>
 651	 * @param id
 652	 * @param refId
 653	 * @param position
 654	 * @param title
 655	 * @param copy
 656	 * @param userName
 657	 * @return
 658	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#moveJSTreeNode(int, int, int, java.lang.String, boolean, java.lang.String)
 659	 */
 660	@Override
 661	public boolean moveJSTreeNode(int id, int refId, int position,
 662			String title, boolean copy, String userName) {
 663		return new JSTreeAccessSessionMySQL().moveNode(id, refId, position, title, copy,userName);
 664	}
 665	
 666	/**
 667	 * (non-Javadoc)
 668	 * <p> Title:updateJSTreeNode</p>
 669	 * @param id
 670	 * @param title
 671	 * @return
 672	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateJSTreeNode(int, java.lang.String)
 673	 */
 674	@Override
 675	public boolean updateJSTreeNode(int id, String title) {
 676		return new JSTreeAccessSessionMySQL().updateNodeName(id, title);
 677	}
 678	
 679	/**
 680	 * (non-Javadoc)
 681	 * <p> Title:queryTimerByFilterId</p>
 682	 * @param filterId
 683	 * @return
 684	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryTimerByFilterId(com.sogou.qadev.service.cynthia.bean.UUID)
 685	 */
 686	@Override
 687	public Timer[] queryTimerByFilterId(UUID filterId) {
 688		return new TimerAccessSessionMySQL().queryTimersByFilterId(filterId);
 689	}
 690	
 691	/**
 692	 * (non-Javadoc)
 693	 * <p> Title:queryAllFolderFilters</p>
 694	 * @param userName
 695	 * @return
 696	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryAllFolderFilters(java.lang.String)
 697	 */
 698	@Override
 699	public List<String> queryAllFolderFilters(String userName) {
 700		return new JSTreeAccessSessionMySQL().getAllFolderFilters(userName);
 701	}
 702	
 703	/**
 704	 * (non-Javadoc)
 705	 * <p> Title:queryFolderFilters</p>
 706	 * @param nodeId
 707	 * @return
 708	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryFolderFilters(int)
 709	 */
 710	@Override
 711	public List<String> queryFolderFilters(int nodeId) {
 712		return new JSTreeAccessSessionMySQL().getFolderFilters(nodeId);
 713	}
 714	
 715	/**
 716	 * (non-Javadoc)
 717	 * <p> Title:moveFilterNode</p>
 718	 * @param filterId
 719	 * @param refId
 720	 * @param parentId
 721	 * @return
 722	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#moveFilterNode(int, int, int)
 723	 */
 724	@Override
 725	public boolean moveFilterNode(int filterId, int refId, int parentId) {
 726		return new JSTreeAccessSessionMySQL().moveFilter(filterId, refId, parentId);
 727	}
 728	
 729	/**
 730	 * (non-Javadoc)
 731	 * <p> Title:queryRootNode</p>
 732	 * @param id
 733	 * @return
 734	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryRootNode(int)
 735	 */
 736	@Override
 737	public List<JSTree> queryRootNode(int id) {
 738		return new JSTreeAccessSessionMySQL().getRootNode(id);
 739	}
 740	
 741	/**
 742	 * (non-Javadoc)
 743	 * <p> Title:removeFilterId</p>
 744	 * @param filterId
 745	 * @param parentId
 746	 * @return
 747	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeFilterId(int, int)
 748	 */
 749	@Override
 750	public boolean removeFilterId(int filterId, int parentId) {
 751		return new JSTreeAccessSessionMySQL().removeFilterId(filterId, parentId);
 752	}
 753	
 754	/**
 755	 * (non-Javadoc)
 756	 * <p> Title:queryFavoriteFilters</p>
 757	 * @param userName
 758	 * @return
 759	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryFavoriteFilters(java.lang.String)
 760	 */
 761	@Override
 762	public String[] queryFavoriteFilters(String userName) {
 763		return new JSTreeAccessSessionMySQL().getFavorateFilters(userName);
 764	}
 765	
 766	/**
 767	 * (non-Javadoc)
 768	 * <p> Title:addFavoriteFilter</p>
 769	 * @param userName
 770	 * @param filterId
 771	 * @return
 772	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addFavoriteFilter(java.lang.String, java.lang.String)
 773	 */
 774	@Override
 775	public boolean addFavoriteFilter(String userName, String filterId) {
 776		return new JSTreeAccessSessionMySQL().addFavoriteFilters(userName, filterId);
 777	}
 778	
 779	/**
 780	 * (non-Javadoc)
 781	 * <p> Title:removeFavoriteFilter</p>
 782	 * @param userName
 783	 * @param filterId
 784	 * @return
 785	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeFavoriteFilter(java.lang.String, java.lang.String)
 786	 */
 787	@Override
 788	public boolean removeFavoriteFilter(String userName, String filterId) {
 789		return new JSTreeAccessSessionMySQL().removeFavoriteFilters(userName, filterId);
 790	}
 791	
 792	/**
 793	 * (non-Javadoc)
 794	 * <p> Title:updataFavoriteFilters</p>
 795	 * @param filterarrays
 796	 * @param userName
 797	 * @return
 798	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updataFavoriteFilters(java.lang.String, java.lang.String)
 799	 */
 800	public boolean updataFavoriteFilters(String filterarrays,String userName){
 801		return new JSTreeAccessSessionMySQL().updateFavoriteFilters(filterarrays,userName);
 802	}
 803	
 804	/**
 805	 * (non-Javadoc)
 806	 * <p> Title:addHomeFilter</p>
 807	 * @param userName
 808	 * @param filterId
 809	 * @return
 810	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addHomeFilter(java.lang.String, java.lang.String)
 811	 */
 812	@Override
 813	public boolean addHomeFilter(String userName, String filterId) {
 814		return new HomeFilterAccessSessionMySQL().addHomeFilter(userName, filterId);
 815	}
 816	
 817	/**
 818	 * (non-Javadoc)
 819	 * <p> Title:queryHomeFilter</p>
 820	 * @param userName
 821	 * @return
 822	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryHomeFilter(java.lang.String)
 823	 */
 824	@Override
 825	public String queryHomeFilter(String userName) {
 826		return new HomeFilterAccessSessionMySQL().getHomeFilter(userName);
 827	}
 828	
 829	/**
 830	 * (non-Javadoc)
 831	 * <p> Title:updateHomeFilter</p>
 832	 * @param userName
 833	 * @param filterId
 834	 * @return
 835	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateHomeFilter(java.lang.String, java.lang.String)
 836	 */
 837	@Override
 838	public boolean updateHomeFilter(String userName, String filterId) {
 839		return new HomeFilterAccessSessionMySQL().updateHomeFilter(userName, filterId);
 840	}
 841	
 842	/**
 843	 * (non-Javadoc)
 844	 * <p> Title:updateFavoritesFilters</p>
 845	 * @param filterId
 846	 * @param position
 847	 * @param userName
 848	 * @return
 849	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateFavoritesFilters(java.lang.String, int, java.lang.String)
 850	 */
 851	@Override
 852	public boolean updateFavoritesFilters(String filterId, int position,
 853			String userName) {
 854		return new JSTreeAccessSessionMySQL().updateFavorites(filterId, position, userName);
 855	}
 856	
 857	/**
 858	 * (non-Javadoc)
 859	 * <p> Title:addFilterToFolder</p>
 860	 * @param fitlerId
 861	 * @param nodeId
 862	 * @return
 863	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addFilterToFolder(java.lang.String, int)
 864	 */
 865	@Override
 866	public boolean addFilterToFolder(String fitlerId, int nodeId) {
 867		return new JSTreeAccessSessionMySQL().addFilterToFolder(fitlerId, nodeId);
 868	}
 869	
 870	/**
 871	 * (non-Javadoc)
 872	 * <p> Title:queryAllScripts</p>
 873	 * @param userName
 874	 * @param keyId
 875	 * @return
 876	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryAllScripts(java.lang.String, long)
 877	 */
 878	@Override
 879	public List<Script> queryAllScripts(String userName,long keyId) {
 880		return new ScriptAccessSessionMySQL(userName,keyId).queryAllScripts();
 881	}
 882	
 883	/**
 884	 * (non-Javadoc)
 885	 * <p> Title:updateFilterOrders</p>
 886	 * @param folderId
 887	 * @param userName
 888	 * @param newOrders
 889	 * @return
 890	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateFilterOrders(int, java.lang.String, java.lang.String)
 891	 */
 892	@Override
 893	public boolean updateFilterOrders(int folderId, String userName,
 894			String newOrders) {
 895		return new JSTreeAccessSessionMySQL().updateFiltersOrder(folderId, userName, newOrders);
 896	}
 897	
 898	/**
 899	 * (non-Javadoc)
 900	 * <p> Title:queryDefaultFilters</p>
 901	 * @param userName
 902	 * @return
 903	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryDefaultFilters(java.lang.String)
 904	 */
 905	@Override
 906	public List<String> queryDefaultFilters(String userName) {
 907		return  new JSTreeAccessSessionMySQL().getDefaultFilters(userName);
 908	}
 909	
 910	/**
 911	 * (non-Javadoc)
 912	 * <p> Title:updateDefaultFilters</p>
 913	 * @param userName
 914	 * @param filters
 915	 * @return
 916	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateDefaultFilters(java.lang.String, java.lang.String)
 917	 */
 918	@Override
 919	public boolean updateDefaultFilters(String userName, String filters) {
 920		return  new JSTreeAccessSessionMySQL().updateDefaultFilters(userName, filters);
 921	}
 922	
 923	/**
 924	 * (non-Javadoc)
 925	 * <p> Title:addEvent</p>
 926	 * @param eventName
 927	 * @return
 928	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addEvent(java.lang.String)
 929	 */
 930	@Override
 931	public boolean addEvent(String eventName) {
 932		return new EventUserAccessSessionMySQL().addEvent(eventName);
 933	}
 934	
 935	/**
 936	 * (non-Javadoc)
 937	 * <p> Title:addEventUser</p>
 938	 * @param userName
 939	 * @param eventId
 940	 * @return
 941	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addEventUser(java.lang.String, int)
 942	 */
 943	@Override
 944	public boolean addEventUser(String userName, int eventId) {
 945		return new EventUserAccessSessionMySQL().addEventUser(userName, eventId);
 946	}
 947	
 948	/**
 949	 * (non-Javadoc)
 950	 * <p> Title:removeEventUser</p>
 951	 * @param userName
 952	 * @param eventId
 953	 * @return
 954	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeEventUser(java.lang.String, int)
 955	 */
 956	@Override
 957	public boolean removeEventUser(String userName, int eventId) {
 958		return new EventUserAccessSessionMySQL().deleteEventUser(userName, eventId);
 959	}
 960	
 961	/**
 962	 * (non-Javadoc)
 963	 * <p> Title:updateEvent</p>
 964	 * @param eventName
 965	 * @return
 966	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateEvent(java.lang.String)
 967	 */
 968	@Override
 969	public boolean updateEvent(String eventName) {
 970		return new EventUserAccessSessionMySQL().updateEvent(eventName);
 971	}
 972	
 973	/**
 974	 * (non-Javadoc)
 975	 * <p> Title:isValidUser</p>
 976	 * @param userName
 977	 * @param eventId
 978	 * @return
 979	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#isValidUser(java.lang.String, int)
 980	 */
 981	@Override
 982	public boolean isValidUser(String userName, int eventId) {
 983		return new EventUserAccessSessionMySQL().isValidUser(userName, eventId);
 984	}
 985	
 986	/**
 987	 * (non-Javadoc)
 988	 * <p> Title:addScript</p>
 989	 * @param script
 990	 * @return
 991	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addScript(com.sogou.qadev.service.cynthia.bean.Script)
 992	 */
 993	@Override
 994	public UUID addScript(Script script) {
 995		return new ScriptAccessSessionMySQL(ConfigUtil.sysEmail,DataAccessFactory.magic).addScript(script);
 996	}
 997	
 998	/**
 999	 * (non-Javadoc)
1000	 * <p> Title:queryAllScripts</p>
1001	 * @return
1002	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryAllScripts()
1003	 */
1004	@Override
1005	public List<Script> queryAllScripts() {
1006		return new ScriptAccessSessionMySQL(ConfigUtil.sysEmail,DataAccessFactory.magic).queryAllScripts();
1007	}
1008	
1009	/**
1010	 * (non-Javadoc)
1011	 * <p> Title:queryScript</p>
1012	 * @param scriptId
1013	 * @return
1014	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryScript(com.sogou.qadev.service.cynthia.bean.UUID)
1015	 */
1016	@Override
1017	public Script queryScript(UUID scriptId) {
1018		return new ScriptAccessSessionMySQL(ConfigUtil.sysEmail,DataAccessFactory.magic).queryScript(scriptId);
1019	}
1020	
1021	/**
1022	 * (non-Javadoc)
1023	 * <p> Title:queryScriptNoImport</p>
1024	 * @param scriptId
1025	 * @return
1026	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryScriptNoImport(com.sogou.qadev.service.cynthia.bean.UUID)
1027	 */
1028	public Script queryScriptNoImport(UUID scriptId){
1029		return new ScriptAccessSessionMySQL(ConfigUtil.sysEmail,DataAccessFactory.magic).queryScriptNoImport(scriptId);
1030	}
1031	
1032	/**
1033	 * (non-Javadoc)
1034	 * <p> Title:removeScript</p>
1035	 * @param scriptId
1036	 * @return
1037	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeScript(com.sogou.qadev.service.cynthia.bean.UUID)
1038	 */
1039	@Override
1040	public ErrorCode removeScript(UUID scriptId) {
1041		return new ScriptAccessSessionMySQL(ConfigUtil.sysEmail,DataAccessFactory.magic).removeScript(scriptId);
1042	}
1043	
1044	/**
1045	 * (non-Javadoc)
1046	 * <p> Title:updateScript</p>
1047	 * @param script
1048	 * @return
1049	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateScript(com.sogou.qadev.service.cynthia.bean.Script)
1050	 */
1051	@Override
1052	public ErrorCode updateScript(Script script) {
1053		return new ScriptAccessSessionMySQL(ConfigUtil.sysEmail,DataAccessFactory.magic).updateScript(script);
1054	}
1055	
1056	/**
1057	 * (non-Javadoc)
1058	 * <p> Title:createScript</p>
1059	 * @param createUser
1060	 * @return
1061	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#createScript(java.lang.String)
1062	 */
1063	@Override
1064	public Script createScript(String createUser) {
1065		return new ScriptAccessSessionMySQL(ConfigUtil.sysEmail,DataAccessFactory.magic).createScript(createUser);
1066	}
1067	
1068	/**
1069	 * (non-Javadoc)
1070	 * <p> Title:queryAllowedTemplateScripts</p>
1071	 * @param templateId
1072	 * @return
1073	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryAllowedTemplateScripts(com.sogou.qadev.service.cynthia.bean.UUID)
1074	 */
1075	@Override
1076	public Script[] queryAllowedTemplateScripts(UUID templateId) {
1077		return new ScriptAccessSessionMySQL(ConfigUtil.sysEmail,DataAccessFactory.magic).queryAllowedTemplateScripts(templateId);
1078	}
1079	
1080	/**
1081	 * (non-Javadoc)
1082	 * <p> Title:queryTemplateScripts</p>
1083	 * @param templateId
1084	 * @return
1085	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryTemplateScripts(com.sogou.qadev.service.cynthia.bean.UUID)
1086	 */
1087	@Override
1088	public Script[] queryTemplateScripts(UUID templateId) {
1089		return new ScriptAccessSessionMySQL(ConfigUtil.sysEmail,DataAccessFactory.magic).queryTemplateScripts(templateId);
1090	}
1091	
1092	/**
1093	 * (non-Javadoc)
1094	 * <p> Title:addOrUpdateUserDefaultTemplate</p>
1095	 * @param userName
1096	 * @param templateId
1097	 * @return
1098	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addOrUpdateUserDefaultTemplate(java.lang.String, java.lang.String)
1099	 */
1100	@Override
1101	public boolean addOrUpdateUserDefaultTemplate(String userName,
1102			String templateId) {
1103		return new UserDefaultTemplateMySQL().addOrUpdateUserDefaultTemplate(userName, templateId);
1104	}
1105	
1106	/**
1107	 * (non-Javadoc)
1108	 * <p> Title:getUserDefaultTemplate</p>
1109	 * @param userName
1110	 * @return
1111	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getUserDefaultTemplate(java.lang.String)
1112	 */
1113	@Override
1114	public String getUserDefaultTemplate(String userName) {
1115		return new UserDefaultTemplateMySQL().getDefaultTemplateId(userName);
1116	}
1117	
1118	/**
1119	 * (non-Javadoc)
1120	 * <p> Title:addUserInfo</p>
1121	 * @param userInfo
1122	 * @return
1123	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addUserInfo(com.sogou.qadev.service.cynthia.bean.UserInfo)
1124	 */
1125	@Override
1126	public boolean addUserInfo(UserInfo userInfo) {
1127		return new UserInfoAccessSessionMySQL().addUserInfo(userInfo);
1128	}
1129	
1130	/**
1131	 * (non-Javadoc)
1132	 * <p> Title:isUserExisted</p>
1133	 * @param userName
1134	 * @return
1135	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#isUserExisted(java.lang.String)
1136	 */
1137	@Override
1138	public boolean isUserExisted(String userName) {
1139		return new UserInfoAccessSessionMySQL().isUserExisted(userName);
1140	}
1141	
1142	/**
1143	 * (non-Javadoc)
1144	 * <p> Title:queryUserInfoById</p>
1145	 * @param id
1146	 * @return
1147	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryUserInfoById(int)
1148	 */
1149	@Override
1150	public UserInfo queryUserInfoById(int id) {
1151		return new UserInfoAccessSessionMySQL().queryUserInfoById(id);
1152	}
1153	
1154	/**
1155	 * (non-Javadoc)
1156	 * <p> Title:queryUserInfoByUserName</p>
1157	 * @param userName
1158	 * @return
1159	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryUserInfoByUserName(java.lang.String)
1160	 */
1161	public UserInfo queryUserInfoByUserName(String userName) {
1162		return new UserInfoAccessSessionMySQL().queryUserInfoByUserName(userName);
1163	};
1164	
1165	/**
1166	 * (non-Javadoc)
1167	 * <p> Title:removeUserInfo</p>
1168	 * @param userInfo
1169	 * @return
1170	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#removeUserInfo(com.sogou.qadev.service.cynthia.bean.UserInfo)
1171	 */
1172	@Override
1173	public boolean removeUserInfo(UserInfo userInfo) {
1174		return new UserInfoAccessSessionMySQL().removeUserInfo(userInfo);
1175	}
1176	
1177	/**
1178	 * (non-Javadoc)
1179	 * <p> Title:updateUserInfo</p>
1180	 * @param userInfo
1181	 * @return
1182	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateUserInfo(com.sogou.qadev.service.cynthia.bean.UserInfo)
1183	 */
1184	@Override
1185	public boolean updateUserInfo(UserInfo userInfo) {
1186		return new UserInfoAccessSessionMySQL().updateUserInfo(userInfo);
1187	}
1188	
1189	/**
1190	 * (non-Javadoc)
1191	 * <p> Title:getUserClassifyDataMap</p>
1192	 * @param userName
1193	 * @return
1194	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getUserClassifyDataMap(java.lang.String)
1195	 */
1196	@Override
1197	public Map<String, String> getUserClassifyDataMap(String userName) {
1198		return new TagAccessSessionMySQL().getUserTagDataMap(userName);
1199	}
1200	
1201	/**
1202	 * (non-Javadoc)
1203	 * <p> Title:updateSvg</p>
1204	 * @param flowId
1205	 * @param svgCode
1206	 * @return
1207	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateSvg(com.sogou.qadev.service.cynthia.bean.UUID, java.lang.String)
1208	 */
1209	@Override
1210	public boolean updateSvg(UUID flowId, String svgCode) {
1211		return new FlowAccessSessionMySQL().updateSvg(flowId, svgCode);
1212	}
1213	
1214	/**
1215	 * (non-Javadoc)
1216	 * <p> Title:addTag</p>
1217	 * @param userName
1218	 * @param tagName
1219	 * @param tagColor
1220	 * @return
1221	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addTag(java.lang.String, java.lang.String, java.lang.String)
1222	 */
1223	@Override
1224	public int addTag(String userName, String tagName, String tagColor){
1225		return new TagAccessSessionMySQL().addTag(userName, tagName,tagColor);
1226	}
1227	
1228	
1229	/**
1230	 * (non-Javadoc)
1231	 * <p> Title:updateTag</p>
1232	 * @param tagId
1233	 * @param tagName
1234	 * @param tagColor
1235	 * @return
1236	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateTag(java.lang.String, java.lang.String, java.lang.String)
1237	 */
1238	@Override
1239	public boolean updateTag(String tagId, String tagName, String tagColor){
1240		return new TagAccessSessionMySQL().updateTag(tagId, tagName,tagColor);
1241	}
1242	
1243	/**
1244	 * (non-Javadoc)
1245	 * <p> Title:deleteTag</p>
1246	 * @param tagId
1247	 * @return
1248	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#deleteTag(java.lang.String)
1249	 */
1250	@Override
1251	public boolean deleteTag(String tagId){
1252		return new TagAccessSessionMySQL().deleteTag(tagId);
1253	}
1254	
1255	/**
1256	 * (non-Javadoc)
1257	 * <p> Title:getAllTag</p>
1258	 * @param userName
1259	 * @return
1260	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getAllTag(java.lang.String)
1261	 */
1262	@Override
1263	public List<TagBean> getAllTag(String userName){
1264		return new TagAccessSessionMySQL().getAllTag(userName);
1265	}
1266	
1267	/**
1268	 * (non-Javadoc)
1269	 * <p> Title:addTagData</p>
1270	 * @param toTagId
1271	 * @param dataIds
1272	 * @return
1273	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addTagData(java.lang.String, java.lang.String[])
1274	 */
1275	@Override
1276	public boolean addTagData(String toTagId, String[] dataIds){
1277		return new TagAccessSessionMySQL().addTagData(toTagId, dataIds);
1278	}
1279	
1280	/**
1281	 * (non-Javadoc)
1282	 * <p> Title:deleteTagData</p>
1283	 * @param tagId
1284	 * @param dataIds
1285	 * @return
1286	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#deleteTagData(java.lang.String, java.lang.String[])
1287	 */
1288	@Override
1289	public boolean deleteTagData(String tagId, String[] dataIds){
1290		return new TagAccessSessionMySQL().deleteTagData(tagId, dataIds);
1291	}
1292	
1293	/**
1294	 * (non-Javadoc)
1295	 * <p> Title:getTagDataById</p>
1296	 * @param tagId
1297	 * @return
1298	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getTagDataById(java.lang.String)
1299	 */
1300	@Override
1301	public String[] getTagDataById(String tagId){
1302		return new TagAccessSessionMySQL().getTagDataById(tagId);
1303	}
1304	
1305	/**
1306	 * (non-Javadoc)
1307	 * <p> Title:getDataTags</p>
1308	 * @param userName
1309	 * @param dataId
1310	 * @return
1311	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getDataTags(java.lang.String, java.lang.String)
1312	 */
1313	@Override
1314	public List<TagBean> getDataTags(String userName,String dataId){
1315		return new TagAccessSessionMySQL().getDataTags(userName,dataId);
1316	}
1317	
1318	/**
1319	 * (non-Javadoc)
1320	 * <p> Title:setDefaultValues</p>
1321	 * @param userName
1322	 * @param templateId
1323	 * @param defaultValueJson
1324	 * @return
1325	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#setDefaultValues(java.lang.String, java.lang.String, java.lang.String)
1326	 */
1327	@Override
1328	public boolean setDefaultValues(String userName, String templateId, String defaultValueJson){
1329		return new DefaultValueAccessSessionMySQL().setDefaultValues(userName,templateId,defaultValueJson);
1330	}
1331	
1332	/**
1333	 * (non-Javadoc)
1334	 * <p> Title:getDefaultValues</p>
1335	 * @param userName
1336	 * @param templateId
1337	 * @return
1338	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getDefaultValues(java.lang.String, java.lang.String)
1339	 */
1340	@Override
1341	public String getDefaultValues(String userName, String templateId){
1342		return new DefaultValueAccessSessionMySQL().getDefaultValues(userName,templateId);
1343	}
1344	
1345	/**
1346	 * (non-Javadoc)
1347	 * <p> Title:getBackRightUsers</p>
1348	 * @return
1349	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getBackRightUsers()
1350	 */
1351	@Override
1352	public List<UserInfo> getBackRightUsers(){
1353		return new BackRightAccessSessionMySQL().getBackRightUsers();
1354	}
1355	
1356	/**
1357	 * (non-Javadoc)
1358	 * <p> Title:addBackRightUser</p>
1359	 * @param userMail
1360	 * @return
1361	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addBackRightUser(java.lang.String)
1362	 */
1363	@Override
1364	public boolean addBackRightUser(String userMail){
1365		return new BackRightAccessSessionMySQL().addBackRightUser(userMail);
1366	}
1367	
1368	/**
1369	 * (non-Javadoc)
1370	 * <p> Title:delBackRightUser</p>
1371	 * @param userMail
1372	 * @return
1373	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#delBackRightUser(java.lang.String)
1374	 */
1375	@Override
1376	public boolean delBackRightUser(String userMail){
1377		return new BackRightAccessSessionMySQL().delBackRightUser(userMail);
1378	}
1379	
1380	/**
1381	 * (non-Javadoc)
1382	 * <p> Title:getTemplateRightUser</p>
1383	 * @param templateId
1384	 * @return
1385	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getTemplateRightUser(java.lang.String)
1386	 */
1387	@Override
1388	public List<UserInfo> getTemplateRightUser(String templateId){
1389		return new BackRightAccessSessionMySQL().getTemplateRightUser(templateId);
1390	}
1391	
1392	/**
1393	 * (non-Javadoc)
1394	 * <p> Title:delUserTemplateRight</p>
1395	 * @param templateId
1396	 * @param userMail
1397	 * @return
1398	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#delUserTemplateRight(java.lang.String, java.lang.String)
1399	 */
1400	@Override
1401	public boolean delUserTemplateRight(String templateId, String userMail){
1402		return new BackRightAccessSessionMySQL().delUserTemplateRight(templateId,userMail);
1403	}
1404	
1405	/**
1406	 * (non-Javadoc)
1407	 * <p> Title:addUserTemplateRight</p>
1408	 * @param templateIds
1409	 * @param userMail
1410	 * @return
1411	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addUserTemplateRight(java.lang.String[], java.lang.String)
1412	 */
1413	@Override
1414	public boolean addUserTemplateRight(String[] templateIds, String userMail){
1415		return new BackRightAccessSessionMySQL().addUserTemplateRight(templateIds,userMail);
1416	}
1417	
1418	/**
1419	 * (non-Javadoc)
1420	 * <p> Title:queryUserTemplateRights</p>
1421	 * @param userMail
1422	 * @return
1423	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryUserTemplateRights(java.lang.String)
1424	 */
1425	@Override
1426	public Map<String, String> queryUserTemplateRights(String userMail){
1427		return new BackRightAccessSessionMySQL().queryUserTemplateRights(userMail);
1428	}
1429	
1430	/**
1431	 * (non-Javadoc)
1432	 * <p> Title:setSystemOption</p>
1433	 * @param systemJson
1434	 * @return
1435	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#setSystemOption(java.lang.String)
1436	 */
1437	@Override
1438	public boolean setSystemOption(String systemJson){
1439		return new BackRightAccessSessionMySQL().setSystemOption(systemJson);
1440	}
1441	
1442	/**
1443	 * (non-Javadoc)
1444	 * <p> Title:getSystemOption</p>
1445	 * @param userMail
1446	 * @return
1447	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getSystemOption(java.lang.String)
1448	 */
1449	@Override
1450	public String getSystemOption(String userMail){
1451		return new BackRightAccessSessionMySQL().getSystemOption(userMail);
1452	}
1453	
1454	/**
1455	 * (non-Javadoc)
1456	 * <p> Title:addFieldColName</p>
1457	 * @param templateId
1458	 * @param fieldColName
1459	 * @param fieldId
1460	 * @param fieldType
1461	 * @return
1462	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addFieldColName(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
1463	 */
1464	@Override
1465	public boolean addFieldColName(String templateId,String fieldColName,String fieldId,String fieldType){
1466		return new FieldNameAccessSessionMySQL().addFieldColName(templateId,fieldColName,fieldId,fieldType);
1467	}
1468	
1469	/**
1470	 * (non-Javadoc)
1471	 * <p> Title:queryStatisticByUser</p>
1472	 * @param userName
1473	 * @return
1474	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryStatisticByUser(java.lang.String)
1475	 */
1476	@Override
1477	public TimerAction[] queryStatisticByUser(String userName)
1478	{
1479		return new TimerActionAccessSessionMySQL().queryStatisticByUser(userName);
1480	}
1481	
1482	/**
1483	 * (non-Javadoc)
1484	 * <p> Title:updateDataLog</p>
1485	 * @param dataId
1486	 * @param logIndex
1487	 * @param logContent
1488	 * @return
1489	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateDataLog(com.sogou.qadev.service.cynthia.bean.UUID, int, java.lang.String)
1490	 */
1491	public boolean updateDataLog(UUID dataId, int logIndex, String logContent){
1492		Data data = queryData(dataId);
1493		if (data == null) {
1494			return false;
1495		}
1496		try {
1497			ChangeLog changeLog = data.getChangeLogs()[logIndex-1];
1498			changeLog.setActionComment(logContent);
1499			updateCache(DataAccessAction.update, dataId.getValue(), data);
1500			return new LogAccessSessionMySQL().updateLogComment(dataId, data.getTemplateId(), logIndex, logContent);
1501		} catch (Exception e) {
1502			e.printStackTrace();
1503			return false;
1504		}
1505	}
1506	
1507	/**
1508	 * (non-Javadoc)
1509	 * <p> Title:queryAllUsersByStatAndName</p>
1510	 * @param userStat
1511	 * @param userName
1512	 * @return
1513	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryAllUsersByStatAndName(java.lang.String, java.lang.String)
1514	 */
1515	public List<UserInfo> queryAllUsersByStatAndName(String userStat,String userName){
1516		return new UserInfoAccessSessionMySQL().queryAllUsersByStatAndName(userStat,userName);
1517	}
1518	
1519	/**
1520	 * (non-Javadoc)
1521	 * <p> Title:updateAttachment</p>
1522	 * @param attachment
1523	 * @return
1524	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateAttachment(com.sogou.qadev.service.cynthia.bean.Attachment)
1525	 */
1526	public boolean updateAttachment(Attachment attachment){
1527		return new AttachmentAccessSessionMySQL().updateAttachment(attachment);
1528	}
1529	
1530	/**
1531	 * (non-Javadoc)
1532	 * <p> Title:addtemplateUserRight</p>
1533	 * @param templateId
1534	 * @param users
1535	 * @return
1536	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#addtemplateUserRight(java.lang.String, java.lang.String[])
1537	 */
1538	public boolean addtemplateUserRight(String templateId,String[] users){
1539		return new BackRightAccessSessionMySQL().addtemplateUserRight(templateId, users);
1540	}
1541	
1542	/**
1543	 * (non-Javadoc)
1544	 * <p> Title:delTemplateUserRight</p>
1545	 * @param templateId
1546	 * @param user
1547	 * @return
1548	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#delTemplateUserRight(java.lang.String, java.lang.String)
1549	 */
1550	public boolean delTemplateUserRight(String templateId,String user){
1551		return new BackRightAccessSessionMySQL().deltemplateUserRight(templateId, user);
1552	}
1553	
1554	/**
1555	 * (non-Javadoc)
1556	 * <p> Title:getAllGuide</p>
1557	 * @return
1558	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getAllGuide()
1559	 */
1560	public List<GuideBean> queryAllGuide(){
1561		return new GuideAccessSessionMySQL().getAll();
1562	}
1563	
1564	/**
1565	 * (non-Javadoc)
1566	 * <p> Title:getGuideHtmlByGuideId</p>
1567	 * @param guideId
1568	 * @return
1569	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#getGuideHtmlByGuideId(java.lang.String)
1570	 */
1571	public String queryGuideHtmlByGuideId( String guideId){
1572		return new GuideAccessSessionMySQL().getGuideHtmlByGuideId(guideId);
1573	}
1574	
1575	/**
1576	 * (non-Javadoc)
1577	 * <p> Title:saveGuideHtml</p>
1578	 * @param guideId
1579	 * @param guideHtml
1580	 * @return
1581	 * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#saveGuideHtml(java.lang.String, java.lang.String)
1582	 */
1583	public boolean saveGuideHtml(String guideId , String guideHtml){
1584		return new GuideAccessSessionMySQL().saveGuideHtml(guideId, guideHtml);
1585	}
1586}