Examples of VirtualRouter


Examples of com.cloud.network.router.VirtualRouter

    @Override
    public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
        UserContext ctx = UserContext.current();
        ctx.setEventDetails("Router Id: "+getId());

        VirtualRouter result = _routerService.destroyRouter(getId(), ctx.getCaller(), ctx.getCallerUserId());
        if (result != null) {
            DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
View Full Code Here

Examples of com.cloud.network.router.VirtualRouter

        return s_name;
    }

    @Override
    public long getEntityOwnerId() {
        VirtualRouter router = _entityMgr.findById(VirtualRouter.class, getId());
        if (router != null) {
            return router.getAccountId();
        }

        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
    }
View Full Code Here

Examples of com.cloud.network.router.VirtualRouter

    }

    @Override
    public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
        UserContext.current().setEventDetails("Router Id: "+getId());
        VirtualRouter result = null;
        VirtualRouter router = _routerService.findRouter(getId());
        if (router == null || router.getRole() != Role.VIRTUAL_ROUTER) {
            throw new InvalidParameterValueException("Can't find router by id");
        } else {
            result = _routerService.stopRouter(getId(), isForced());
        }
       
View Full Code Here

Examples of com.cloud.network.router.VirtualRouter

        return s_name;
    }

    @Override
    public long getEntityOwnerId() {
        VirtualRouter vm = _entityMgr.findById(VirtualRouter.class, getId());
        if (vm != null && vm.getRole() == Role.INTERNAL_LB_VM) {
            return vm.getAccountId();
        } else {
            throw new InvalidParameterValueException("Unable to find internal lb vm by id");
        }
    }
View Full Code Here

Examples of com.cloud.network.router.VirtualRouter

    }

    @Override
    public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
        UserContext.current().setEventDetails("Internal lb vm Id: "+getId());
        VirtualRouter result = null;
        VirtualRouter vm = _routerService.findRouter(getId());
        if (vm == null || vm.getRole() != Role.INTERNAL_LB_VM) {
            throw new InvalidParameterValueException("Can't find internal lb vm by id");
        } else {
            result = _internalLbSvc.stopInternalLbVm(getId(), isForced(), UserContext.current().getCaller(), UserContext.current().getCallerUserId());
        }
       
View Full Code Here

Examples of com.cloud.network.router.VirtualRouter

        return "router";
    }

    @Override
    public long getEntityOwnerId() {
        VirtualRouter router = _entityMgr.findById(VirtualRouter.class, getId());
        if (router != null && router.getRole() == Role.INTERNAL_LB_VM) {
            return router.getAccountId();
        } else {
            throw new InvalidParameterValueException("Unable to find internal lb vm by id");
        }
    }
View Full Code Here

Examples of com.cloud.network.router.VirtualRouter

    }

    @Override
    public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException{
        UserContext.current().setEventDetails("Internal Lb Vm Id: "+getId());
        VirtualRouter result = null;
        VirtualRouter router = _routerService.findRouter(getId());
        if (router == null || router.getRole() != Role.INTERNAL_LB_VM) {
            throw new InvalidParameterValueException("Can't find internal lb vm by id");
        } else {
            result = _internalLbSvc.startInternalLbVm(getId(), UserContext.current().getCaller(), UserContext.current().getCallerUserId());
        }
       
View Full Code Here

Examples of com.cloud.network.router.VirtualRouter

        }
    }
   
    @Test
    public void startValidLbVmVm() {
        VirtualRouter vr = null;
        try {
            vr = _lbVmSvc.startInternalLbVm(validVmId, _accountMgr.getAccount(1L), 1L);
        } catch (StorageUnavailableException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

Examples of com.cloud.network.router.VirtualRouter

    }
   
   
    @Test
    public void stopValidLbVmVm() {
        VirtualRouter vr = null;
        try {
            vr = _lbVmSvc.stopInternalLbVm(validVmId, false, _accountMgr.getAccount(1L), 1L);
        } catch (StorageUnavailableException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

Examples of com.cloud.network.router.VirtualRouter

        //only one internal lb vm is supported per ip address at this time
        if (internalLbVms == null || internalLbVms.isEmpty()) {
            throw new CloudRuntimeException("Can't apply the lb rules on network " + network + " as the list of internal lb vms is empty");
        }
       
        VirtualRouter lbVm = internalLbVms.get(0);
        if (lbVm.getState() == State.Running) {
            return sendLBRules(lbVm, rules, network.getId());
        } else if (lbVm.getState() == State.Stopped || lbVm.getState() == State.Stopping) {
            s_logger.debug("Internal LB VM " + lbVm.getInstanceName() + " is in " + lbVm.getState() +
                    ", so not sending apply lb rules commands to the backend");
            return true;
        } else {
            s_logger.warn("Unable to apply lb rules, Internal LB VM is not in the right state " + lbVm.getState());
            throw new ResourceUnavailableException("Unable to apply lb rules; Internal LB VM is not in the right state", DataCenter.class, lbVm.getDataCenterId());
        }
    }
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.