@Override
  public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
    ComponentLocator locator = ComponentLocator.getCurrentLocator();
    _configDao = locator.getDao(ConfigurationDao.class);
    _setupAgentPath = Script.findScript(getPatchPath(), "setup_agent.sh");
    _kvmPrivateNic = _configDao.getValue(Config.KvmPrivateNetwork.key());
    if (_kvmPrivateNic == null) {
      _kvmPrivateNic = "cloudbr0";
    }

    _kvmPublicNic = _configDao.getValue(Config.KvmPublicNetwork.key());
    if (_kvmPublicNic == null) {
      _kvmPublicNic = _kvmPrivateNic;
    }

    _kvmGuestNic = _configDao.getValue(Config.KvmGuestNetwork.key());
    if (_kvmGuestNic == null) {
      _kvmGuestNic = _kvmPrivateNic;
    }

    if (_setupAgentPath == null) {
      throw new ConfigurationException("Can't find setup_agent.sh");
    }
    _hostIp = _configDao.getValue("host");
    if (_hostIp == null) {
      throw new ConfigurationException("Can't get host IP");
    }
    _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
    return true;
  }
 @Override
 public boolean configure(final String name, final Map<String, Object> params)
     throws ConfigurationException {
   super.configure(name, params);
   _resourceMgr.registerResourceStateAdapter(name, this);
   return true;
 }
  @Override
  public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
    if (s_logger.isInfoEnabled())
      s_logger.info("Configure VmwareServerDiscoverer, discover name: " + name);

    super.configure(name, params);

    createVmwareToolsIso();

    if (s_logger.isInfoEnabled()) {
      s_logger.info("VmwareServerDiscoverer has been successfully configured");
    }
    _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
    return true;
  }
  @Override
  public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
    AllocatedIpSearch = _ipAddressDao.createSearchBuilder();
    AllocatedIpSearch.and("allocated", AllocatedIpSearch.entity().getAllocatedTime(), Op.NNULL);
    AllocatedIpSearch.and("dc", AllocatedIpSearch.entity().getDataCenterId(), Op.EQ);
    SearchBuilder<NetworkVO> networkJoin = _networksDao.createSearchBuilder();
    networkJoin.and("guestType", networkJoin.entity().getGuestType(), Op.EQ);
    AllocatedIpSearch.join(
        "network",
        networkJoin,
        AllocatedIpSearch.entity().getSourceNetworkId(),
        networkJoin.entity().getId(),
        JoinBuilder.JoinType.INNER);
    AllocatedIpSearch.done();

    _networkStatsInterval =
        NumbersUtil.parseInt(_configDao.getValue(Config.DirectNetworkStatsInterval.key()), 86400);
    _TSinclZones = _configDao.getValue(Config.TrafficSentinelIncludeZones.key());
    _TSexclZones = _configDao.getValue(Config.TrafficSentinelExcludeZones.key());
    _agentMgr.registerForHostEvents(
        new DirectNetworkStatsListener(_networkStatsInterval), true, false, false);
    _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
    return true;
  }
 @Override
 public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
   super.configure(name, params);
   _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
   return true;
 }