Examples of ADCException


Examples of org.apache.stratos.manager.exception.ADCException

    try {
      repository = repoCreator.createInternalRepository();
    } catch (Exception e) {
      String msg = "Error occurred in creating internal repository. ";
      log.error( msg + e.getMessage());
      throw new ADCException(msg);
    }
    return repository;
       
  }
View Full Code Here

Examples of org.apache.stratos.manager.exception.ADCException

                cartridgeSubscription = new FrameworkCartridgeSubscription(cartridgeInfo, subscriptionTenancyBehaviour);
            }
        }

        if(cartridgeSubscription == null) {
            throw new ADCException("Unable to create a CartridgeSubscription subscription for " + cartridgeInfo);
        }

        return cartridgeSubscription;
    }
View Full Code Here

Examples of org.apache.stratos.manager.exception.ADCException

    public static CartridgeSubscription getLBCartridgeSubscriptionInstance (LBDataContext lbDataContext, LoadBalancerCategory loadBalancerCategory)
            throws ADCException {

        if (!lbDataContext.getLbCartridgeInfo().getProvider().equals("loadbalancer") && !lbDataContext.getLbCartridgeInfo().getProvider().equals("lb")) {
            throw new ADCException("LB cartridge provider should be either lb or loadbalancer");
        }

        return new LBCartridgeSubscription(lbDataContext.getLbCartridgeInfo(), null, loadBalancerCategory);
    }
View Full Code Here

Examples of org.apache.stratos.manager.exception.ADCException

            String msg = "Exception is occurred in register service operation. Reason :" + e.getMessage();
            log.error(msg, e);
            throw new UnregisteredCartridgeException("Not a registered cartridge " + cartridgeType, cartridgeType, e);
        } catch (RemoteException e) {
          log.error("Remote Error", e);
          throw new ADCException("An error occurred in subscribing process", e);
        }
    }
View Full Code Here

Examples of org.apache.stratos.manager.exception.ADCException

        try {
            isAliasTaken = isAliasTaken(tenantId, alias);
        } catch (Exception e) {
            String msg = "Exception : " + e.getMessage();
            log.error(msg, e);
            throw new ADCException("Error when checking alias is already taken", e);
        }

        if (isAliasTaken) {
            String msg = "The alias " + alias + " is already taken. Please try again with a different alias.";
            log.error(msg);
View Full Code Here

Examples of org.apache.stratos.manager.exception.ADCException

                        lbCartridgeInfo = CloudControllerServiceClient.getServiceClient().getCartridgeInfo(lbCartridgeType);

                    } catch (Exception e) {
                        String message = "Error getting info for " + lbCartridgeType;
                        log.error(message, e);
                        throw new ADCException(message, e);
                    }

                    if (lbCartridgeInfo == null) {
                        String msg = "Please specify a LB cartridge type for the cartridge: " + serviceType + " as category: " +
                            Constants.DEFAULT_LOAD_BALANCER;
                        log.error(msg);
                        throw new ADCException(msg);
                    }

                    lbDataCtxt.setLbCartridgeInfo(lbCartridgeInfo);

                    if (log.isDebugEnabled()) {
                        log.debug("This cartridge uses default load balancer. " + "[Type] " + serviceType);
                    }

                    try {
                        // get the valid policies for lb cartridge
                        DeploymentPolicy[] lbCartridgeDepPolicies =
                                getAutoscalerServiceClient().getDeploymentPolicies(lbCartridgeType);
                        // traverse deployment policies of lb cartridge
                        for (DeploymentPolicy policy : lbCartridgeDepPolicies) {

                            // check existence of the subscribed policy
                            if (deploymentPolicyName.equals(policy.getId())) {

                                if (!getAutoscalerServiceClient().checkDefaultLBExistenceAgainstPolicy(deploymentPolicyName)) {
                                  if(log.isDebugEnabled()){
                                    log.debug(" Default LB doesn't exist for deployment policy ["+deploymentPolicyName+"] ");
                                  }

                                    Properties lbProperties = new Properties();

                                    // if LB cartridge definition has properties as well, combine
                                    if (lbCartridgeInfo.getProperties() != null && lbCartridgeInfo.getProperties().length > 0) {
                                      if(log.isDebugEnabled()){
                                        log.debug(" Combining LB properties ");
                                      }
                                        lbProperties.setProperties(combine(lbCartridgeInfo.getProperties(), new Property[]{lbRefProperty}));
                                    } else {
                                        lbProperties.setProperties(new Property[]{lbRefProperty});
                                    }

                                    lbDataCtxt.addLBProperties(lbProperties);
                                }
                            }
                        }

                    } catch (Exception ex) {
                        // we don't need to throw the error here.
                        log.error(ex.getMessage(), ex);
                    }

                    // set deployment and autoscaling policies
                    lbDataCtxt.setDeploymentPolicy(deploymentPolicyName);
                    lbDataCtxt.setAutoscalePolicy(lbCartridgeInfo.getDefaultAutoscalingPolicy());

                    lbDataCtxt.addLoadBalancedServiceProperty(lbRefProperty);
                    break;
                }

            } else if (Constants.SERVICE_AWARE_LOAD_BALANCER.equals(name)) {

                if ("true".equals(value)) {

                    lbDataCtxt.setLbCategory(Constants.SERVICE_AWARE_LOAD_BALANCER);

                    lbRefProperty.setValue(name);

                    CartridgeInfo lbCartridgeInfo;

                    try {
                        lbCartridgeInfo = CloudControllerServiceClient.getServiceClient().getCartridgeInfo(lbCartridgeType);

                    } catch (Exception e) {
                        String message = "Error getting info for " + lbCartridgeType;
                        log.error(message, e);
                        throw new ADCException(message, e);
                    }

                    if (lbCartridgeInfo == null) {
                        String msg = "Please specify a LB cartridge type for the cartridge: " + serviceType + " as category: " +
                                Constants.SERVICE_AWARE_LOAD_BALANCER;
                        log.error(msg);
                        throw new ADCException(msg);
                    }

                    lbDataCtxt.setLbCartridgeInfo(lbCartridgeInfo);

                    // add a property for the service type
View Full Code Here

Examples of org.apache.stratos.manager.exception.ADCException

            return AutoscalerServiceClient.getServiceClient();

        } catch (AxisFault axisFault) {
            String errorMsg = "Error in getting AutoscalerServiceClient instance";
            log.error(errorMsg, axisFault);
            throw new ADCException (errorMsg, axisFault);
        }
    }
View Full Code Here

Examples of org.apache.stratos.manager.exception.ADCException

        } else {
            payloadData = new FramewrokCartridgePayloadData(basicPayloadData);
        }

        if(payloadData == null) {
            throw new ADCException("Unable to find matching payload for cartridge type " + cartridgeType +
                    ", provider " + cartridgeProvider);
        }

        return payloadData;
    }
View Full Code Here

Examples of org.apache.stratos.manager.exception.ADCException

      initializeStream();
      dataPublisher.addStreamDefinition(streamDefinition);
    } catch (Exception e) {
      String msg = "Unable to create a data publisher to "+ bamServerUrl;
      log.error(msg, e);
      throw new ADCException(msg, e);
    }
  }
View Full Code Here

Examples of org.apache.stratos.manager.exception.ADCException

            CloudControllerServiceClient.getServiceClient().unregisterService(clusterId);

        } catch (Exception e) {
            String errorMsg = "Error in unregistering service cluster with domain " + clusterId;
            log.error(errorMsg);
            throw new ADCException(errorMsg, e);
        }

        log.info("Unregistered service cluster, domain " + clusterId);
    }
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.