Examples of PhysicalNetworkServiceProvider


Examples of com.cloud.network.PhysicalNetworkServiceProvider

            }

            // Check if providers are supported in the physical networks
            VirtualRouterProviderType type = VirtualRouterProviderType.VirtualRouter;
            Long physicalNetworkId = _networkMgr.getPhysicalNetworkId(guestNetwork);
            PhysicalNetworkServiceProvider provider = _physicalProviderDao.findByServiceProvider(physicalNetworkId, type.toString());
            if (provider == null) {
                throw new CloudRuntimeException("Cannot find service provider " + type.toString() + " in physical network " + physicalNetworkId);
            }
            VirtualRouterProvider vrProvider = _vrProviderDao.findByNspIdAndType(provider.getId(), type);
            if (vrProvider == null) {
                throw new CloudRuntimeException("Cannot find virtual router provider " + type.toString()+ " as service provider " + provider.getId());
            }

            if (_networkMgr.isNetworkSystem(guestNetwork) || guestNetwork.getGuestType() == Network.GuestType.Shared) {
                owner = _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM);
            }
View Full Code Here

Examples of com.cloud.network.PhysicalNetworkServiceProvider

                || result.getType() == VirtualRouterProvider.VirtualRouterProviderType.VPCVirtualRouter)) {
            return null;
        }
        VirtualRouterProviderResponse response = new VirtualRouterProviderResponse();
        response.setId(result.getUuid());
        PhysicalNetworkServiceProvider nsp = ApiDBUtils.findPhysicalNetworkServiceProviderById(result.getNspId());
        if (nsp != null) {
            response.setNspId(nsp.getUuid());
        }
        response.setEnabled(result.isEnabled());

        response.setObjectName("virtualrouterelement");
        return response;
View Full Code Here

Examples of com.cloud.network.PhysicalNetworkServiceProvider

        if (result.getType() != VirtualRouterProvider.VirtualRouterProviderType.InternalLbVm) {
            return null;
        }
        InternalLoadBalancerElementResponse response = new InternalLoadBalancerElementResponse();
        response.setId(result.getUuid());
        PhysicalNetworkServiceProvider nsp = ApiDBUtils.findPhysicalNetworkServiceProviderById(result.getNspId());
        if (nsp != null) {
            response.setNspId(nsp.getUuid());
        }
        response.setEnabled(result.isEnabled());

        response.setObjectName("internalloadbalancerelement");
        return response;
View Full Code Here

Examples of com.cloud.network.PhysicalNetworkServiceProvider

            }

            // Check if providers are supported in the physical networks
            VirtualRouterProviderType type = VirtualRouterProviderType.VirtualRouter;
                Long physicalNetworkId = _networkModel.getPhysicalNetworkId(guestNetwork);
            PhysicalNetworkServiceProvider provider = _physicalProviderDao.findByServiceProvider(physicalNetworkId, type.toString());
            if (provider == null) {
                throw new CloudRuntimeException("Cannot find service provider " + type.toString() + " in physical network " + physicalNetworkId);
            }
            VirtualRouterProvider vrProvider = _vrProviderDao.findByNspIdAndType(provider.getId(), type);
            if (vrProvider == null) {
                    throw new CloudRuntimeException("Cannot find virtual router provider " + type.toString() + " as service provider " + provider.getId());
            }

                if (_networkModel.isNetworkSystem(guestNetwork) || guestNetwork.getGuestType() == Network.GuestType.Shared) {
                owner = _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM);
            }
View Full Code Here

