Examples of CartridgeInstanceData


Examples of org.apache.stratos.cloud.controller.util.CartridgeInstanceData

       
    }
   
    private static void bundleData(String key, String val, ServiceContext serviceCtxt) {
       
        CartridgeInstanceData instanceData = new CartridgeInstanceData();
        instanceData.setNodeId(key);
        instanceData.setStatus(val);
        instanceData.setDomain(serviceCtxt.getDomainName());
        instanceData.setSubDomain(serviceCtxt.getSubDomainName());
        instanceData.setAlias("".equals(serviceCtxt.getProperty(CloudControllerConstants.ALIAS_PROPERTY))
            ? "NULL"
                : serviceCtxt.getProperty(CloudControllerConstants.ALIAS_PROPERTY));
        instanceData.setTenantRange("".equals(serviceCtxt.getProperty(CloudControllerConstants.TENANT_ID_PROPERTY))
            ? serviceCtxt.getTenantRange()
                : serviceCtxt.getProperty(CloudControllerConstants.TENANT_ID_PROPERTY));
       
        if (serviceCtxt.getCartridge() != null) {
            instanceData.setMultiTenant(serviceCtxt.getCartridge().isMultiTenant());

            for (IaasProvider iaas : serviceCtxt.getCartridge().getIaases()) {

                IaasContext ctxt = null;
                if ((ctxt = serviceCtxt.getIaasContext(iaas.getType())) == null) {
                    ctxt = serviceCtxt.addIaasContext(iaas.getType());
                }

                if (ctxt.didISpawn(key)) {
                    instanceData.setIaas(iaas.getType());
                    instanceData.setMetaData(ctxt.getNode(key));

                    // clear to be removed data
                    ctxt.removeToBeRemovedNodeId(key);

                    // if the node is terminated
                    if (val.equals(NodeStatus.TERMINATED.toString())) {
                        // since this node is terminated
                        FasterLookUpDataHolder.getInstance().removeNodeId(key);

                        // remove node meta data
                        ctxt.removeNodeMetadata(ctxt.getNode(key));
                    }

                    break;
                }
            }

            instanceData.setType(serviceCtxt.getCartridge().getType());
        } else {
            log.warn("Cartridge is null for Service Context : (domain: " +
                serviceCtxt.getDomainName() +
                    ", sub domain: " +
                    serviceCtxt.getSubDomainName() +
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.