Package org.apache.stratos.messaging.domain.topology

Examples of org.apache.stratos.messaging.domain.topology.Cluster


        }
    }

    private void addTenantSubscriptionToLbContext(String serviceName, int tenantId) {
        // Find cluster of tenant
        Cluster cluster = findCluster(serviceName, tenantId);
        if (cluster != null) {
            for (String hostName : cluster.getHostNames()) {
                // Add hostName, tenantId, cluster to multi-tenant map
                Map<Integer, Cluster> clusterMap = LoadBalancerContext.getInstance().getMultiTenantClusterMap().getClusters(hostName);
                if (clusterMap == null) {
                    clusterMap = new HashMap<Integer, Cluster>();
                    clusterMap.put(tenantId, cluster);
                    LoadBalancerContext.getInstance().getMultiTenantClusterMap().addClusters(hostName, clusterMap);
                } else {
                    clusterMap.put(tenantId, cluster);
                }
                if (log.isDebugEnabled()) {
                    log.debug(String.format("Cluster added to multi-tenant cluster map: [host-name] %s [tenant-id] %d [cluster] %s",
                            hostName, tenantId, cluster.getClusterId()));
                }
            }
        } else {
            if (log.isErrorEnabled()) {
                log.error(String.format("Could not find cluster of tenant: [service] %s [tenant-id] %d",
View Full Code Here


        }
    }

    private void removeTenantSubscriptionFromLbContext(String serviceName, int tenantId) {
        // Find cluster of tenant
        Cluster cluster = findCluster(serviceName, tenantId);
        if (cluster != null) {
            for (String hostName : cluster.getHostNames()) {
                LoadBalancerContext.getInstance().getMultiTenantClusterMap().removeClusters(hostName);
                if (log.isDebugEnabled()) {
                    log.debug(String.format("Cluster removed from multi-tenant clusters map: [host-name] %s [tenant-id] %d [cluster] %s",
                            hostName, tenantId, cluster.getClusterId()));
                }
            }
        } else {
            if (log.isErrorEnabled()) {
                log.error(String.format("Could not find cluster of tenant: [service] %s [tenant-id] %d",
View Full Code Here

TOP

Related Classes of org.apache.stratos.messaging.domain.topology.Cluster

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.