/** * Create and configure a ReverseProxy object to the list of subresources * * @param key * The key for the ReverseProxy resource * @return this */ @SuppressWarnings("unchecked") public T reverseProxy(java.lang.String childKey) { reverseProxy(childKey, null); return (T) this; }
/** * Create and configure a ReverseProxy object to the list of subresources * * @param key * The key for the ReverseProxy resource * @return this */ @SuppressWarnings("unchecked") public T reverseProxy(java.lang.String childKey) { reverseProxy(childKey, null); return (T) this; }
/** * Install a supplied ReverseProxy object to the list of subresources */ @SuppressWarnings("unchecked") public T reverseProxy(ReverseProxySupplier supplier) { reverseProxy(supplier.get()); return (T) this; }
/** * Install a supplied ReverseProxy object to the list of subresources */ @SuppressWarnings("unchecked") public T reverseProxy(ReverseProxySupplier supplier) { reverseProxy(supplier.get()); return (T) this; }
/** * Create and configure a ReverseProxy object to the list of subresources * * @param key * The key for the ReverseProxy resource * @param config * The ReverseProxyConsumer to use * @return this */ @SuppressWarnings("unchecked") public T reverseProxy(java.lang.String childKey, ReverseProxyConsumer consumer) { ReverseProxy<? extends ReverseProxy> child = new ReverseProxy<>( childKey); if (consumer != null) { consumer.accept(child); } reverseProxy(child); return (T) this; }
/** * Create and configure a ReverseProxy object to the list of subresources * * @param key * The key for the ReverseProxy resource * @param config * The ReverseProxyConsumer to use * @return this */ @SuppressWarnings("unchecked") public T reverseProxy(java.lang.String childKey, ReverseProxyConsumer consumer) { ReverseProxy<? extends ReverseProxy> child = new ReverseProxy<>( childKey); if (consumer != null) { consumer.accept(child); } reverseProxy(child); return (T) this; }
public void customize() { Map<String,String> mappings = this.fraction.proxiedServiceMappings(); if (!mappings.isEmpty()) { HandlerConfiguration handlerConfig = undertow.subresources().handlerConfiguration(); for (String serviceName : mappings.keySet()) { ReverseProxy<?> proxy = new ReverseProxy<>(proxyHandlerName(serviceName)).hosts(Collections.emptyList()); handlerConfig.reverseProxy(proxy); String contextPath = mappings.get(serviceName); for (Server server : undertow.subresources().servers()) { Location location = new Location(contextPath).handler(proxyHandlerName(serviceName)); for (Host host : server.subresources().hosts()) { host.location(location); } } } } } }