コード例 #1
0
  public List<String> queryDomainGroup(String domain) {
    Domain domainGroup = m_domainGroup.findDomain(domain);

    if (domainGroup == null) {
      return new ArrayList<String>();
    } else {
      return new ArrayList<String>(domainGroup.getGroups().keySet());
    }
  }
コード例 #2
0
  public List<String> queryIpByDomainAndGroup(String domain, String group) {
    Domain domainInfo = m_domainGroup.findDomain(domain);

    if (domainInfo != null) {
      Group groupInfo = domainInfo.findGroup(group);

      if (groupInfo != null) {
        return groupInfo.getIps();
      }
    }
    return new ArrayList<String>();
  }
コード例 #3
0
  private boolean storeConfig() {
    synchronized (this) {
      try {
        Config config = m_configDao.createLocal();

        config.setId(m_configId);
        config.setKeyId(m_configId);
        config.setName(CONFIG_NAME);
        config.setContent(m_domainGroup.toString());
        m_configDao.updateByPK(config, ConfigEntity.UPDATESET_FULL);
      } catch (Exception e) {
        Cat.logError(e);
        return false;
      }
    }
    return true;
  }