Package com.jeecms.cms.entity.assist

Examples of com.jeecms.cms.entity.assist.CmsSiteFlow


@Service
public class CmsSiteFlowCacheImpl implements CmsSiteFlowCache, DisposableBean {
  private Logger log = LoggerFactory.getLogger(CmsSiteFlowCacheImpl.class);

  public void flow(CmsSite site, String ip, String sessionId, String page, String referer) {
    CmsSiteFlow cmsSiteFlow = create(site, ip, sessionId, page, referer);
    FlowBean flowBean = new FlowBean(cmsSiteFlow.getAccessDate(), sessionId, page);
    if(cache.get(flowBean) == null){
      CmsSiteFlow bean = null;
      try {
        bean = manager.findUniqueByProperties(site.getId(), cmsSiteFlow.getAccessDate(),
            sessionId, page);
      } catch (HibernateException e) {
        cache.remove(flowBean);
View Full Code Here


    refreshToDB();
  }

  private CmsSiteFlow create(CmsSite site, String ip, String sessionId,
      String page, String referer) {
    CmsSiteFlow bean = new CmsSiteFlow();
    Date now = new Timestamp(System.currentTimeMillis());
    bean.setSite(site);
    bean.setAccessIp(ip);
    bean.setAccessPage(page);
    bean.setAccessTime(now);
    bean.setAccessDate(DateFormatUtils.formatDate(now));
    bean.setSessionId(sessionId);
    bean.setRefererPage(referer);
    bean.setRefererWebSite(getRefererWebSite(referer));
    bean.setArea(ipSeeker.getIPLocation(ip).getCountry());
    bean.setRefererKeyword(getKeyword(referer));
    return bean;
  }
View Full Code Here

@Transactional
public class CmsSiteFlowMngImpl implements CmsSiteFlowMng {

  public CmsSiteFlow save(CmsSite site, String ip, String page,
      String sessionId) {
    CmsSiteFlow cmsSiteFlow = new CmsSiteFlow();
    Date now = new Timestamp(System.currentTimeMillis());
    cmsSiteFlow.setSite(site);
    cmsSiteFlow.setAccessIp(ip);
    cmsSiteFlow.setAccessPage(page);
    cmsSiteFlow.setAccessTime(now);
    cmsSiteFlow.setAccessDate(DateFormatUtils.formatDate(now));
    cmsSiteFlow.setSessionId(sessionId);
    return dao.save(cmsSiteFlow);
  }
View Full Code Here

    for (FlowBean bean : list) {
      Element element = cache.get(bean);
      if (element == null) {
        return count;
      }
      CmsSiteFlow cmsSiteFlow = (CmsSiteFlow) element.getValue();
      if (cmsSiteFlow.getId() == null
          && cmsSiteFlow.getSessionId() != null) {
        dao.save(cmsSiteFlow);
      }
    }
    return count;
  }
View Full Code Here

TOP

Related Classes of com.jeecms.cms.entity.assist.CmsSiteFlow

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.