Package org.apache.stratos.cloud.controller.exception

Examples of org.apache.stratos.cloud.controller.exception.CloudControllerException


              }
               
            } catch (InterruptedException ignore) {
            } catch (IOException e) {
              log.error(e.getMessage(), e);
              throw new CloudControllerException(e.getMessage(), e);
            }
        }

  }
View Full Code Here


        // publish to the topic - to sync immediately
        data.getConfigPub().publish(CloudControllerConstants.TOPIC_NAME, currentNode.toString());
       
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            throw new CloudControllerException(e.getMessage(), e);
        }

  }
View Full Code Here

    }
   
    private void handleException(String msg, Exception e){
        log.error(msg, e);
        throw new CloudControllerException(msg, e);
    }
View Full Code Here

  private void buildTemplate(IaasProvider iaas) {
    if (iaas.getComputeService() == null) {
      String msg = "Compute service is null for IaaS provider: "
          + iaas.getName();
      log.fatal(msg);
      throw new CloudControllerException(msg);
    }

    TemplateBuilder templateBuilder = iaas.getComputeService()
        .templateBuilder();
View Full Code Here

        log.info("Assigned ip [" + ip + "]");

      } catch (Exception e) {
        String msg = "Failed to allocate an IP address. All IP addresses are in use.";
        log.error(msg, e);
        throw new CloudControllerException(msg, e);
      }
    }

    String id = node.getProviderId();
View Full Code Here

        try{
            newNodeToStateMap = getNodeIdToStatusMap();
        }catch (Exception e) {

            release();
            throw new CloudControllerException(e.getMessage(), e);
           
        }
       
        // compare it with old map and populate data to be published with ones newly added
        // and once whose state got changed
        populateNewlyAddedOrStateChangedNodes(newNodeToStateMap);
       
        // issue events for the ones obtained from above
        for (CartridgeInstanceData dataObj : dataToBePublished) {
            StringBuffer temp = new StringBuffer("");
           
            String privateIpAddresses="";
            // Concatenate private IP addresses
            for (String ip : dataObj.getMetaData().getPrivateAddresses()) {
                temp.append(ip+",");
            }
           
            if(!"".equals(temp.toString())){
                // remove comma at the end of the string
                privateIpAddresses = temp.toString().substring(0, temp.toString().length()-1);
            }
           
            temp = new StringBuffer("");
            String publicIpAddresses="";
            // Concatenate public IP addresses
            for (String ip : dataObj.getMetaData().getPublicAddresses()) {
                temp.append(ip+",");
            }
           
            if(!"".equals(temp.toString())){
                // remove comma at the end of the string
                publicIpAddresses = temp.toString().substring(0, temp.toString().length()-1);
            }
           
            try {

                Event cloudControllerEvent = new Event(streamId, System.currentTimeMillis(), new Object[]{}, null,
                                            new Object[]{dataObj.getNodeId(),
                                                         dataObj.getType(),
                                                         dataObj.getDomain(),
                                                         dataObj.getSubDomain(),
                                                         dataObj.getAlias(),
                                                         dataObj.getTenantRange(),
                                                         String.valueOf(dataObj.isMultiTenant()),
                                                         dataObj.getIaas(),
                                                         dataObj.getStatus(),
                                                         dataObj.getMetaData().getHostname(),
                                                         dataObj.getMetaData().getHardware().getHypervisor(),
                                                         String.valueOf(dataObj.getMetaData().getHardware().getRam()),
                                                         dataObj.getMetaData().getImageId(),
                                                         String.valueOf(dataObj.getMetaData().getLoginPort()),
                                                         dataObj.getMetaData().getOperatingSystem().getName(),
                                                         dataObj.getMetaData().getOperatingSystem().getVersion(),
                                                         dataObj.getMetaData().getOperatingSystem().getArch(),
                                                         String.valueOf(dataObj.getMetaData().getOperatingSystem().is64Bit()),
                                                         privateIpAddresses,
                                                         publicIpAddresses});

                dataPublisher.publish(cloudControllerEvent);
               
                log.debug("Data published : "+cloudControllerEvent.toString());

            } catch (Exception e) {
                String msg = "Error occurred while publishing Cartridge instance event to BAM. ";
                log.error(msg, e);
                release();
                throw new CloudControllerException(msg, e);
            }
           
        }
       
        // replace old map with new one only if data is published
View Full Code Here

           
        } catch (Exception e) {
            String msg = "Unable to create a data publisher to " + bamServerUrl +
                    ". Usage Agent will not function properly. ";
            log.error(msg, e);
            throw new CloudControllerException(msg, e);
        }
       
    }
View Full Code Here

      axiomXpath = new AXIOMXPath(xpath);
      nodeList = axiomXpath.selectNodes(elt);
    } catch (JaxenException e) {
      String msg = "Error occurred while reading the Xpath (" + xpath + ")";
      log.error(msg, e);
      throw new CloudControllerException(msg, e);
    }

    return nodeList != null ? nodeList.get(0) : null;
  }
View Full Code Here

      axiomXpath = new AXIOMXPath(xpath);
      nodeList = axiomXpath.selectNodes(documentElement);
    } catch (JaxenException e) {
      String msg = "Error occurred while reading the Xpath (" + xpath + ")";
      log.error(msg, e);
      throw new CloudControllerException(msg, e);
    }

    return nodeList;
  }
View Full Code Here

      axiomXpath = new AXIOMXPath(xpath);
      nodeList = axiomXpath.selectNodes(elt);
    } catch (JaxenException e) {
      String msg = "Error occurred while reading the Xpath (" + xpath + ")";
      log.error(msg, e);
      throw new CloudControllerException(msg, e);
    }

    return nodeList;
  }
View Full Code Here

TOP

Related Classes of org.apache.stratos.cloud.controller.exception.CloudControllerException

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.