Package com.dianping.cat.consumer.company.model.entity

Examples of com.dianping.cat.consumer.company.model.entity.Company


      }
    } catch (Exception e) {
      Cat.logError(e);
    }
    if (m_company == null) {
      m_company = new Company();
    }
    m_domainToProductLines = buildDomainToProductLines();
  }
View Full Code Here


    }
    m_domainToProductLines = buildDomainToProductLines();
  }

  public boolean insertIfNotExsit(String product, String domain) {
    Company company = getCompany();

    if (company != null) {
      ProductLine productLine = company.getProductLines().get(product);

      if (productLine == null) {
        productLine = new ProductLine();
        productLine.setId(product);
        productLine.setTitle(product);
        buildDefaultDashboard(productLine, domain);
        productLine.addDomain(new Domain(domain));
        company.addProductLine(productLine);
        return storeConfig();
      } else {
        Map<String, Domain> domains = productLine.getDomains();

        if (domains.containsKey(domain)) {
View Full Code Here

    long modifyTime = config.getModifyDate().getTime();

    synchronized (this) {
      if (modifyTime > m_modifyTime) {
        String content = config.getContent();
        Company company = DefaultSaxParser.parse(content);

        m_company = company;
        m_domainToProductLines = buildDomainToProductLines();
        m_modifyTime = modifyTime;
        m_logger.info("product line config refresh done!");
View Full Code Here

    try {
      manager.initialize();
    } catch (Exception e) {
    }

    Company config = manager.getCompany();
    Assert.assertEquals(0, config.getProductLines().size());
  }
View Full Code Here

    public Config findByPK(int keyId, Readset<Config> readset) throws DalException {
      Config config = new Config();

      config.setId(keyId);
      config.setModifyDate(new Date());
      config.setContent(new Company().toString());
      return config;
    }
View Full Code Here

    @Override
    public Config findByName(String name, Readset<Config> readset) throws DalException {
      Config config = new Config();

      config.setName(name);
      Company company = new Company();
      ProductLine productLine = new ProductLine("Test");

      company.addProductLine(productLine);
      config.setContent(company.toString());
      config.setModifyDate(new Date());
      return config;
    }
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.company.model.entity.Company

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.