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

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


    public static void addClusterToLbContext(Cluster cluster) {
        if (cluster == null)
            return;

        Service service = TopologyManager.getTopology().getService(cluster.getServiceName());
        if (service == null) {
            throw new RuntimeException(String.format("Service not found: [cluster] %s", cluster.getClusterId()));
        }

        // Add cluster to ClusterIdClusterMap
View Full Code Here


        Cluster cluster = LoadBalancerContext.getInstance().getClusterIdClusterMap().getCluster(clusterId);
        if (cluster == null) {
            return;
        }

        Service service = TopologyManager.getTopology().getService(cluster.getServiceName());
        if (service == null) {
            throw new RuntimeException(String.format("Service not found: [cluster] %s", cluster.getClusterId()));
        }

        // Remove cluster from HostNameClusterMap
View Full Code Here

    }

    private boolean isMultiTenantService(String serviceName) {
        try {
            TopologyManager.acquireReadLock();
            Service service = TopologyManager.getTopology().getService(serviceName);
            if(service != null) {
                return (service.getServiceType() == ServiceType.MultiTenant);
            }
            return false;
        }
        finally {
            TopologyManager.releaseReadLock();
View Full Code Here

    }

    private Cluster findCluster(String serviceName, int tenantId) {
        try {
            TopologyManager.acquireReadLock();
            Service service = TopologyManager.getTopology().getService(serviceName);
            if (service == null) {
                throw new RuntimeException(String.format("Service not found: %s", serviceName));
            }
            for (Cluster cluster : service.getClusters()) {
                if (cluster.tenantIdInRange(tenantId)) {
                    return cluster;
                }
            }
            return null;
View Full Code Here

TOP

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

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.