Package org.apache.cloudstack.region

Examples of org.apache.cloudstack.region.Region


        Integer regionId = cmd.getRegionIdId();
        Long rangeId = cmd.getPortableIpRangeId();

        List<PortableIpRangeVO> ranges = new ArrayList<PortableIpRangeVO>();
        if (regionId != null) {
            Region region = _regionDao.findById(regionId);
            if (region == null) {
                throw new InvalidParameterValueException("Invalid region ID: " + regionId);
            }
            return _portableIpRangeDao.listByRegionId(regionId);
        }
View Full Code Here


        GlobalLoadBalancerRuleVO gslbRuleWithDomainName = _gslbRuleDao.findByDomainName(domainName);
        if (gslbRuleWithDomainName != null) {
            throw new InvalidParameterValueException("Domain name " + domainName + "is in use");
        }

        Region region = _regionDao.findById(regionId);
        if (region == null) {
            throw new InvalidParameterValueException("Invalid region ID: " + regionId);
        }

        String providerDnsName = _globalConfigDao.getValue(Config.CloudDnsName.key());
        if (!region.checkIfServiceEnabled(Region.Service.Gslb) || (providerDnsName == null)) {
            throw new CloudRuntimeException("GSLB service is not enabled in region : " + region.getName());
        }

        Transaction txn = Transaction.currentTxn();
        txn.start();
        GlobalLoadBalancerRuleVO newGslbRule = new GlobalLoadBalancerRuleVO(name, description, domainName, algorithm,
View Full Code Here

    @Test
    public void testCreateSuccess() {

        RegionService regionService = Mockito.mock(RegionService.class);

        Region region = Mockito.mock(Region.class);
        Mockito.when(
            regionService.addRegion(Mockito.anyInt(), Mockito.anyString(), Mockito.anyString()))
            .thenReturn(region);

        addRegionCmd._regionService = regionService;
View Full Code Here

    @Test
    public void testCreateFailure() {

        RegionService regionService = Mockito.mock(RegionService.class);

        Region region = Mockito.mock(Region.class);
        Mockito.when(
            regionService.addRegion(Mockito.anyInt(), Mockito.anyString(), Mockito.anyString()))
            .thenReturn(null);

        addRegionCmd._regionService = regionService;
View Full Code Here

        return Account.ACCOUNT_ID_SYSTEM;
    }
   
    @Override
    public void execute(){
        Region region = _regionService.addRegion(getId(), getRegionName(), getEndPoint());
        if (region != null) {
          RegionResponse response = _responseGenerator.createRegionResponse(region);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
View Full Code Here

        return Account.ACCOUNT_ID_SYSTEM;
    }
   
    @Override
    public void execute(){
      Region region = _regionService.updateRegion(getId(), getRegionName(), getEndPoint());
      if (region != null) {
        RegionResponse response = _responseGenerator.createRegionResponse(region);
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
      } else {
View Full Code Here

        Integer regionId = cmd.getRegionIdId();
        Long rangeId = cmd.getPortableIpRangeId();

        List<PortableIpRangeVO> ranges = new ArrayList<PortableIpRangeVO>();
        if (regionId != null) {
            Region region = _regionDao.findById(regionId);
            if (region == null) {
                throw new InvalidParameterValueException("Invalid region ID: " + regionId);
            }
            return _portableIpRangeDao.listByRegionId(regionId);
        }
View Full Code Here

        return Account.ACCOUNT_ID_SYSTEM;
    }

    @Override
    public void execute() {
        Region region = _regionService.updateRegion(getId(), getRegionName(), getEndPoint());
        if (region != null) {
            RegionResponse response = _responseGenerator.createRegionResponse(region);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
View Full Code Here

        return Account.ACCOUNT_ID_SYSTEM;
    }

    @Override
    public void execute() {
        Region region = _regionService.addRegion(getId(), getRegionName(), getEndPoint());
        if (region != null) {
            RegionResponse response = _responseGenerator.createRegionResponse(region);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
View Full Code Here

        GlobalLoadBalancerRuleVO gslbRuleWithDomainName = _gslbRuleDao.findByDomainName(domainName);
        if (gslbRuleWithDomainName != null) {
            throw new InvalidParameterValueException("Domain name " + domainName + "is in use");
        }

        Region region = _regionDao.findById(regionId);
        if (region == null) {
            throw new InvalidParameterValueException("Invalid region ID: " + regionId);
        }

        String providerDnsName = _globalConfigDao.getValue(Config.CloudDnsName.key());
        if (!region.checkIfServiceEnabled(Region.Service.Gslb) || (providerDnsName == null)) {
            throw new CloudRuntimeException("GSLB service is not enabled in region : " + region.getName());
        }

        GlobalLoadBalancerRuleVO newGslbRule = Transaction.execute(new TransactionCallback<GlobalLoadBalancerRuleVO>() {
            @Override
            public GlobalLoadBalancerRuleVO doInTransaction(TransactionStatus status) {
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.region.Region

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.