Package org.apache.stratos.autoscaler.exception

Examples of org.apache.stratos.autoscaler.exception.InvalidPartitionException


  /*
   * Deploy a new partition to Auto Scaler.
   */
    public boolean addNewPartition(Partition partition) throws InvalidPartitionException {
        if (StringUtils.isEmpty(partition.getId())){
            throw new InvalidPartitionException("Partition id can not be empty");
        }
        if (this.partitionExist(partition.getId())) {
            throw new InvalidPartitionException(String.format("Partition already exist in partition manager: [id] %s", partition.getId()));
        }
        if (null == partition.getProvider()) {
            throw new InvalidPartitionException("Mandatory field provider has not be set for partition " + partition.getId());
        }
        try {
            validatePartitionViaCloudController(partition);
            RegistryManager.getInstance().persistPartition(partition);
            addPartitionToInformationModel(partition);
            if (log.isInfoEnabled()) {
                log.info(String.format("Partition is deployed successfully: [id] %s", partition.getId()));
            }
            return true;
        } catch (Exception e) {
            throw new InvalidPartitionException(e.getMessage(), e);
        }
    }
View Full Code Here


        for (Partition partition : deploymentPolicy.getAllPartitions()) {
            String partitionId = partition.getId();
            if ((partitionId == null) || (!partitionMgr.partitionExist(partitionId))) {
                String msg = "Could not find partition: [id] " + partitionId + ". " +
                        "Please deploy the partitions before deploying the deployment policies.";               
                throw new InvalidPartitionException(msg);
            }
           
            fillPartition(partition, PartitionManager.getInstance().getPartitionById(partitionId));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.stratos.autoscaler.exception.InvalidPartitionException

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.