Package com.cloud.agent.api

Examples of com.cloud.agent.api.DeleteLogicalSwitchPortAnswer


    }
   
    private Answer executeRequest(DeleteLogicalSwitchPortCommand cmd, int numRetries) {
        try {
            _niciraNvpApi.deleteLogicalSwitchPort(cmd.getLogicalSwitchUuid(), cmd.getLogicalSwitchPortUuid());
            return new DeleteLogicalSwitchPortAnswer(cmd, true, "Logical switch port " + cmd.getLogicalSwitchPortUuid() + " deleted");
        } catch (NiciraNvpApiException e) {
          if (numRetries > 0) {
            return retry(cmd, --numRetries);
          }
          else {
            return new DeleteLogicalSwitchPortAnswer(cmd, e);
          }
        }
    }
View Full Code Here


        }

        DeleteLogicalSwitchPortCommand cmd = new DeleteLogicalSwitchPortCommand(
                nicMap.getLogicalSwitchUuid(),
                nicMap.getLogicalSwitchPortUuid());
        DeleteLogicalSwitchPortAnswer answer = (DeleteLogicalSwitchPortAnswer) _agentMgr
                .easySend(niciraNvpHost.getId(), cmd);

        if (answer == null || !answer.getResult()) {
            s_logger.error("DeleteLogicalSwitchPortCommand failed");
            return false;
        }

        _niciraNvpNicMappingDao.remove(nicMap.getId());
View Full Code Here

  @Test
  public void testDeleteLogicalSwitchPortException() throws ConfigurationException, NiciraNvpApiException {
    _resource.configure("NiciraNvpResource", _parameters);
   
    doThrow(new NiciraNvpApiException()).when(_nvpApi).deleteLogicalSwitchPort((String) any(), (String) any());
    DeleteLogicalSwitchPortAnswer dlspa = (DeleteLogicalSwitchPortAnswer) _resource.executeRequest(new DeleteLogicalSwitchPortCommand("aaaa","bbbb"));
    assertFalse(dlspa.getResult());
  }
View Full Code Here

    }

    private Answer executeRequest(final DeleteLogicalSwitchPortCommand cmd, int numRetries) {
        try {
            niciraNvpApi.deleteLogicalSwitchPort(cmd.getLogicalSwitchUuid(), cmd.getLogicalSwitchPortUuid());
            return new DeleteLogicalSwitchPortAnswer(cmd, true, "Logical switch port " + cmd.getLogicalSwitchPortUuid() + " deleted");
        } catch (NiciraNvpApiException e) {
            if (numRetries > 0) {
                return retry(cmd, --numRetries);
            } else {
                return new DeleteLogicalSwitchPortAnswer(cmd, e);
            }
        }
    }
View Full Code Here

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

        doThrow(new NiciraNvpApiException()).when(nvpApi).deleteLogicalSwitchPort((String)any(), (String)any());
        final DeleteLogicalSwitchPortAnswer dlspa = (DeleteLogicalSwitchPortAnswer)resource.executeRequest(new DeleteLogicalSwitchPortCommand("aaaa", "bbbb"));
        assertFalse(dlspa.getResult());
    }
View Full Code Here

            s_logger.error("No mapping for nic " + nic.getName());
            return false;
        }

        DeleteLogicalSwitchPortCommand cmd = new DeleteLogicalSwitchPortCommand(nicMap.getLogicalSwitchUuid(), nicMap.getLogicalSwitchPortUuid());
        DeleteLogicalSwitchPortAnswer answer = (DeleteLogicalSwitchPortAnswer)agentMgr.easySend(niciraNvpHost.getId(), cmd);

        if (answer == null || !answer.getResult()) {
            s_logger.error("DeleteLogicalSwitchPortCommand failed");
            return false;
        }

        niciraNvpNicMappingDao.remove(nicMap.getId());
View Full Code Here

            s_logger.error("No mapping for nic " + nic.getName());
            return false;
        }
               
        DeleteLogicalSwitchPortCommand cmd = new DeleteLogicalSwitchPortCommand(nicMap.getLogicalSwitchUuid(), nicMap.getLogicalSwitchPortUuid());
        DeleteLogicalSwitchPortAnswer answer = (DeleteLogicalSwitchPortAnswer) _agentMgr.easySend(niciraNvpHost.getId(), cmd);
       
        if (answer == null || !answer.getResult()) {
            s_logger.error ("DeleteLogicalSwitchPortCommand failed");
            return false;
        }
       
        _niciraNvpNicMappingDao.remove(nicMap.getId());
View Full Code Here

    }
   
    private Answer executeRequest(DeleteLogicalSwitchPortCommand cmd, int numRetries) {
        try {
            _niciraNvpApi.deleteLogicalSwitchPort(cmd.getLogicalSwitchUuid(), cmd.getLogicalSwitchPortUuid());
            return new DeleteLogicalSwitchPortAnswer(cmd, true, "Logical switch port " + cmd.getLogicalSwitchPortUuid() + " deleted");
        } catch (NiciraNvpApiException e) {
          if (numRetries > 0) {
            return retry(cmd, --numRetries);
          }
          else {
            return new DeleteLogicalSwitchPortAnswer(cmd, e);
          }
        }
    }
View Full Code Here

    @Test
    public void testDeleteLogicalSwitchPortException() throws ConfigurationException, NiciraNvpApiException {
        _resource.configure("NiciraNvpResource", _parameters);

        doThrow(new NiciraNvpApiException()).when(_nvpApi).deleteLogicalSwitchPort((String) any(), (String) any());
        DeleteLogicalSwitchPortAnswer dlspa = (DeleteLogicalSwitchPortAnswer) _resource.executeRequest(new DeleteLogicalSwitchPortCommand("aaaa","bbbb"));
        assertFalse(dlspa.getResult());
    }
View Full Code Here

        }

        DeleteLogicalSwitchPortCommand cmd = new DeleteLogicalSwitchPortCommand(
                nicMap.getLogicalSwitchUuid(),
                nicMap.getLogicalSwitchPortUuid());
        DeleteLogicalSwitchPortAnswer answer = (DeleteLogicalSwitchPortAnswer)_agentMgr
                .easySend(niciraNvpHost.getId(), cmd);

        if (answer == null || !answer.getResult()) {
            s_logger.error("DeleteLogicalSwitchPortCommand failed");
            return false;
        }

        _niciraNvpNicMappingDao.remove(nicMap.getId());
View Full Code Here

TOP

Related Classes of com.cloud.agent.api.DeleteLogicalSwitchPortAnswer

Copyright © 2018 www.massapicom. 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.