Examples of PhysicalNetworkVO


Examples of com.cloud.network.dao.PhysicalNetworkVO

   
    @Override
    public Network design(NetworkOffering offering, DeploymentPlan plan,
            Network userSpecified, Account owner) {
        // Check of the isolation type of the related physical network is STT
        PhysicalNetworkVO physnet = _physicalNetworkDao.findById(plan.getPhysicalNetworkId());
        DataCenter dc = _dcDao.findById(plan.getDataCenterId());
        if (!canHandle(offering,dc.getNetworkType(),physnet)) {
            s_logger.debug("Refusing to design this network");
            return null;
        }

        List<NiciraNvpDeviceVO> devices = _niciraNvpDao.listByPhysicalNetwork(physnet.getId());
        if (devices.isEmpty()) {
            s_logger.error("No NiciraNvp Controller on physical network " + physnet.getName());
            return null;
        }
        s_logger.debug("Nicira Nvp " + devices.get(0).getUuid() + " found on physical network " + physnet.getId());

        s_logger.debug("Physical isolation type is STT, asking GuestNetworkGuru to design this network");       
        NetworkVO networkObject = (NetworkVO) super.design(offering, plan, userSpecified, owner);
        if (networkObject == null) {
            return null;
View Full Code Here

Examples of com.cloud.network.dao.PhysicalNetworkVO

    NetworkOffering offering = mock(NetworkOffering.class);
    when(offering.getId()).thenReturn(42L);
    when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
    when(offering.getGuestType()).thenReturn(GuestType.Isolated);
 
    PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "STT" }));
    when(physnet.getId()).thenReturn(42L);
   
    when(nosd.areServicesSupportedByNetworkOffering(42L, Service.Connectivity)).thenReturn(true);
   
    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
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "VLAN" }));
    assertFalse(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);
   
  }
View Full Code Here

Examples of com.cloud.network.dao.PhysicalNetworkVO

  }
 
 
  @Test
  public void testDesign() {
    PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
    when(physnetdao.findById((Long) any())).thenReturn(physnet);
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "STT" }));
    when(physnet.getId()).thenReturn(42L);
   
    NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
    when(nvpdao.listByPhysicalNetwork(42L)).thenReturn(Arrays.asList(new NiciraNvpDeviceVO[] { device }));
    when(device.getId()).thenReturn(1L);
   
View Full Code Here

Examples of com.cloud.network.dao.PhysicalNetworkVO

    assertTrue(designednetwork.getBroadcastDomainType() == BroadcastDomainType.Lswitch);   
  }
 
  @Test
  public void testDesignNoElementOnPhysicalNetwork() {
    PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
    when(physnetdao.findById((Long) any())).thenReturn(physnet);
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "STT" }));
    when(physnet.getId()).thenReturn(42L);
   
    NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
    when(nvpdao.listByPhysicalNetwork(42L)).thenReturn(Collections.<NiciraNvpDeviceVO> emptyList());
   
    NetworkOffering offering = mock(NetworkOffering.class);
View Full Code Here

Examples of com.cloud.network.dao.PhysicalNetworkVO

    assertTrue(designednetwork == null)
  }
 
  @Test
  public void testDesignNoIsolationMethodSTT() {
    PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
    when(physnetdao.findById((Long) any())).thenReturn(physnet);
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "VLAN" }));
    when(physnet.getId()).thenReturn(42L);
   
    NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
    when(nvpdao.listByPhysicalNetwork(42L)).thenReturn(Collections.<NiciraNvpDeviceVO> emptyList());
   
    NetworkOffering offering = mock(NetworkOffering.class);
View Full Code Here

Examples of com.cloud.network.dao.PhysicalNetworkVO

    assertTrue(designednetwork == null);     
  }
 
  @Test
  public void testDesignNoConnectivityInOffering() {
    PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
    when(physnetdao.findById((Long) any())).thenReturn(physnet);
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "STT" }));
    when(physnet.getId()).thenReturn(42L);
   
    NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
    when(nvpdao.listByPhysicalNetwork(42L)).thenReturn(Arrays.asList(new NiciraNvpDeviceVO[] { device }));
    when(device.getId()).thenReturn(1L);
   
View Full Code Here

Examples of com.cloud.network.dao.PhysicalNetworkVO

    assertTrue(designednetwork == null);   
  }
 
  @Test
  public void testImplement() throws InsufficientVirtualNetworkCapcityException {
    PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
    when(physnetdao.findById((Long) any())).thenReturn(physnet);
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "STT" }));
    when(physnet.getId()).thenReturn(42L);
   
    NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
    when(nvpdao.listByPhysicalNetwork(42L)).thenReturn(Arrays.asList(new NiciraNvpDeviceVO[] { device }));
    when(device.getId()).thenReturn(1L);
   
View Full Code Here

Examples of com.cloud.network.dao.PhysicalNetworkVO

    verify(agentmgr, times(1)).easySend(eq(42L), (Command)any());
  }

  @Test
  public void testImplementWithCidr() throws InsufficientVirtualNetworkCapcityException {
    PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
    when(physnetdao.findById((Long) any())).thenReturn(physnet);
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "STT" }));
    when(physnet.getId()).thenReturn(42L);
   
    NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
    when(nvpdao.listByPhysicalNetwork(42L)).thenReturn(Arrays.asList(new NiciraNvpDeviceVO[] { device }));
    when(device.getId()).thenReturn(1L);
   
View Full Code Here

Examples of com.cloud.network.dao.PhysicalNetworkVO

    verify(agentmgr, times(1)).easySend(eq(42L), (Command)any());
  }
 
  @Test
  public void testImplementURIException() throws InsufficientVirtualNetworkCapcityException {
    PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
    when(physnetdao.findById((Long) any())).thenReturn(physnet);
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "STT" }));
    when(physnet.getId()).thenReturn(42L);
   
    NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
    when(nvpdao.listByPhysicalNetwork(42L)).thenReturn(Arrays.asList(new NiciraNvpDeviceVO[] { device }));
    when(device.getId()).thenReturn(1L);
   
View Full Code Here

Examples of com.cloud.network.dao.PhysicalNetworkVO

    @Override
    public Network design(NetworkOffering offering, DeploymentPlan plan,
                          Network userSpecified, Account owner) {
        s_logger.debug("design called");
        // Check if the isolation type of the related physical network is MIDO
        PhysicalNetworkVO physnet = _physicalNetworkDao.findById(plan.getPhysicalNetworkId());
        if (physnet == null || physnet.getIsolationMethods() == null || !physnet.getIsolationMethods().contains("MIDO")) {
            s_logger.debug("Refusing to design this network, the physical isolation type is not MIDO");
            return null;
        }

        s_logger.debug("Physical isolation type is MIDO, asking GuestNetworkGuru to design this network");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.