Examples of MappedServices


Examples of io.fabric8.gateway.handlers.http.MappedServices

            for (String service : services) {
                populateUrlParams(params, service);
                String fullPath = pathTemplate.bindByNameNonStrict(params);
                if (remove) {
                    MappedServices rule = mappingRules.get(fullPath);
                    if (rule != null) {
                        Set<String> serviceUrls = rule.getServiceUrls();
                        serviceUrls.remove(service);
                        if (serviceUrls.isEmpty()) {
                            mappingRules.remove(fullPath);
                        }
                    }
                } else {
                    MappedServices mappedServices = new MappedServices(service, serviceDetails, loadBalancer, reverseHeaders);
                    MappedServices oldRule = mappingRules.put(fullPath, mappedServices);
                    if (oldRule != null) {
                        mappedServices.getServiceUrls().addAll(oldRule.getServiceUrls());
                    }
                }
            }
        }
        fireMappingRulesChanged();
View Full Code Here

Examples of io.fabric8.gateway.handlers.http.MappedServices

    protected void assertMapping(String path, String service) {
        Map<String, MappedServices> mappingRules = httpGateway.getMappedServices();
        assertTrue("Should have some mapping rules", mappingRules.size() > 0);

        MappedServices mappedServices = mappingRules.get(path);
        assertNotNull("Could not find mapping rule for path " + path, mappedServices);

        Collection<String> serviceUrls = mappedServices.getServiceUrls();
        assertTrue("Could not find service " + service + " in services " + serviceUrls, serviceUrls.contains(service));
    }
View Full Code Here

Examples of io.fabric8.gateway.handlers.http.MappedServices

    }

    protected void printMappings(Map<String, MappedServices> mappingRules) {
        for (Map.Entry<String, MappedServices> entry : mappingRules.entrySet()) {
            String key = entry.getKey();
            MappedServices value = entry.getValue();
            System.out.println(key + " => " + value.getServiceUrls());
        }
    }
View Full Code Here

Examples of io.fabric8.gateway.handlers.http.MappedServices

        Map<String, List<FrontEnd>> answer = new HashMap<String, List<FrontEnd>>();
        List<FrontEnd> frontEnds = new ArrayList<FrontEnd>();
        Set<Map.Entry<String, MappedServices>> entries = getMappedServices().entrySet();
        for (Map.Entry<String, MappedServices> entry : entries) {
            String uri = entry.getKey();
            MappedServices services = entry.getValue();
            String id = "b" + uri.replace('/', '_').replace('-', '_');
            while (id.endsWith("_")) {
                id = id.substring(0, id.length() - 1);
            }

            List<BackEndServer> backends = new ArrayList<BackEndServer>();
            FrontEnd frontEnd = new FrontEnd(id, uri, services, backends);
            frontEnds.add(frontEnd);
            Collection<String> serviceUrls = services.getServiceUrls();
            for (String serviceUrl : serviceUrls) {
                URL url = null;
                try {
                    url = new URL(serviceUrl);
                } catch (MalformedURLException e) {
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.