Package com.sogou.qadev.service.cynthia.dao

Examples of com.sogou.qadev.service.cynthia.dao.FlowAccessSessionMySQL


   */
  public synchronized ErrorCode removeFlow(UUID flowId)
  {
    ErrorCode errorCode = ErrorCode.success;
    try {
      if(!new FlowAccessSessionMySQL().removeFlowById(flowId))
        errorCode = ErrorCode.dbFail;
    } catch (Exception e) {
      logger.error("",e);
       errorCode = ErrorCode.dbFail;
    }
View Full Code Here


  public synchronized ErrorCode updateFlow(Flow flow)
  { 
    ErrorCode errorCode = ErrorCode.success;
    try {
      if (FlowCache.getInstance().get(flow.getId()) == null) {
        if(!new FlowAccessSessionMySQL().addFlow(flow))
          errorCode = ErrorCode.dbFail;
      } else {
        if(!new FlowAccessSessionMySQL().updateFlow(flow))
          errorCode = ErrorCode.dbFail;
      }
     
    } catch (Exception e) {
      logger.error("",e);
View Full Code Here

      if (flow instanceof Flow) {
        tmp = (Flow)flow;
      }
    }
    else{
      tmp = new FlowAccessSessionMySQL().queryFlowById(DataAccessFactory.getInstance().createUUID(id));
      if (tmp != null) {
        EhcacheHandler.getInstance().set(EhcacheHandler.FOREVER_CACHE,tmp.getId().getValue(), tmp);
      }
    }
    if (tmp == null) {
View Full Code Here

    Object allFlow = EhcacheHandler.getInstance().get(EhcacheHandler.FOREVER_CACHE,"allFlow");
    if (allFlow != null) {
      return (Vector<Flow>)allFlow;
    }else {
      logger.info("all flow is not in cache");
      Vector<Flow> allFlowList = new FlowAccessSessionMySQL().queryAllFlow();
      EhcacheHandler.getInstance().set(EhcacheHandler.FOREVER_CACHE, EhcacheHandler.FOREVER_CACHE, allFlowList);
      return allFlowList;
    }
  }
View Full Code Here

   * @description:query all flows from DB, put to the cache
   * @date:2014-5-5 下午7:52:04
   * @version:v1.0
   */
  public void putAllDataToCache(){
    List<Flow> allFlows = new FlowAccessSessionMySQL().queryAllFlow();
    EhcacheHandler ehcacheHandler = EhcacheHandler.getInstance();

    for (Flow flow : allFlows) {
      ehcacheHandler.set(EhcacheHandler.FOREVER_CACHE,flow.getId().getValue(), flow);
    }
View Full Code Here

   * @return
   * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#queryFlowSvg(com.sogou.qadev.service.cynthia.bean.UUID)
   */
  public String queryFlowSvg(UUID flowId)
  {
    return new FlowAccessSessionMySQL().querySvg(flowId);
  }
View Full Code Here

   * @return
   * @see com.sogou.qadev.service.cynthia.service.DataAccessSession#updateSvg(com.sogou.qadev.service.cynthia.bean.UUID, java.lang.String)
   */
  @Override
  public boolean updateSvg(UUID flowId, String svgCode) {
    return new FlowAccessSessionMySQL().updateSvg(flowId, svgCode);
  }
View Full Code Here

TOP

Related Classes of com.sogou.qadev.service.cynthia.dao.FlowAccessSessionMySQL

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.