Examples of com.cloud.network.PhysicalNetworkServiceProvider

            List<? extends PhysicalNetwork> pNtwks = _pNtwkDao.listByZone(vpc.getZoneId());
           
            VirtualRouterProvider vpcVrProvider = null;
          
            for (PhysicalNetwork pNtwk : pNtwks) {
                PhysicalNetworkServiceProvider provider = _physicalProviderDao.findByServiceProvider(pNtwk.getId(),
                        VirtualRouterProviderType.VPCVirtualRouter.toString());
                if (provider == null) {
                    throw new CloudRuntimeException("Cannot find service provider " +
                            VirtualRouterProviderType.VPCVirtualRouter.toString() + " in physical network " + pNtwk.getId());
                }
                vpcVrProvider = _vrProviderDao.findByNspIdAndType(provider.getId(),
                        VirtualRouterProviderType.VPCVirtualRouter);
                if (vpcVrProvider != null) {
                    break;
                }
            }
View Full Code Here

Examples of com.cloud.network.PhysicalNetworkServiceProvider

    public void testCreateProviderToPhysicalNetworkSuccess() {

        NetworkService networkService = Mockito.mock(NetworkService.class);
        addNetworkServiceProviderCmd._networkService = networkService;

        PhysicalNetworkServiceProvider physicalNetworkServiceProvider = Mockito
                .mock(PhysicalNetworkServiceProvider.class);
        Mockito.when(
                networkService.addProviderToPhysicalNetwork(Mockito.anyLong(),
                        Mockito.anyString(), Mockito.anyLong(),
                        Mockito.anyList())).thenReturn(
View Full Code Here

Examples of com.cloud.network.PhysicalNetworkServiceProvider

        return Account.ACCOUNT_ID_SYSTEM;
    }

    @Override
    public void execute(){
        PhysicalNetworkServiceProvider result = _networkService.updateNetworkServiceProvider(getId(), getState(), getEnabledServices());
        if (result != null) {
            ProviderResponse response = _responseGenerator.createNetworkServiceProviderResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        }else {
View Full Code Here

Examples of com.cloud.network.PhysicalNetworkServiceProvider

    }

    @Override
    public void execute(){
        UserContext.current().setEventDetails("Network ServiceProvider Id: "+getEntityId());
        PhysicalNetworkServiceProvider result = _networkService.getCreatedPhysicalNetworkServiceProvider(getEntityId());
        if (result != null) {
            ProviderResponse response = _responseGenerator.createNetworkServiceProviderResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        }else {
View Full Code Here

Examples of com.cloud.network.PhysicalNetworkServiceProvider

        }
    }

    @Override
    public void create() throws ResourceAllocationException {
        PhysicalNetworkServiceProvider result = _networkService.addProviderToPhysicalNetwork(getPhysicalNetworkId(), getProviderName(), getDestinationPhysicalNetworkId(), getEnabledServices());
        if (result != null) {
            setEntityId(result.getId());
            setEntityUuid(result.getUuid());
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add service provider entity to physical network");
        }
    }
View Full Code Here

Examples of com.cloud.network.PhysicalNetworkServiceProvider

                VMTemplateVO template = _templateDao.findSystemVMTemplate(dcId);

                String typeString = "ElasticLoadBalancerVm";
                Long physicalNetworkId = _networkModel.getPhysicalNetworkId(guestNetwork);
                PhysicalNetworkServiceProvider provider = _physicalProviderDao.findByServiceProvider(physicalNetworkId, typeString);
                if (provider == null) {
                    throw new CloudRuntimeException("Cannot find service provider " + typeString + " in physical network " + physicalNetworkId);
                }
                VirtualRouterProvider vrProvider = _vrProviderDao.findByNspIdAndType(provider.getId(), VirtualRouterProviderType.ElasticLoadBalancerVm);
                if (vrProvider == null) {
                    throw new CloudRuntimeException("Cannot find virtual router provider " + typeString + " as service provider " + provider.getId());
                }
              
                elbVm = new DomainRouterVO(id, _elasticLbVmOffering.getId(), vrProvider.getId(),
                        VirtualMachineName.getSystemVmName(id, _instance, _elbVmNamePrefix), template.getId(), template.getHypervisorType(),
                        template.getGuestOSId(), owner.getDomainId(), owner.getId(), false, 0, false, RedundantState.UNKNOWN,
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.