Program: 106166
Project: 106166
Buggy source:
@Override @DB public boolean configure(final String name,final Map<String,Object> params) throws ConfigurationException {
  _configs=_configDao.getConfiguration("String_Node_Str",params);
  _networkGcWait=NumbersUtil.parseInt(_configs.get(Config.NetworkGcWait.key()),600);
  _networkGcInterval=NumbersUtil.parseInt(_configs.get(Config.NetworkGcInterval.key()),600);
  _configs=_configDao.getConfiguration("String_Node_Str",params);
  _networkLockTimeout=NumbersUtil.parseInt(_configs.get(Config.NetworkLockTimeout.key()),600);
  Map<Network.Service,Set<Network.Provider>> defaultSharedNetworkOfferingProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  Set<Network.Provider> defaultProviders=new HashSet<Network.Provider>();
  defaultProviders.add(Network.Provider.VirtualRouter);
  defaultSharedNetworkOfferingProviders.put(Service.Dhcp,defaultProviders);
  defaultSharedNetworkOfferingProviders.put(Service.Dns,defaultProviders);
  defaultSharedNetworkOfferingProviders.put(Service.UserData,defaultProviders);
  Map<Network.Service,Set<Network.Provider>> defaultIsolatedNetworkOfferingProviders=defaultSharedNetworkOfferingProviders;
  defaultIsolatedNetworkOfferingProviders.put(Service.Dhcp,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Dns,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.UserData,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Firewall,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Gateway,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Lb,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.StaticNat,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.PortForwarding,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Vpn,defaultProviders);
  Map<Network.Service,Set<Network.Provider>> defaultSharedSGEnabledNetworkOfferingProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  defaultSharedSGEnabledNetworkOfferingProviders.put(Service.Dhcp,defaultProviders);
  defaultSharedSGEnabledNetworkOfferingProviders.put(Service.Dns,defaultProviders);
  defaultSharedSGEnabledNetworkOfferingProviders.put(Service.UserData,defaultProviders);
  Set<Provider> sgProviders=new HashSet<Provider>();
  sgProviders.add(Provider.SecurityGroupProvider);
  defaultSharedSGEnabledNetworkOfferingProviders.put(Service.SecurityGroup,sgProviders);
  Map<Network.Service,Set<Network.Provider>> defaultIsolatedSourceNatEnabledNetworkOfferingProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  defaultProviders.clear();
  defaultProviders.add(Network.Provider.VirtualRouter);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Dhcp,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Dns,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.UserData,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Firewall,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Gateway,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Lb,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.SourceNat,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.StaticNat,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.PortForwarding,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Vpn,defaultProviders);
  Map<Network.Service,Set<Network.Provider>> defaultVPCOffProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  defaultProviders.clear();
  defaultProviders.add(Network.Provider.VirtualRouter);
  defaultVPCOffProviders.put(Service.Dhcp,defaultProviders);
  defaultVPCOffProviders.put(Service.Dns,defaultProviders);
  defaultVPCOffProviders.put(Service.UserData,defaultProviders);
  defaultVPCOffProviders.put(Service.NetworkACL,defaultProviders);
  defaultVPCOffProviders.put(Service.Gateway,defaultProviders);
  defaultVPCOffProviders.put(Service.Lb,defaultProviders);
  defaultVPCOffProviders.put(Service.SourceNat,defaultProviders);
  defaultVPCOffProviders.put(Service.StaticNat,defaultProviders);
  defaultVPCOffProviders.put(Service.PortForwarding,defaultProviders);
  defaultVPCOffProviders.put(Service.Vpn,defaultProviders);
  Transaction txn=Transaction.currentTxn();
  txn.start();
  NetworkOfferingVO offering=null;
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.QuickCloudNoServices) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.QuickCloudNoServices,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,new HashMap<Network.Service,Set<Network.Provider>>(),true,Network.GuestType.Shared,false,null,true,null,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedNetworkOfferingWithSGService) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultSharedNetworkOfferingWithSGService,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,defaultSharedNetworkOfferingProviders,true,Network.GuestType.Shared,false,null,true,null,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedNetworkOffering) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultSharedNetworkOffering,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,defaultSharedNetworkOfferingProviders,true,Network.GuestType.Shared,false,null,true,null,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingWithSourceNatService) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingWithSourceNatService,"String_Node_Str",TrafficType.Guest,null,false,Availability.Required,null,defaultIsolatedSourceNatEnabledNetworkOfferingProviders,true,Network.GuestType.Isolated,false,null,true,null,false,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworks) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworks,"String_Node_Str",TrafficType.Guest,null,false,Availability.Optional,null,defaultVPCOffProviders,true,Network.GuestType.Isolated,false,null,false,null,false,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksNoLB) == null) {
    defaultVPCOffProviders.remove(Service.Lb);
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksNoLB,"String_Node_Str",TrafficType.Guest,null,false,Availability.Optional,null,defaultVPCOffProviders,true,Network.GuestType.Isolated,false,null,false,null,false,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOffering) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOffering,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,defaultIsolatedNetworkOfferingProviders,true,Network.GuestType.Isolated,false,null,true,null,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  Map<Network.Service,Set<Network.Provider>> internalLbOffProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  Set<Network.Provider> defaultVpcProvider=new HashSet<Network.Provider>();
  defaultVpcProvider.add(Network.Provider.VPCVirtualRouter);
  Set<Network.Provider> defaultInternalLbProvider=new HashSet<Network.Provider>();
  defaultInternalLbProvider.add(Network.Provider.InternalLbVm);
  internalLbOffProviders.put(Service.Dhcp,defaultVpcProvider);
  internalLbOffProviders.put(Service.Dns,defaultVpcProvider);
  internalLbOffProviders.put(Service.UserData,defaultVpcProvider);
  internalLbOffProviders.put(Service.NetworkACL,defaultVpcProvider);
  internalLbOffProviders.put(Service.Gateway,defaultVpcProvider);
  internalLbOffProviders.put(Service.Lb,defaultInternalLbProvider);
  internalLbOffProviders.put(Service.SourceNat,defaultVpcProvider);
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksWithInternalLB) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksWithInternalLB,"String_Node_Str",TrafficType.Guest,null,false,Availability.Optional,null,internalLbOffProviders,true,Network.GuestType.Isolated,false,null,false,null,false,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    offering.setInternalLb(true);
    offering.setPublicLb(false);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  Map<Network.Service,Set<Network.Provider>> netscalerServiceProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  Set<Network.Provider> vrProvider=new HashSet<Network.Provider>();
  vrProvider.add(Provider.VirtualRouter);
  Set<Network.Provider> sgProvider=new HashSet<Network.Provider>();
  sgProvider.add(Provider.SecurityGroupProvider);
  Set<Network.Provider> nsProvider=new HashSet<Network.Provider>();
  nsProvider.add(Provider.Netscaler);
  netscalerServiceProviders.put(Service.Dhcp,vrProvider);
  netscalerServiceProviders.put(Service.Dns,vrProvider);
  netscalerServiceProviders.put(Service.UserData,vrProvider);
  netscalerServiceProviders.put(Service.SecurityGroup,sgProvider);
  netscalerServiceProviders.put(Service.StaticNat,nsProvider);
  netscalerServiceProviders.put(Service.Lb,nsProvider);
  Map<Service,Map<Capability,String>> serviceCapabilityMap=new HashMap<Service,Map<Capability,String>>();
  Map<Capability,String> elb=new HashMap<Capability,String>();
  elb.put(Capability.ElasticLb,"String_Node_Str");
  Map<Capability,String> eip=new HashMap<Capability,String>();
  eip.put(Capability.ElasticIp,"String_Node_Str");
  serviceCapabilityMap.put(Service.Lb,elb);
  serviceCapabilityMap.put(Service.StaticNat,eip);
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedEIPandELBNetworkOffering) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultSharedEIPandELBNetworkOffering,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,netscalerServiceProviders,true,Network.GuestType.Shared,false,null,true,serviceCapabilityMap,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    offering.setDedicatedLB(false);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  txn.commit();
  AssignIpAddressSearch=_ipAddressDao.createSearchBuilder();
  AssignIpAddressSearch.and("String_Node_Str",AssignIpAddressSearch.entity().getDataCenterId(),Op.EQ);
  AssignIpAddressSearch.and("String_Node_Str",AssignIpAddressSearch.entity().getAllocatedTime(),Op.NULL);
  AssignIpAddressSearch.and("String_Node_Str",AssignIpAddressSearch.entity().getVlanId(),Op.IN);
  SearchBuilder<VlanVO> vlanSearch=_vlanDao.createSearchBuilder();
  vlanSearch.and("String_Node_Str",vlanSearch.entity().getVlanType(),Op.EQ);
  vlanSearch.and("String_Node_Str",vlanSearch.entity().getNetworkId(),Op.EQ);
  AssignIpAddressSearch.join("String_Node_Str",vlanSearch,vlanSearch.entity().getId(),AssignIpAddressSearch.entity().getVlanId(),JoinType.INNER);
  AssignIpAddressSearch.done();
  AssignIpAddressFromPodVlanSearch=_ipAddressDao.createSearchBuilder();
  AssignIpAddressFromPodVlanSearch.and("String_Node_Str",AssignIpAddressFromPodVlanSearch.entity().getDataCenterId(),Op.EQ);
  AssignIpAddressFromPodVlanSearch.and("String_Node_Str",AssignIpAddressFromPodVlanSearch.entity().getAllocatedTime(),Op.NULL);
  SearchBuilder<VlanVO> podVlanSearch=_vlanDao.createSearchBuilder();
  podVlanSearch.and("String_Node_Str",podVlanSearch.entity().getVlanType(),Op.EQ);
  podVlanSearch.and("String_Node_Str",podVlanSearch.entity().getNetworkId(),Op.EQ);
  SearchBuilder<PodVlanMapVO> podVlanMapSB=_podVlanMapDao.createSearchBuilder();
  podVlanMapSB.and("String_Node_Str",podVlanMapSB.entity().getPodId(),Op.EQ);
  AssignIpAddressFromPodVlanSearch.join("String_Node_Str",podVlanMapSB,podVlanMapSB.entity().getVlanDbId(),AssignIpAddressFromPodVlanSearch.entity().getVlanId(),JoinType.INNER);
  AssignIpAddressFromPodVlanSearch.join("String_Node_Str",podVlanSearch,podVlanSearch.entity().getId(),AssignIpAddressFromPodVlanSearch.entity().getVlanId(),JoinType.INNER);
  AssignIpAddressFromPodVlanSearch.done();
  _executor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  _agentMgr.registerForHostEvents(this,true,false,true);
  Network.State.getStateMachine().registerListener(new NetworkStateListener(_usageEventDao,_networksDao));
  s_logger.info("String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override @DB public boolean configure(final String name,final Map<String,Object> params) throws ConfigurationException {
  _configs=_configDao.getConfiguration("String_Node_Str",params);
  _networkGcWait=NumbersUtil.parseInt(_configs.get(Config.NetworkGcWait.key()),600);
  _networkGcInterval=NumbersUtil.parseInt(_configs.get(Config.NetworkGcInterval.key()),600);
  _configs=_configDao.getConfiguration("String_Node_Str",params);
  _networkLockTimeout=NumbersUtil.parseInt(_configs.get(Config.NetworkLockTimeout.key()),600);
  Map<Network.Service,Set<Network.Provider>> defaultSharedNetworkOfferingProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  Set<Network.Provider> defaultProviders=new HashSet<Network.Provider>();
  defaultProviders.add(Network.Provider.VirtualRouter);
  defaultSharedNetworkOfferingProviders.put(Service.Dhcp,defaultProviders);
  defaultSharedNetworkOfferingProviders.put(Service.Dns,defaultProviders);
  defaultSharedNetworkOfferingProviders.put(Service.UserData,defaultProviders);
  Map<Network.Service,Set<Network.Provider>> defaultIsolatedNetworkOfferingProviders=defaultSharedNetworkOfferingProviders;
  defaultIsolatedNetworkOfferingProviders.put(Service.Dhcp,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Dns,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.UserData,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Firewall,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Gateway,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Lb,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.StaticNat,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.PortForwarding,defaultProviders);
  defaultIsolatedNetworkOfferingProviders.put(Service.Vpn,defaultProviders);
  Map<Network.Service,Set<Network.Provider>> defaultSharedSGEnabledNetworkOfferingProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  defaultSharedSGEnabledNetworkOfferingProviders.put(Service.Dhcp,defaultProviders);
  defaultSharedSGEnabledNetworkOfferingProviders.put(Service.Dns,defaultProviders);
  defaultSharedSGEnabledNetworkOfferingProviders.put(Service.UserData,defaultProviders);
  Set<Provider> sgProviders=new HashSet<Provider>();
  sgProviders.add(Provider.SecurityGroupProvider);
  defaultSharedSGEnabledNetworkOfferingProviders.put(Service.SecurityGroup,sgProviders);
  Map<Network.Service,Set<Network.Provider>> defaultIsolatedSourceNatEnabledNetworkOfferingProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  defaultProviders.clear();
  defaultProviders.add(Network.Provider.VirtualRouter);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Dhcp,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Dns,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.UserData,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Firewall,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Gateway,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Lb,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.SourceNat,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.StaticNat,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.PortForwarding,defaultProviders);
  defaultIsolatedSourceNatEnabledNetworkOfferingProviders.put(Service.Vpn,defaultProviders);
  Map<Network.Service,Set<Network.Provider>> defaultVPCOffProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  defaultProviders.clear();
  defaultProviders.add(Network.Provider.VirtualRouter);
  defaultVPCOffProviders.put(Service.Dhcp,defaultProviders);
  defaultVPCOffProviders.put(Service.Dns,defaultProviders);
  defaultVPCOffProviders.put(Service.UserData,defaultProviders);
  defaultVPCOffProviders.put(Service.NetworkACL,defaultProviders);
  defaultVPCOffProviders.put(Service.Gateway,defaultProviders);
  defaultVPCOffProviders.put(Service.Lb,defaultProviders);
  defaultVPCOffProviders.put(Service.SourceNat,defaultProviders);
  defaultVPCOffProviders.put(Service.StaticNat,defaultProviders);
  defaultVPCOffProviders.put(Service.PortForwarding,defaultProviders);
  defaultVPCOffProviders.put(Service.Vpn,defaultProviders);
  Transaction txn=Transaction.currentTxn();
  txn.start();
  NetworkOfferingVO offering=null;
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.QuickCloudNoServices) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.QuickCloudNoServices,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,new HashMap<Network.Service,Set<Network.Provider>>(),true,Network.GuestType.Shared,false,null,true,null,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedNetworkOfferingWithSGService) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultSharedNetworkOfferingWithSGService,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,defaultSharedNetworkOfferingProviders,true,Network.GuestType.Shared,false,null,true,null,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedNetworkOffering) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultSharedNetworkOffering,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,defaultSharedNetworkOfferingProviders,true,Network.GuestType.Shared,false,null,true,null,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingWithSourceNatService) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingWithSourceNatService,"String_Node_Str",TrafficType.Guest,null,false,Availability.Required,null,defaultIsolatedSourceNatEnabledNetworkOfferingProviders,true,Network.GuestType.Isolated,false,null,true,null,false,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworks) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworks,"String_Node_Str",TrafficType.Guest,null,false,Availability.Optional,null,defaultVPCOffProviders,true,Network.GuestType.Isolated,false,null,false,null,false,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksNoLB) == null) {
    defaultVPCOffProviders.remove(Service.Lb);
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksNoLB,"String_Node_Str",TrafficType.Guest,null,false,Availability.Optional,null,defaultVPCOffProviders,true,Network.GuestType.Isolated,false,null,false,null,false,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOffering) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOffering,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,defaultIsolatedNetworkOfferingProviders,true,Network.GuestType.Isolated,false,null,true,null,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  Map<Network.Service,Set<Network.Provider>> internalLbOffProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  Set<Network.Provider> defaultVpcProvider=new HashSet<Network.Provider>();
  defaultVpcProvider.add(Network.Provider.VPCVirtualRouter);
  Set<Network.Provider> defaultInternalLbProvider=new HashSet<Network.Provider>();
  defaultInternalLbProvider.add(Network.Provider.InternalLbVm);
  internalLbOffProviders.put(Service.Dhcp,defaultVpcProvider);
  internalLbOffProviders.put(Service.Dns,defaultVpcProvider);
  internalLbOffProviders.put(Service.UserData,defaultVpcProvider);
  internalLbOffProviders.put(Service.NetworkACL,defaultVpcProvider);
  internalLbOffProviders.put(Service.Gateway,defaultVpcProvider);
  internalLbOffProviders.put(Service.Lb,defaultInternalLbProvider);
  internalLbOffProviders.put(Service.SourceNat,defaultVpcProvider);
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksWithInternalLB) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksWithInternalLB,"String_Node_Str",TrafficType.Guest,null,false,Availability.Optional,null,internalLbOffProviders,true,Network.GuestType.Isolated,false,null,false,null,false,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    offering.setInternalLb(true);
    offering.setPublicLb(false);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  Map<Network.Service,Set<Network.Provider>> netscalerServiceProviders=new HashMap<Network.Service,Set<Network.Provider>>();
  Set<Network.Provider> vrProvider=new HashSet<Network.Provider>();
  vrProvider.add(Provider.VirtualRouter);
  Set<Network.Provider> sgProvider=new HashSet<Network.Provider>();
  sgProvider.add(Provider.SecurityGroupProvider);
  Set<Network.Provider> nsProvider=new HashSet<Network.Provider>();
  nsProvider.add(Provider.Netscaler);
  netscalerServiceProviders.put(Service.Dhcp,vrProvider);
  netscalerServiceProviders.put(Service.Dns,vrProvider);
  netscalerServiceProviders.put(Service.UserData,vrProvider);
  netscalerServiceProviders.put(Service.SecurityGroup,sgProvider);
  netscalerServiceProviders.put(Service.StaticNat,nsProvider);
  netscalerServiceProviders.put(Service.Lb,nsProvider);
  Map<Service,Map<Capability,String>> serviceCapabilityMap=new HashMap<Service,Map<Capability,String>>();
  Map<Capability,String> elb=new HashMap<Capability,String>();
  elb.put(Capability.ElasticLb,"String_Node_Str");
  Map<Capability,String> eip=new HashMap<Capability,String>();
  eip.put(Capability.ElasticIp,"String_Node_Str");
  serviceCapabilityMap.put(Service.Lb,elb);
  serviceCapabilityMap.put(Service.StaticNat,eip);
  if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedEIPandELBNetworkOffering) == null) {
    offering=_configMgr.createNetworkOffering(NetworkOffering.DefaultSharedEIPandELBNetworkOffering,"String_Node_Str",TrafficType.Guest,null,true,Availability.Optional,null,netscalerServiceProviders,true,Network.GuestType.Shared,false,null,true,serviceCapabilityMap,true,false,null,false,null);
    offering.setState(NetworkOffering.State.Enabled);
    offering.setDedicatedLB(false);
    _networkOfferingDao.update(offering.getId(),offering);
  }
  txn.commit();
  AssignIpAddressSearch=_ipAddressDao.createSearchBuilder();
  AssignIpAddressSearch.and("String_Node_Str",AssignIpAddressSearch.entity().getDataCenterId(),Op.EQ);
  AssignIpAddressSearch.and("String_Node_Str",AssignIpAddressSearch.entity().getAllocatedTime(),Op.NULL);
  AssignIpAddressSearch.and("String_Node_Str",AssignIpAddressSearch.entity().getVlanId(),Op.IN);
  SearchBuilder<VlanVO> vlanSearch=_vlanDao.createSearchBuilder();
  vlanSearch.and("String_Node_Str",vlanSearch.entity().getVlanType(),Op.EQ);
  vlanSearch.and("String_Node_Str",vlanSearch.entity().getNetworkId(),Op.EQ);
  AssignIpAddressSearch.join("String_Node_Str",vlanSearch,vlanSearch.entity().getId(),AssignIpAddressSearch.entity().getVlanId(),JoinType.INNER);
  AssignIpAddressSearch.done();
  AssignIpAddressFromPodVlanSearch=_ipAddressDao.createSearchBuilder();
  AssignIpAddressFromPodVlanSearch.and("String_Node_Str",AssignIpAddressFromPodVlanSearch.entity().getDataCenterId(),Op.EQ);
  AssignIpAddressFromPodVlanSearch.and("String_Node_Str",AssignIpAddressFromPodVlanSearch.entity().getAllocatedTime(),Op.NULL);
  AssignIpAddressFromPodVlanSearch.and("String_Node_Str",AssignIpAddressFromPodVlanSearch.entity().getVlanId(),Op.IN);
  SearchBuilder<VlanVO> podVlanSearch=_vlanDao.createSearchBuilder();
  podVlanSearch.and("String_Node_Str",podVlanSearch.entity().getVlanType(),Op.EQ);
  podVlanSearch.and("String_Node_Str",podVlanSearch.entity().getNetworkId(),Op.EQ);
  SearchBuilder<PodVlanMapVO> podVlanMapSB=_podVlanMapDao.createSearchBuilder();
  podVlanMapSB.and("String_Node_Str",podVlanMapSB.entity().getPodId(),Op.EQ);
  AssignIpAddressFromPodVlanSearch.join("String_Node_Str",podVlanMapSB,podVlanMapSB.entity().getVlanDbId(),AssignIpAddressFromPodVlanSearch.entity().getVlanId(),JoinType.INNER);
  AssignIpAddressFromPodVlanSearch.join("String_Node_Str",podVlanSearch,podVlanSearch.entity().getId(),AssignIpAddressFromPodVlanSearch.entity().getVlanId(),JoinType.INNER);
  AssignIpAddressFromPodVlanSearch.done();
  _executor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  _agentMgr.registerForHostEvents(this,true,false,true);
  Network.State.getStateMachine().registerListener(new NetworkStateListener(_usageEventDao,_networksDao));
  s_logger.info("String_Node_Str");
  return true;
}