Examples of ApplicationLoadBalancerRule


Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

        return s_name;
    }

    @Override
    public long getEntityOwnerId() {
        ApplicationLoadBalancerRule lb = _entityMgr.findById(ApplicationLoadBalancerRule.class, getId());
        if (lb != null) {
            return lb.getAccountId();
        } else {
            throw new InvalidParameterValueException("Can't find load balancer by id specified");
        }
    }
View Full Code Here

Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

        return BaseAsyncCmd.networkSyncObject;
    }

    @Override
    public Long getSyncObjId() {
        ApplicationLoadBalancerRule lb = _appLbService.getApplicationLoadBalancer(id);
        if(lb == null){
            throw new InvalidParameterValueException("Unable to find load balancer by id ");
        }
        return lb.getNetworkId();
    }
View Full Code Here

Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

     */
   
    @Test
    //Positive test - retrieve existing lb
    public void searchForExistingLoadBalancer() {
        ApplicationLoadBalancerRule rule = _appLbSvc.getApplicationLoadBalancer(existingLbId);
        assertNotNull("Couldn't find existing application load balancer", rule);
    }
View Full Code Here

Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

   
    @Test
    //Negative test - try to retrieve non-existing lb
    public void searchForNonExistingLoadBalancer() {
        boolean notFound = false;
        ApplicationLoadBalancerRule rule = null;
        try {
            rule = _appLbSvc.getApplicationLoadBalancer(nonExistingLbId);
            if (rule != null) {
                notFound = false;
            }
View Full Code Here

Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

        return s_name;
    }

    @Override
    public void execute() throws ResourceAllocationException, ResourceUnavailableException {
        ApplicationLoadBalancerRule rule = null;
        try {
            UserContext.current().setEventDetails("Load Balancer Id: " + getEntityId());
            // State might be different after the rule is applied, so get new object here
            rule = _entityMgr.findById(ApplicationLoadBalancerRule.class, getEntityId());
            ApplicationLoadBalancerResponse lbResponse = _responseGenerator.createLoadBalancerContainerReponse(rule, _lbService.getLbInstances(getEntityId()));
View Full Code Here

Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

    @Override
    public void create() {
        try {
           
            ApplicationLoadBalancerRule result = _appLbService.createApplicationLoadBalancer(getName(), getDescription(), getScheme(),
                    getSourceIpNetworkId(), getSourceIp(), getSourcePort(), getInstancePort(), getAlgorithm(), getNetworkId(), getEntityOwnerId());
            this.setEntityId(result.getId());
            this.setEntityUuid(result.getUuid());
        }catch (NetworkRuleConflictException e) {
            s_logger.warn("Exception: ", e);
            throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, e.getMessage());
        } catch (InsufficientAddressCapacityException e) {
            s_logger.warn("Exception: ", e);
View Full Code Here

Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

        return s_name;
    }

    @Override
    public long getEntityOwnerId() {
        ApplicationLoadBalancerRule lb = _entityMgr.findById(ApplicationLoadBalancerRule.class, getId());
        if (lb != null) {
            return lb.getAccountId();
        } else {
            throw new InvalidParameterValueException("Can't find load balancer by id specified");
        }
    }
View Full Code Here

Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

        return BaseAsyncCmd.networkSyncObject;
    }

    @Override
    public Long getSyncObjId() {
        ApplicationLoadBalancerRule lb = _appLbService.getApplicationLoadBalancer(id);
        if (lb == null) {
            throw new InvalidParameterValueException("Unable to find load balancer by id ");
        }
        return lb.getNetworkId();
    }
View Full Code Here

Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

        return s_name;
    }

    @Override
    public void execute() throws ResourceAllocationException, ResourceUnavailableException {
        ApplicationLoadBalancerRule rule = null;
        try {
            CallContext.current().setEventDetails("Load Balancer Id: " + getEntityId());
            // State might be different after the rule is applied, so get new object here
            rule = _entityMgr.findById(ApplicationLoadBalancerRule.class, getEntityId());
            ApplicationLoadBalancerResponse lbResponse = _responseGenerator.createLoadBalancerContainerReponse(rule, _lbService.getLbInstances(getEntityId()));
View Full Code Here

Examples of org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule

    @Override
    public void create() {
        try {

            ApplicationLoadBalancerRule result =
                _appLbService.createApplicationLoadBalancer(getName(), getDescription(), getScheme(), getSourceIpNetworkId(), getSourceIp(), getSourcePort(),
                    getInstancePort(), getAlgorithm(), getNetworkId(), getEntityOwnerId(), getDisplay());
            this.setEntityId(result.getId());
            this.setEntityUuid(result.getUuid());
        } catch (NetworkRuleConflictException e) {
            s_logger.warn("Exception: ", e);
            throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, e.getMessage());
        } catch (InsufficientAddressCapacityException e) {
            s_logger.warn("Exception: ", e);
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.