Package com.cloud.host

Examples of com.cloud.host.Host


    }

    @Override
    public void execute(){
        try {
            Host trafficMonitor = _networkUsageService.addTrafficMonitor(this);
            TrafficMonitorResponse response = _responseGenerator.createTrafficMonitorResponse(trafficMonitor);
            response.setObjectName("trafficmonitor");
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } catch (InvalidParameterValueException ipve) {
View Full Code Here


        return getId();
    }

    @Override
    public void execute(){
        Host result = _resourceService.maintain(this);
        if (result != null){
            HostResponse response = _responseGenerator.createHostResponse(result);
            response.setResponseName("host");
            this.setResponseObject(response);
        } else {
View Full Code Here

        ComponentContext.initComponentsLifeCycle();
    }

    @Test
    public void testStrategyHandlesVmwareHosts() throws Exception {
        Host srcHost = mock(Host.class);
        Host destHost = mock(Host.class);
        when(srcHost.getHypervisorType()).thenReturn(HypervisorType.VMware);
        when(destHost.getHypervisorType()).thenReturn(HypervisorType.VMware);
        Map<VolumeInfo, DataStore> volumeMap = new HashMap<VolumeInfo, DataStore>();
        boolean canHandle = strategy.canHandle(volumeMap, srcHost, destHost);
        assertTrue("The strategy is only supposed to handle vmware hosts", canHandle);
    }
View Full Code Here

        assertTrue("The strategy is only supposed to handle vmware hosts", canHandle);
    }

    @Test
    public void testStrategyDoesnotHandlesNonVmwareHosts() throws Exception {
        Host srcHost = mock(Host.class);
        Host destHost = mock(Host.class);
        when(srcHost.getHypervisorType()).thenReturn(HypervisorType.XenServer);
        when(destHost.getHypervisorType()).thenReturn(HypervisorType.XenServer);
        Map<VolumeInfo, DataStore> volumeMap = new HashMap<VolumeInfo, DataStore>();
        boolean canHandle = strategy.canHandle(volumeMap, srcHost, destHost);
        assertFalse("The strategy is only supposed to handle vmware hosts", canHandle);
    }
View Full Code Here

        assertFalse("The strategy is only supposed to handle vmware hosts", canHandle);
    }

    @Test
    public void testMigrateWithinClusterSuccess() throws Exception {
        Host srcHost = mock(Host.class);
        Host destHost = mock(Host.class);
        when(srcHost.getClusterId()).thenReturn(1L);
        when(destHost.getClusterId()).thenReturn(1L);
        Map<VolumeInfo, DataStore> volumeMap = new HashMap<VolumeInfo, DataStore>();
        VirtualMachineTO to = mock(VirtualMachineTO.class);
        when(to.getId()).thenReturn(6L);
        VMInstanceVO instance = mock(VMInstanceVO.class);
        when(instanceDao.findById(6L)).thenReturn(instance);
View Full Code Here

        assertTrue("Migration within cluster isn't successful.", this.result.isSuccess());
    }

    @Test
    public void testMigrateWithinClusterFailure() throws Exception {
        Host srcHost = mock(Host.class);
        Host destHost = mock(Host.class);
        when(srcHost.getClusterId()).thenReturn(1L);
        when(destHost.getClusterId()).thenReturn(1L);
        Map<VolumeInfo, DataStore> volumeMap = new HashMap<VolumeInfo, DataStore>();
        VirtualMachineTO to = mock(VirtualMachineTO.class);
        when(to.getId()).thenReturn(6L);
        VMInstanceVO instance = mock(VMInstanceVO.class);
        when(instanceDao.findById(6L)).thenReturn(instance);
View Full Code Here

        assertFalse("Migration within cluster didn't fail.", this.result.isSuccess());
    }

    @Test
    public void testMigrateAcrossClusterSuccess() throws Exception {
        Host srcHost = mock(Host.class);
        Host destHost = mock(Host.class);
        when(srcHost.getClusterId()).thenReturn(1L);
        when(destHost.getClusterId()).thenReturn(2L);
        Map<VolumeInfo, DataStore> volumeMap = new HashMap<VolumeInfo, DataStore>();
        VirtualMachineTO to = mock(VirtualMachineTO.class);
        when(to.getId()).thenReturn(6L);
        VMInstanceVO instance = mock(VMInstanceVO.class);
        when(instanceDao.findById(6L)).thenReturn(instance);
View Full Code Here

        assertTrue("Migration across cluster isn't successful.", this.result.isSuccess());
    }

    @Test
    public void testMigrateAcrossClusterFailure() throws Exception {
        Host srcHost = mock(Host.class);
        Host destHost = mock(Host.class);
        when(srcHost.getClusterId()).thenReturn(1L);
        when(destHost.getClusterId()).thenReturn(2L);
        Map<VolumeInfo, DataStore> volumeMap = new HashMap<VolumeInfo, DataStore>();
        VirtualMachineTO to = mock(VirtualMachineTO.class);
        when(to.getId()).thenReturn(6L);
        VMInstanceVO instance = mock(VMInstanceVO.class);
        when(instanceDao.findById(6L)).thenReturn(instance);
View Full Code Here

    }

    @Override
    public void execute(){
        try {
            Host externalLoadBalancer = _f5DeviceManagerService.addExternalLoadBalancer(this);
            ExternalLoadBalancerResponse response = _f5DeviceManagerService.createExternalLoadBalancerResponse(externalLoadBalancer);
            response.setObjectName("externalloadbalancer");
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } catch (InvalidParameterValueException ipve) {
View Full Code Here

        ServerResource resource = new CiscoVnmcResource();
        Transaction txn = Transaction.currentTxn();
        try {
            resource.configure(cmd.getHost(), hostdetails);

            Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.ExternalFirewall, params);
            if (host != null) {
                txn.start();

                ciscoVnmcResource = new CiscoVnmcControllerVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName);
                _ciscoVnmcDao.persist((CiscoVnmcControllerVO)ciscoVnmcResource);
               
                DetailVO detail = new DetailVO(host.getId(), "deviceid", String.valueOf(ciscoVnmcResource.getId()));
                _hostDetailsDao.persist(detail);

                txn.commit();
                return ciscoVnmcResource;
            } else {
View Full Code Here

TOP

Related Classes of com.cloud.host.Host

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.