test_class.declarator: NETWORK_ID = 42L
test_class.modifier: private static final
test_class.original_string: private static final long NETWORK_ID = 42L;
test_class.type: long
test_class.var_name: NETWORK_ID
test_class.declarator: element = new NiciraNvpElement()
test_class.original_string: NiciraNvpElement element = new NiciraNvpElement();
test_class.type: NiciraNvpElement
test_class.var_name: element
test_class.declarator: networkManager = mock(NetworkOrchestrationService.class)
test_class.original_string: NetworkOrchestrationService networkManager = mock(NetworkOrchestrationService.class);
test_class.type: NetworkOrchestrationService
test_class.var_name: networkManager
test_class.declarator: networkModel = mock(NetworkModel.class)
test_class.original_string: NetworkModel networkModel = mock(NetworkModel.class);
test_class.type: NetworkModel
test_class.var_name: networkModel
test_class.declarator: ntwkSrvcDao = mock(NetworkServiceMapDao.class)
test_class.original_string: NetworkServiceMapDao ntwkSrvcDao = mock(NetworkServiceMapDao.class);
test_class.type: NetworkServiceMapDao
test_class.var_name: ntwkSrvcDao
test_class.declarator: agentManager = mock(AgentManager.class)
test_class.original_string: AgentManager agentManager = mock(AgentManager.class);
test_class.type: AgentManager
test_class.var_name: agentManager
test_class.declarator: hostDao = mock(HostDao.class)
test_class.original_string: HostDao hostDao = mock(HostDao.class);
test_class.type: HostDao
test_class.var_name: hostDao
test_class.declarator: niciraNvpDao = mock(NiciraNvpDao.class)
test_class.original_string: NiciraNvpDao niciraNvpDao = mock(NiciraNvpDao.class);
test_class.type: NiciraNvpDao
test_class.var_name: niciraNvpDao
test_class.declarator: niciraNvpRouterMappingDao = mock(NiciraNvpRouterMappingDao.class)
test_class.original_string: NiciraNvpRouterMappingDao niciraNvpRouterMappingDao = mock(NiciraNvpRouterMappingDao.class);
test_class.type: NiciraNvpRouterMappingDao
test_class.var_name: niciraNvpRouterMappingDao
test_class.file: cosmic-core/server/src/test/java/com/cloud/network/element/NiciraNvpElementTest.java
test_class.identifier: NiciraNvpElementTest
test_case.body: @Test
      public void implementTest() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
          final Network network = mock(Network.class);
          when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.Lswitch);
          when(network.getId()).thenReturn(NETWORK_ID);
  
          final NetworkOffering offering = mock(NetworkOffering.class);
          when(offering.getId()).thenReturn(NETWORK_ID);
          when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
          when(offering.getGuestType()).thenReturn(GuestType.Isolated);
  
          mock(DeployDestination.class);
  
          final Domain dom = mock(Domain.class);
          when(dom.getName()).thenReturn("domain");
          final Account acc = mock(Account.class);
          when(acc.getAccountName()).thenReturn("accountname");
          final ReservationContext context = mock(ReservationContext.class);
          when(context.getDomain()).thenReturn(dom);
          when(context.getAccount()).thenReturn(acc);
      }
