Package org.apache.stratos.rest.endpoint.exception

Examples of org.apache.stratos.rest.endpoint.exception.RestAPIException


    }


    public Partition[] getPartitionsOfPolicy(String deploymentPolicyId) throws RestAPIException{
        if(!deploymentPolicyMap.containsKey(deploymentPolicyId)){
            throw new RestAPIException("There is no deployment policy with id: " + deploymentPolicyId);
        }
        return deploymentPolicyMap.get(deploymentPolicyId).partition.toArray(new Partition[0]);
    }
View Full Code Here


        return deploymentPolicyMap.get(deploymentPolicyId).partition.toArray(new Partition[0]);
    }

    public PartitionGroup[] getPartitionGroups(String deploymentPolicyIdthrows RestAPIException{
        if(!deploymentPolicyMap.containsKey(deploymentPolicyId)){
            throw new RestAPIException("There is no policy with id: " + deploymentPolicyId);
        }
        return deploymentPolicyMap.get(deploymentPolicyId).partitionGroup.toArray(new PartitionGroup[0]);
    }
View Full Code Here

         return autoscalePolicyMap.values().toArray(new AutoscalePolicy[0]);
    }

    public AutoscalePolicy getAutoscalePolicies(String autoscalePolicyId) throws  RestAPIException{
        if(!autoscalePolicyMap.containsKey(autoscalePolicyId)){
            throw new RestAPIException("There is no auto scale policy with id: " + autoscalePolicyId);
        }
        return autoscalePolicyMap.get(autoscalePolicyId);
    }
View Full Code Here

        return deploymentPolicyMap.values().toArray(new DeploymentPolicy[0]);
    }

    public DeploymentPolicy getDeploymentPolicies(String deploymentPolicyId) throws RestAPIException{
        if(!deploymentPolicyMap.containsKey(deploymentPolicyId)){
            throw new RestAPIException("There is no deployment policy with id: " + deploymentPolicyId);
        }
        return deploymentPolicyMap.get(deploymentPolicyId);
    }
View Full Code Here

        return serviceDefinitionMap.values().toArray(new ServiceDefinitionBean[0]);
    }

    public Partition[] getPartitions(String deploymentPolicyId, String partitionGroupId) throws RestAPIException{
        if(!deploymentPolicyMap.containsKey(deploymentPolicyId)){
            throw new RestAPIException("There is no deployment policy with id: " + deploymentPolicyId);
        }
        Partition[] partitions = null;
         DeploymentPolicy deploymentPolicy = deploymentPolicyMap.get(deploymentPolicyId);
         for(PartitionGroup partitionGroup : deploymentPolicy.partitionGroup){
             if(partitionGroup.id.equals(partitionGroupId)){
                 partitions =  partitionGroup.partition.toArray(new Partition[0]);
             }
         }
        if(partitions == null){
            throw new RestAPIException("Partition not found");
        }
        return partitions;
    }
View Full Code Here

        if (cloudControllerServiceClient != null) {

            CartridgeConfig cartridgeConfig = PojoConverter.populateCartridgeConfigPojo(cartridgeDefinitionBean);

            if(cartridgeConfig == null) {
                throw new RestAPIException("Populated CartridgeConfig instance is null, cartridge deployment aborted");
            }

               
      // call CC
      try {
        cloudControllerServiceClient
            .deployCartridgeDefinition(cartridgeConfig);
      } catch (RemoteException e) {
        log.error(e.getMessage(), e);
        throw new RestAPIException(e.getMessage(), e);
      } catch (CloudControllerServiceInvalidCartridgeDefinitionExceptionException e) {
        String message = e.getFaultMessage().getInvalidCartridgeDefinitionException().getMessage();
        log.error(message, e);
        throw new RestAPIException(message, e);
      } catch (CloudControllerServiceInvalidIaasProviderExceptionException e) {
        String message = e.getFaultMessage().getInvalidIaasProviderException().getMessage();
        log.error(message, e);
        throw new RestAPIException(message, e);
      }
               
            log.info("Successfully deployed Cartridge [type] "+cartridgeDefinitionBean.type);
               
        }
View Full Code Here

        if (cloudControllerServiceClient != null) {
                try {
          cloudControllerServiceClient.unDeployCartridgeDefinition(cartridgeType);
        } catch (RemoteException e) {
          log.error(e.getMessage(), e);
          throw new RestAPIException(e.getMessage(), e);
        } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
          String msg = e.getFaultMessage().getInvalidCartridgeTypeException().getMessage();
          log.error(msg, e);
          throw new RestAPIException(msg, e);
        }

        }

        StratosAdminResponse stratosAdminResponse = new StratosAdminResponse();
View Full Code Here

      try {
        autoscalerServiceClient.deployPartition(partition);
      } catch (RemoteException e) {
        log.error(e.getMessage(), e);
        throw new RestAPIException(e.getMessage(), e);
      } catch (AutoScalerServiceInvalidPartitionExceptionException e) {
        String message = e.getFaultMessage().getInvalidPartitionException().getMessage();
        log.error(message, e);
        throw new RestAPIException(message, e);
      }

        }

        StratosAdminResponse stratosAdminResponse = new StratosAdminResponse();
View Full Code Here

      try {
        autoscalerServiceClient
            .deployAutoscalingPolicy(autoscalePolicy);
      } catch (RemoteException e) {
        log.error(e.getMessage(), e);
        throw new RestAPIException(e.getMessage(), e);
      } catch (AutoScalerServiceInvalidPolicyExceptionException e) {
        String message = e.getFaultMessage()
            .getInvalidPolicyException().getMessage();
        log.error(message, e);
        throw new RestAPIException(message, e);
      }

        }

        StratosAdminResponse stratosAdminResponse = new StratosAdminResponse();
View Full Code Here

      try {
        autoscalerServiceClient
            .deployDeploymentPolicy(deploymentPolicy);
      } catch (RemoteException e) {
        log.error(e.getMessage(), e);
        throw new RestAPIException(e.getMessage(), e);
      } catch (AutoScalerServiceInvalidPolicyExceptionException e) {
        String message = e.getFaultMessage().getInvalidPolicyException().getMessage();
        log.error(message, e);
        throw new RestAPIException(message, e);
      }

        }

        StratosAdminResponse stratosAdminResponse = new StratosAdminResponse();
View Full Code Here

TOP

Related Classes of org.apache.stratos.rest.endpoint.exception.RestAPIException

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.