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: physnetdao = mock(PhysicalNetworkDao.class)
test_class.original_string: PhysicalNetworkDao physnetdao = mock(PhysicalNetworkDao.class);
test_class.type: PhysicalNetworkDao
test_class.var_name: physnetdao
test_class.declarator: nvpdao = mock(NiciraNvpDao.class)
test_class.original_string: NiciraNvpDao nvpdao = mock(NiciraNvpDao.class);
test_class.type: NiciraNvpDao
test_class.var_name: nvpdao
test_class.declarator: dcdao = mock(DataCenterDao.class)
test_class.original_string: DataCenterDao dcdao = mock(DataCenterDao.class);
test_class.type: DataCenterDao
test_class.var_name: dcdao
test_class.declarator: nosd = mock(NetworkOfferingServiceMapDao.class)
test_class.original_string: NetworkOfferingServiceMapDao nosd = mock(NetworkOfferingServiceMapDao.class);
test_class.type: NetworkOfferingServiceMapDao
test_class.var_name: nosd
test_class.declarator: agentmgr = mock(AgentManager.class)
test_class.original_string: AgentManager agentmgr = mock(AgentManager.class);
test_class.type: AgentManager
test_class.var_name: agentmgr
test_class.declarator: netmgr = mock(NetworkOrchestrationService.class)
test_class.original_string: NetworkOrchestrationService netmgr = mock(NetworkOrchestrationService.class);
test_class.type: NetworkOrchestrationService
test_class.var_name: netmgr
test_class.declarator: netmodel = mock(NetworkModel.class)
test_class.original_string: NetworkModel netmodel = mock(NetworkModel.class);
test_class.type: NetworkModel
test_class.var_name: netmodel
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: netdao = mock(NetworkDao.class)
test_class.original_string: NetworkDao netdao = mock(NetworkDao.class);
test_class.type: NetworkDao
test_class.var_name: netdao
test_class.declarator: guru
test_class.original_string: NiciraNvpGuestNetworkGuru guru;
test_class.type: NiciraNvpGuestNetworkGuru
test_class.var_name: guru
test_class.file: plugins/network-elements/nicira-nvp/src/test/java/com/cloud/network/guru/NiciraNvpGuestNetworkGuruTest.java
test_class.identifier: NiciraNvpGuestNetworkGuruTest
test_case.body: @Test
      public void testCanHandle() {
          final NetworkOffering offering = mock(NetworkOffering.class);
          when(offering.getId()).thenReturn(NETWORK_ID);
          when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
          when(offering.getGuestType()).thenReturn(GuestType.Isolated);
  
          final PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
          when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT", "VXLAN"}));
          when(physnet.getId()).thenReturn(NETWORK_ID);
  
          when(nosd.areServicesSupportedByNetworkOffering(NETWORK_ID, Service.Connectivity)).thenReturn(true);
  
          assertTrue(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);
  
          // Supported: IsolationMethod == VXLAN
          when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"VXLAN"}));
          assertTrue(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);
  
          // Not supported TrafficType != Guest
          when(offering.getTrafficType()).thenReturn(TrafficType.Management);
          assertFalse(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);
  
          // Not supported: GuestType Shared
          when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
          when(offering.getGuestType()).thenReturn(GuestType.Shared);
          assertFalse(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);
  
          // Not supported: Basic networking
          when(offering.getGuestType()).thenReturn(GuestType.Isolated);
          assertFalse(guru.canHandle(offering, NetworkType.Basic, physnet) == true);
  
          // Not supported: IsolationMethod != STT, VXLAN
          when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"VLAN"}));
          assertFalse(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);
  
      }