test_case.class_method_signature: NiciraNvpElementTest.implementTest()
test_case.full_signature: @Test public void implementTest()
test_case.identifier: implementTest
test_case.invocations: mock thenReturn when getBroadcastDomainType thenReturn when getId mock thenReturn when getId thenReturn when getTrafficType thenReturn when getGuestType mock mock thenReturn when getName mock thenReturn when getAccountName mock thenReturn when getDomain thenReturn when getAccount
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void implementTest()
focal_class.declarator: MAX_PORT = 65535
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_PORT = 65535;
focal_class.type: int
focal_class.var_name: MAX_PORT
focal_class.declarator: MIN_PORT = 0
focal_class.modifier: private static final
focal_class.original_string: private static final int MIN_PORT = 0;
focal_class.type: int
focal_class.var_name: MIN_PORT
focal_class.declarator: s_logger = LoggerFactory.getLogger(NiciraNvpElement.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger s_logger = LoggerFactory.getLogger(NiciraNvpElement.class);
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: capabilities = setCapabilities()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<Network.Service, Map<Network.Capability, String>> capabilities = setCapabilities();
focal_class.type: Map<Network.Service, Map<Network.Capability, String>>
focal_class.var_name: capabilities
focal_class.declarator: nicDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected NicDao nicDao;
focal_class.type: NicDao
focal_class.var_name: nicDao
focal_class.declarator: resourceMgr
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected ResourceManager resourceMgr;
focal_class.type: ResourceManager
focal_class.var_name: resourceMgr
focal_class.declarator: physicalNetworkDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected PhysicalNetworkDao physicalNetworkDao;
focal_class.type: PhysicalNetworkDao
focal_class.var_name: physicalNetworkDao
focal_class.declarator: physicalNetworkServiceProviderDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected PhysicalNetworkServiceProviderDao physicalNetworkServiceProviderDao;
focal_class.type: PhysicalNetworkServiceProviderDao
focal_class.var_name: physicalNetworkServiceProviderDao
focal_class.declarator: niciraNvpDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected NiciraNvpDao niciraNvpDao;
focal_class.type: NiciraNvpDao
focal_class.var_name: niciraNvpDao
focal_class.declarator: hostDetailsDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected HostDetailsDao hostDetailsDao;
focal_class.type: HostDetailsDao
focal_class.var_name: hostDetailsDao
focal_class.declarator: hostDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected HostDao hostDao;
focal_class.type: HostDao
focal_class.var_name: hostDao
focal_class.declarator: agentMgr
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected AgentManager agentMgr;
focal_class.type: AgentManager
focal_class.var_name: agentMgr
focal_class.declarator: niciraNvpNicMappingDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected NiciraNvpNicMappingDao niciraNvpNicMappingDao;
focal_class.type: NiciraNvpNicMappingDao
focal_class.var_name: niciraNvpNicMappingDao
focal_class.declarator: niciraNvpRouterMappingDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected NiciraNvpRouterMappingDao niciraNvpRouterMappingDao;
focal_class.type: NiciraNvpRouterMappingDao
focal_class.var_name: niciraNvpRouterMappingDao
focal_class.declarator: networkDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected NetworkDao networkDao;
focal_class.type: NetworkDao
focal_class.var_name: networkDao
focal_class.declarator: networkManager
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected NetworkOrchestrationService networkManager;
focal_class.type: NetworkOrchestrationService
focal_class.var_name: networkManager
focal_class.declarator: networkModel
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected NetworkModel networkModel;
focal_class.type: NetworkModel
focal_class.var_name: networkModel
focal_class.declarator: configMgr
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected ConfigurationManager configMgr;
focal_class.type: ConfigurationManager
focal_class.var_name: configMgr
focal_class.declarator: ntwkSrvcDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected NetworkServiceMapDao ntwkSrvcDao;
focal_class.type: NetworkServiceMapDao
focal_class.var_name: ntwkSrvcDao
focal_class.declarator: vlanDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected VlanDao vlanDao;
focal_class.type: VlanDao
focal_class.var_name: vlanDao
focal_class.declarator: ipAddrMgr
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected IpAddressManager ipAddrMgr;
focal_class.type: IpAddressManager
focal_class.var_name: ipAddrMgr
focal_class.declarator: guestOSDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected GuestOSDao guestOSDao;
focal_class.type: GuestOSDao
focal_class.var_name: guestOSDao
focal_class.file: cosmic-core/server/src/main/java/com/cloud/network/element/NiciraNvpElement.java
focal_class.identifier: NiciraNvpElement
focal_class.interfaces: implements ConnectivityProvider, SourceNatServiceProvider, PortForwardingServiceProvider, StaticNatServiceProvider,
          NiciraNvpElementService, ResourceStateAdapter, IpDeployer
focal_class.class_method_signature: NiciraNvpElement.setCapabilities()
focal_class.full_signature: private static Map<Network.Service, Map<Network.Capability, String>> setCapabilities()
focal_class.identifier: setCapabilities
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: Map<Network.Service, Map<Network.Capability, String>>
focal_class.signature: Map<Network.Service, Map<Network.Capability, String>> setCapabilities()
focal_class.class_method_signature: NiciraNvpElement.getCapabilities()
focal_class.full_signature: @Override public Map<Network.Service, Map<Network.Capability, String>> getCapabilities()
focal_class.identifier: getCapabilities
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<Network.Service, Map<Network.Capability, String>>
focal_class.signature: Map<Network.Service, Map<Network.Capability, String>> getCapabilities()
focal_class.class_method_signature: NiciraNvpElement.getProvider()
focal_class.full_signature: @Override public Network.Provider getProvider()
focal_class.identifier: getProvider
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Network.Provider
focal_class.signature: Network.Provider getProvider()
focal_class.class_method_signature: NiciraNvpElement.implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.full_signature: @Override public boolean implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.identifier: implement
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.class_method_signature: NiciraNvpElement.canHandle(final Network network, final Network.Service service)
focal_class.full_signature: protected boolean canHandle(final Network network, final Network.Service service)
focal_class.identifier: canHandle
focal_class.modifiers: protected
focal_class.parameters: (final Network network, final Network.Service service)
focal_class.return: boolean
focal_class.signature: boolean canHandle(final Network network, final Network.Service service)
focal_class.class_method_signature: NiciraNvpElement.prepare(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.full_signature: @Override public boolean prepare(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.identifier: prepare
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final NicProfile nic, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean prepare(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.class_method_signature: NiciraNvpElement.release(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final ReservationContext context)
focal_class.full_signature: @Override public boolean release(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final ReservationContext context)
focal_class.identifier: release
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final NicProfile nic, final VirtualMachineProfile vm, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean release(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final ReservationContext context)
focal_class.class_method_signature: NiciraNvpElement.shutdown(final Network network, final ReservationContext context, final boolean cleanup)
focal_class.full_signature: @Override public boolean shutdown(final Network network, final ReservationContext context, final boolean cleanup)
focal_class.identifier: shutdown
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final ReservationContext context, final boolean cleanup)
focal_class.return: boolean
focal_class.signature: boolean shutdown(final Network network, final ReservationContext context, final boolean cleanup)
focal_class.class_method_signature: NiciraNvpElement.destroy(final Network network, final ReservationContext context)
focal_class.full_signature: @Override public boolean destroy(final Network network, final ReservationContext context)
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean destroy(final Network network, final ReservationContext context)
focal_class.class_method_signature: NiciraNvpElement.isReady(final PhysicalNetworkServiceProvider provider)
focal_class.full_signature: @Override public boolean isReady(final PhysicalNetworkServiceProvider provider)
focal_class.identifier: isReady
focal_class.modifiers: @Override public
focal_class.parameters: (final PhysicalNetworkServiceProvider provider)
focal_class.return: boolean
focal_class.signature: boolean isReady(final PhysicalNetworkServiceProvider provider)
focal_class.class_method_signature: NiciraNvpElement.shutdownProviderInstances(final PhysicalNetworkServiceProvider provider, final ReservationContext context)
focal_class.full_signature: @Override public boolean shutdownProviderInstances(final PhysicalNetworkServiceProvider provider, final ReservationContext context)
focal_class.identifier: shutdownProviderInstances
focal_class.modifiers: @Override public
focal_class.parameters: (final PhysicalNetworkServiceProvider provider, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean shutdownProviderInstances(final PhysicalNetworkServiceProvider provider, final ReservationContext context)
focal_class.class_method_signature: NiciraNvpElement.canEnableIndividualServices()
focal_class.full_signature: @Override public boolean canEnableIndividualServices()
focal_class.identifier: canEnableIndividualServices
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean canEnableIndividualServices()
focal_class.class_method_signature: NiciraNvpElement.verifyServicesCombination(final Set<Network.Service> services)
focal_class.full_signature: @Override public boolean verifyServicesCombination(final Set<Network.Service> services)
focal_class.identifier: verifyServicesCombination
focal_class.modifiers: @Override public
focal_class.parameters: (final Set<Network.Service> services)
focal_class.return: boolean
focal_class.signature: boolean verifyServicesCombination(final Set<Network.Service> services)
focal_class.class_method_signature: NiciraNvpElement.configure(final String name, final Map<String, Object> params)
focal_class.full_signature: @Override public boolean configure(final String name, final Map<String, Object> params)
focal_class.identifier: configure
focal_class.modifiers: @Override public
focal_class.parameters: (final String name, final Map<String, Object> params)
focal_class.return: boolean
focal_class.signature: boolean configure(final String name, final Map<String, Object> params)
focal_class.class_method_signature: NiciraNvpElement.getCommands()
focal_class.full_signature: @Override public List<Class<?>> getCommands()
focal_class.identifier: getCommands
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Class<?>>
focal_class.signature: List<Class<?>> getCommands()
focal_class.class_method_signature: NiciraNvpElement.addNiciraNvpDevice(final AddNiciraNvpDeviceCmd cmd)
focal_class.full_signature: @Override @DB public NiciraNvpDeviceVO addNiciraNvpDevice(final AddNiciraNvpDeviceCmd cmd)
focal_class.identifier: addNiciraNvpDevice
focal_class.modifiers: @Override @DB public
focal_class.parameters: (final AddNiciraNvpDeviceCmd cmd)
focal_class.return: NiciraNvpDeviceVO
focal_class.signature: NiciraNvpDeviceVO addNiciraNvpDevice(final AddNiciraNvpDeviceCmd cmd)
focal_class.class_method_signature: NiciraNvpElement.createNiciraNvpDeviceResponse(final NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.full_signature: @Override public NiciraNvpDeviceResponse createNiciraNvpDeviceResponse(final NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.identifier: createNiciraNvpDeviceResponse
focal_class.modifiers: @Override public
focal_class.parameters: (final NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.return: NiciraNvpDeviceResponse
focal_class.signature: NiciraNvpDeviceResponse createNiciraNvpDeviceResponse(final NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.class_method_signature: NiciraNvpElement.deleteNiciraNvpDevice(final DeleteNiciraNvpDeviceCmd cmd)
focal_class.full_signature: @Override public boolean deleteNiciraNvpDevice(final DeleteNiciraNvpDeviceCmd cmd)
focal_class.identifier: deleteNiciraNvpDevice
focal_class.modifiers: @Override public
focal_class.parameters: (final DeleteNiciraNvpDeviceCmd cmd)
focal_class.return: boolean
focal_class.signature: boolean deleteNiciraNvpDevice(final DeleteNiciraNvpDeviceCmd cmd)
focal_class.class_method_signature: NiciraNvpElement.listNiciraNvpDeviceNetworks(final ListNiciraNvpDeviceNetworksCmd cmd)
focal_class.full_signature: @Override public List<? extends Network> listNiciraNvpDeviceNetworks(final ListNiciraNvpDeviceNetworksCmd cmd)
focal_class.identifier: listNiciraNvpDeviceNetworks
focal_class.modifiers: @Override public
focal_class.parameters: (final ListNiciraNvpDeviceNetworksCmd cmd)
focal_class.return: List<? extends Network>
focal_class.signature: List<? extends Network> listNiciraNvpDeviceNetworks(final ListNiciraNvpDeviceNetworksCmd cmd)
focal_class.class_method_signature: NiciraNvpElement.listNiciraNvpDevices(final ListNiciraNvpDevicesCmd cmd)
focal_class.full_signature: @Override public List<NiciraNvpDeviceVO> listNiciraNvpDevices(final ListNiciraNvpDevicesCmd cmd)
focal_class.identifier: listNiciraNvpDevices
focal_class.modifiers: @Override public
focal_class.parameters: (final ListNiciraNvpDevicesCmd cmd)
focal_class.return: List<NiciraNvpDeviceVO>
focal_class.signature: List<NiciraNvpDeviceVO> listNiciraNvpDevices(final ListNiciraNvpDevicesCmd cmd)
focal_class.class_method_signature: NiciraNvpElement.createHostVOForConnectedAgent(final HostVO host, final StartupCommand[] cmd)
focal_class.full_signature: @Override public HostVO createHostVOForConnectedAgent(final HostVO host, final StartupCommand[] cmd)
focal_class.identifier: createHostVOForConnectedAgent
focal_class.modifiers: @Override public
focal_class.parameters: (final HostVO host, final StartupCommand[] cmd)
focal_class.return: HostVO
focal_class.signature: HostVO createHostVOForConnectedAgent(final HostVO host, final StartupCommand[] cmd)
focal_class.class_method_signature: NiciraNvpElement.createHostVOForDirectConnectAgent(final HostVO host, final StartupCommand[] startup, final ServerResource resource, final Map<String, String> details, final
      List<String> hostTags)
focal_class.full_signature: @Override public HostVO createHostVOForDirectConnectAgent(final HostVO host, final StartupCommand[] startup, final ServerResource resource, final Map<String, String> details, final
      List<String> hostTags)
focal_class.identifier: createHostVOForDirectConnectAgent
focal_class.modifiers: @Override public
focal_class.parameters: (final HostVO host, final StartupCommand[] startup, final ServerResource resource, final Map<String, String> details, final
      List<String> hostTags)
focal_class.return: HostVO
focal_class.signature: HostVO createHostVOForDirectConnectAgent(final HostVO host, final StartupCommand[] startup, final ServerResource resource, final Map<String, String> details, final
      List<String> hostTags)
focal_class.class_method_signature: NiciraNvpElement.deleteHost(final HostVO host, final boolean isForced, final boolean isForceDeleteStorage)
focal_class.full_signature: @Override public DeleteHostAnswer deleteHost(final HostVO host, final boolean isForced, final boolean isForceDeleteStorage)
focal_class.identifier: deleteHost
focal_class.modifiers: @Override public
focal_class.parameters: (final HostVO host, final boolean isForced, final boolean isForceDeleteStorage)
focal_class.return: DeleteHostAnswer
focal_class.signature: DeleteHostAnswer deleteHost(final HostVO host, final boolean isForced, final boolean isForceDeleteStorage)
focal_class.class_method_signature: NiciraNvpElement.getIpDeployer(final Network network)
focal_class.full_signature: @Override public IpDeployer getIpDeployer(final Network network)
focal_class.identifier: getIpDeployer
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network)
focal_class.return: IpDeployer
focal_class.signature: IpDeployer getIpDeployer(final Network network)
focal_class.class_method_signature: NiciraNvpElement.applyIps(final Network network, final List<? extends PublicIpAddress> ipAddress, final Set<Network.Service> services)
focal_class.full_signature: @Override public boolean applyIps(final Network network, final List<? extends PublicIpAddress> ipAddress, final Set<Network.Service> services)
focal_class.identifier: applyIps
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final List<? extends PublicIpAddress> ipAddress, final Set<Network.Service> services)
focal_class.return: boolean
focal_class.signature: boolean applyIps(final Network network, final List<? extends PublicIpAddress> ipAddress, final Set<Network.Service> services)
focal_class.class_method_signature: NiciraNvpElement.applyStaticNats(final Network network, final List<? extends StaticNat> rules)
focal_class.full_signature: @Override public boolean applyStaticNats(final Network network, final List<? extends StaticNat> rules)
focal_class.identifier: applyStaticNats
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final List<? extends StaticNat> rules)
focal_class.return: boolean
focal_class.signature: boolean applyStaticNats(final Network network, final List<? extends StaticNat> rules)
focal_class.class_method_signature: NiciraNvpElement.applyPFRules(final Network network, final List<PortForwardingRule> rules)
focal_class.full_signature: @Override public boolean applyPFRules(final Network network, final List<PortForwardingRule> rules)
focal_class.identifier: applyPFRules
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final List<PortForwardingRule> rules)
focal_class.return: boolean
focal_class.signature: boolean applyPFRules(final Network network, final List<PortForwardingRule> rules)
focal_class.superclass: extends AdapterBase
focal_method.body: @Override
      public boolean implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context) throws
              ConcurrentOperationException,
              ResourceUnavailableException, InsufficientCapacityException {
          s_logger.debug("entering NiciraNvpElement implement function for network " + network.getDisplayText() + " (state " + network.getState() + ")");
  
          if (!canHandle(network, Network.Service.Connectivity)) {
              return false;
          }
  
          if (network.getBroadcastUri() == null) {
              s_logger.error("Nic has no broadcast Uri with the LSwitch Uuid");
              return false;
          }
  
          final List<NiciraNvpDeviceVO> devices = this.niciraNvpDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
          if (devices.isEmpty()) {
              s_logger.error("No NiciraNvp Controller on physical network " + network.getPhysicalNetworkId());
              return false;
          }
          final NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
          final HostVO niciraNvpHost = this.hostDao.findById(niciraNvpDevice.getHostId());
          this.hostDao.loadDetails(niciraNvpHost);
  
          final Account owner = context.getAccount();
  
          /*
           * TODO Shouldn't we lock the network as we might need to do
           * multiple operations that should be done only once.
           */
  
          // Implement SourceNat immediately as we have al the info already
          if (this.networkModel.isProviderSupportServiceInNetwork(network.getId(), Network.Service.SourceNat, Network.Provider.NiciraNvp)) {
              s_logger.debug("Apparently we are supposed to provide SourceNat on this network");
  
              final PublicIp sourceNatIp = this.ipAddrMgr.assignSourceNatIpAddressToGuestNetwork(owner, network);
              final String publicCidr = sourceNatIp.getAddress().addr() + "/" + NetUtils.getCidrSize(sourceNatIp.getVlanNetmask());
              final String internalCidr = network.getGateway() + "/" + network.getCidr().split("/")[1];
              // assuming a vlan:
              String vtag = sourceNatIp.getVlanTag();
              BroadcastDomainType tiep = null;
              try {
                  tiep = BroadcastDomainType.getTypeOf(vtag);
              } catch (final URISyntaxException use) {
                  throw new CloudRuntimeException("vlantag for sourceNatIp is not valid: " + vtag, use);
              }
              if (tiep == BroadcastDomainType.Vlan) {
                  vtag = BroadcastDomainType.Vlan.getValueFrom(BroadcastDomainType.fromString(vtag));
              } else if (!(tiep == BroadcastDomainType.UnDecided || tiep == BroadcastDomainType.Native)) {
                  throw new CloudRuntimeException("only vlans are supported for sourceNatIp, at this moment: " + vtag);
              }
              final long vlanid = Vlan.UNTAGGED.equals(vtag) ? 0 : Long.parseLong(vtag);
  
              final CreateLogicalRouterCommand cmd =
                      new CreateLogicalRouterCommand(niciraNvpHost.getDetail("l3gatewayserviceuuid"), vlanid, BroadcastDomainType.getValue(network.getBroadcastUri()),
                              "router-" + network.getDisplayText(), publicCidr, sourceNatIp.getGateway(), internalCidr, context.getDomain().getName() + "-" +
                              context.getAccount().getAccountName());
              final CreateLogicalRouterAnswer answer = (CreateLogicalRouterAnswer) this.agentMgr.easySend(niciraNvpHost.getId(), cmd);
              if (answer.getResult() == false) {
                  s_logger.error("Failed to create Logical Router for network " + network.getDisplayText());
                  return false;
              }
  
              // Store the uuid so we can easily find it during cleanup
              final NiciraNvpRouterMappingVO routermapping = new NiciraNvpRouterMappingVO(answer.getLogicalRouterUuid(), network.getId());
              this.niciraNvpRouterMappingDao.persist(routermapping);
          }
  
          return true;
      }
focal_method.class_method_signature: NiciraNvpElement.implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_method.full_signature: @Override public boolean implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_method.identifier: implement
focal_method.invocations: debug getDisplayText getState canHandle getBroadcastUri error listByPhysicalNetwork getPhysicalNetworkId isEmpty error getPhysicalNetworkId get findById getHostId loadDetails getAccount isProviderSupportServiceInNetwork getId debug assignSourceNatIpAddressToGuestNetwork addr getAddress getCidrSize getVlanNetmask getGateway split getCidr getVlanTag getTypeOf getValueFrom fromString equals parseLong getDetail getValue getBroadcastUri getDisplayText getGateway getName getDomain getAccountName getAccount easySend getId getResult error getDisplayText getLogicalRouterUuid getId persist
focal_method.modifiers: @Override public
focal_method.parameters: (final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_method.return: boolean
focal_method.signature: boolean implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)