Examples of FindLogicalSwitchPortCommand


Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

        HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId());

        NiciraNvpNicMappingVO existingNicMap = _niciraNvpNicMappingDao
                .findByNicUuid(nicVO.getUuid());
        if (existingNicMap != null) {
            FindLogicalSwitchPortCommand findCmd = new FindLogicalSwitchPortCommand(
                    existingNicMap.getLogicalSwitchUuid(),
                    existingNicMap.getLogicalSwitchPortUuid());
            FindLogicalSwitchPortAnswer answer = (FindLogicalSwitchPortAnswer) _agentMgr
                    .easySend(niciraNvpHost.getId(), findCmd);
View Full Code Here

Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

    @SuppressWarnings("unchecked")
    NiciraNvpList<LogicalSwitchPort> lspl = (NiciraNvpList<LogicalSwitchPort>)mock(NiciraNvpList.class);
    when(lspl.getResultCount()).thenReturn(1);
    when(_nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenReturn(lspl);
   
    FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer) _resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
    assertTrue(flspa.getResult());
  }
View Full Code Here

Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

    @SuppressWarnings("unchecked")
    NiciraNvpList<LogicalSwitchPort> lspl = (NiciraNvpList<LogicalSwitchPort>)mock(NiciraNvpList.class);
    when(lspl.getResultCount()).thenReturn(0);
    when(_nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenReturn(lspl);
   
    FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer) _resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
    assertFalse(flspa.getResult());
  }
View Full Code Here

Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

  public void testFindLogicalSwitchPortApiException() throws ConfigurationException, NiciraNvpApiException {
    _resource.configure("NiciraNvpResource", _parameters);
   
    when(_nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenThrow(new NiciraNvpApiException());
   
    FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer) _resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
    assertFalse(flspa.getResult());
  }
View Full Code Here

Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

        final
        NiciraNvpList<LogicalSwitchPort> lspl = mock(NiciraNvpList.class);
        when(lspl.getResultCount()).thenReturn(1);
        when(nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenReturn(lspl);

        final FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer)resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
        assertTrue(flspa.getResult());
    }
View Full Code Here

Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

        final
        NiciraNvpList<LogicalSwitchPort> lspl = mock(NiciraNvpList.class);
        when(lspl.getResultCount()).thenReturn(0);
        when(nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenReturn(lspl);

        final FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer)resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
        assertFalse(flspa.getResult());
    }
View Full Code Here

Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

    public void testFindLogicalSwitchPortApiException() throws ConfigurationException, NiciraNvpApiException {
        resource.configure("NiciraNvpResource", parameters);

        when(nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenThrow(new NiciraNvpApiException());

        final FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer)resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
        assertFalse(flspa.getResult());
    }
View Full Code Here

Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

        NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
        HostVO niciraNvpHost = hostDao.findById(niciraNvpDevice.getHostId());

        NiciraNvpNicMappingVO existingNicMap = niciraNvpNicMappingDao.findByNicUuid(nicVO.getUuid());
        if (existingNicMap != null) {
            FindLogicalSwitchPortCommand findCmd = new FindLogicalSwitchPortCommand(existingNicMap.getLogicalSwitchUuid(), existingNicMap.getLogicalSwitchPortUuid());
            FindLogicalSwitchPortAnswer answer = (FindLogicalSwitchPortAnswer)agentMgr.easySend(niciraNvpHost.getId(), findCmd);

            if (answer.getResult()) {
                s_logger.warn("Existing Logical Switchport found for nic " + nic.getName() + " with uuid " + existingNicMap.getLogicalSwitchPortUuid());
                UpdateLogicalSwitchPortCommand cmd =
View Full Code Here

Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

        NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
        HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId());

        NiciraNvpNicMappingVO existingNicMap = _niciraNvpNicMappingDao.findByNicUuid(nicVO.getUuid());
        if (existingNicMap != null) {
            FindLogicalSwitchPortCommand findCmd = new FindLogicalSwitchPortCommand(existingNicMap.getLogicalSwitchUuid(),
                existingNicMap.getLogicalSwitchPortUuid());
            FindLogicalSwitchPortAnswer answer = (FindLogicalSwitchPortAnswer) _agentMgr.easySend(niciraNvpHost.getId(), findCmd);
           
            if (answer.getResult()) {
              s_logger.warn("Existing Logical Switchport found for nic " + nic.getName() + " with uuid " + existingNicMap.getLogicalSwitchPortUuid());
View Full Code Here

Examples of com.cloud.agent.api.FindLogicalSwitchPortCommand

        @SuppressWarnings("unchecked")
        NiciraNvpList<LogicalSwitchPort> lspl = mock(NiciraNvpList.class);
        when(lspl.getResultCount()).thenReturn(1);
        when(_nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenReturn(lspl);

        FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer) _resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
        assertTrue(flspa.getResult());
    }
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.