test_case.class_method_signature: NiciraNvpGuestNetworkGuruTest.testCanHandle()
test_case.full_signature: @Test public void testCanHandle()
test_case.identifier: testCanHandle
test_case.invocations: mock thenReturn when getId thenReturn when getTrafficType thenReturn when getGuestType mock thenReturn when getIsolationMethods asList thenReturn when getId thenReturn when areServicesSupportedByNetworkOffering assertTrue canHandle thenReturn when getIsolationMethods asList assertTrue canHandle thenReturn when getTrafficType assertFalse canHandle thenReturn when getTrafficType thenReturn when getGuestType assertFalse canHandle thenReturn when getGuestType assertFalse canHandle thenReturn when getIsolationMethods asList assertFalse canHandle
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCanHandle()
focal_class.declarator: MAX_NAME_LENGTH = 40
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_NAME_LENGTH = 40;
focal_class.type: int
focal_class.var_name: MAX_NAME_LENGTH
focal_class.declarator: s_logger = LoggerFactory.getLogger(NiciraNvpGuestNetworkGuru.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger s_logger = LoggerFactory.getLogger(NiciraNvpGuestNetworkGuru.class);
focal_class.type: Logger
focal_class.var_name: s_logger
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: 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: zoneDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected DataCenterDao zoneDao;
focal_class.type: DataCenterDao
focal_class.var_name: zoneDao
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: accountDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected AccountDao accountDao;
focal_class.type: AccountDao
focal_class.var_name: accountDao
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: 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: 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: 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: 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: ntwkOfferingSrvcDao
focal_class.modifier: @Inject
      protected
focal_class.original_string: @Inject
      protected NetworkOfferingServiceMapDao ntwkOfferingSrvcDao;
focal_class.type: NetworkOfferingServiceMapDao
focal_class.var_name: ntwkOfferingSrvcDao
focal_class.file: plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java
focal_class.identifier: NiciraNvpGuestNetworkGuru
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.NiciraNvpGuestNetworkGuru()
focal_class.full_signature: public  NiciraNvpGuestNetworkGuru()
focal_class.identifier: NiciraNvpGuestNetworkGuru
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  NiciraNvpGuestNetworkGuru()
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.canHandle(final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork)
focal_class.full_signature: @Override protected boolean canHandle(final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork)
focal_class.identifier: canHandle
focal_class.modifiers: @Override protected
focal_class.parameters: (final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork)
focal_class.return: boolean
focal_class.signature: boolean canHandle(final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork)
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.design(final NetworkOffering offering, final DeploymentPlan plan, final Network userSpecified, final Account owner)
focal_class.full_signature: @Override public Network design(final NetworkOffering offering, final DeploymentPlan plan, final Network userSpecified, final Account owner)
focal_class.identifier: design
focal_class.modifiers: @Override public
focal_class.parameters: (final NetworkOffering offering, final DeploymentPlan plan, final Network userSpecified, final Account owner)
focal_class.return: Network
focal_class.signature: Network design(final NetworkOffering offering, final DeploymentPlan plan, final Network userSpecified, final Account owner)
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.checkThatLogicalSwitchExists(final Network userSpecified, final NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.full_signature: private void checkThatLogicalSwitchExists(final Network userSpecified, final NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.identifier: checkThatLogicalSwitchExists
focal_class.modifiers: private
focal_class.parameters: (final Network userSpecified, final NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.return: void
focal_class.signature: void checkThatLogicalSwitchExists(final Network userSpecified, final NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.lswitchExists(String lswitchUuid, NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.full_signature: private boolean lswitchExists(String lswitchUuid, NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.identifier: lswitchExists
focal_class.modifiers: private
focal_class.parameters: (String lswitchUuid, NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.return: boolean
focal_class.signature: boolean lswitchExists(String lswitchUuid, NiciraNvpDeviceVO niciraNvpDeviceVO)
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.full_signature: @Override public Network 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: Network
focal_class.signature: Network implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.reserve(final NicProfile nic, final Network network, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.full_signature: @Override public void reserve(final NicProfile nic, final Network network, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.identifier: reserve
focal_class.modifiers: @Override public
focal_class.parameters: (final NicProfile nic, final Network network, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.return: void
focal_class.signature: void reserve(final NicProfile nic, final Network network, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.release(final NicProfile nic, final VirtualMachineProfile vm, final String reservationId)
focal_class.full_signature: @Override public boolean release(final NicProfile nic, final VirtualMachineProfile vm, final String reservationId)
focal_class.identifier: release
focal_class.modifiers: @Override public
focal_class.parameters: (final NicProfile nic, final VirtualMachineProfile vm, final String reservationId)
focal_class.return: boolean
focal_class.signature: boolean release(final NicProfile nic, final VirtualMachineProfile vm, final String reservationId)
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.shutdown(final NetworkProfile profile, final NetworkOffering offering)
focal_class.full_signature: @Override public void shutdown(final NetworkProfile profile, final NetworkOffering offering)
focal_class.identifier: shutdown
focal_class.modifiers: @Override public
focal_class.parameters: (final NetworkProfile profile, final NetworkOffering offering)
focal_class.return: void
focal_class.signature: void shutdown(final NetworkProfile profile, final NetworkOffering offering)
focal_class.class_method_signature: NiciraNvpGuestNetworkGuru.trash(final Network network, final NetworkOffering offering)
focal_class.full_signature: @Override public boolean trash(final Network network, final NetworkOffering offering)
focal_class.identifier: trash
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final NetworkOffering offering)
focal_class.return: boolean
focal_class.signature: boolean trash(final Network network, final NetworkOffering offering)
focal_class.superclass: extends GuestNetworkGuru
focal_method.body: @Override
      protected boolean canHandle(final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork) {
          // This guru handles only Guest Isolated network that supports Source nat service
          if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) && offering.getGuestType() == Network.GuestType.Isolated
                  && isMyIsolationMethod(physicalNetwork) && ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.Connectivity)) {
              return true;
          } else {
  	    s_logger.debug("Cannot handle rquest. See GuestNetworkGuru message to check isolation methods. Details I have:\nNetwork type = " + networkType + "\nTraffic type = " + offering.getTrafficType() + "\nGuest type = " + offering.getGuestType());
              return false;
          }
      }
focal_method.class_method_signature: NiciraNvpGuestNetworkGuru.canHandle(final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork)
focal_method.full_signature: @Override protected boolean canHandle(final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork)
focal_method.identifier: canHandle
focal_method.invocations: isMyTrafficType getTrafficType getGuestType isMyIsolationMethod areServicesSupportedByNetworkOffering getId debug getTrafficType getGuestType
focal_method.modifiers: @Override protected
focal_method.parameters: (final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork)
focal_method.return: boolean
focal_method.signature: boolean canHandle(final NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork)