public ServletContainer servletContainer(java.lang.String key) { return this.servletContainers.stream() .filter(e -> e.getKey().equals(key)).findFirst() .orElse(null); } /**
/** * Create and configure a MimeMapping object to the list of subresources * * @param key * The key for the MimeMapping resource * @return this */ @SuppressWarnings("unchecked") public T mimeMapping(java.lang.String childKey) { mimeMapping(childKey, null); return (T) this; }
/** * Create and configure a WelcomeFile object to the list of subresources * * @param key * The key for the WelcomeFile resource * @return this */ @SuppressWarnings("unchecked") public T welcomeFile(java.lang.String childKey) { welcomeFile(childKey, null); return (T) this; }
/** * Create the default, HTTP-only fraction. * * @return The configured fraction. */ public static UndertowFraction createDefaultFraction() { UndertowFraction fraction = new UndertowFraction(); fraction.server( new Server("default-server") .httpListener(new HTTPListener("default") .socketBinding("http")) .host(new Host("default-host"))) .bufferCache(new BufferCache("default")) .servletContainer(new ServletContainer("default") .websocketsSetting(new WebsocketsSetting()) .jspSetting(new JSPSetting())) .handlerConfiguration(new HandlerConfiguration()); return fraction; }
/** * Create and configure a ServletContainer object to the list of * subresources * * @param key * The key for the ServletContainer resource * @param config * The ServletContainerConsumer to use * @return this */ @SuppressWarnings("unchecked") public T servletContainer(java.lang.String childKey, ServletContainerConsumer consumer) { ServletContainer<? extends ServletContainer> child = new ServletContainer<>( childKey); if (consumer != null) { consumer.accept(child); } servletContainer(child); return (T) this; }
public UndertowFraction applyDefaults() { defaultServer(DEFAULT_SERVER) .defaultVirtualHost(DEFAULT_HOST) .defaultServletContainer(DEFAULT_SERVLET_CONTAINER) .defaultSecurityDomain("other") .server(new Server(DEFAULT_SERVER) .httpListener(DEFAULT_HTTP_LISTENER, (listener) -> { listener.socketBinding("http"); }) .host(new Host(DEFAULT_HOST))) .bufferCache(new BufferCache(DEFAULT_BUFFER_CACHE)) .servletContainer(new ServletContainer(DEFAULT_SERVLET_CONTAINER) .websocketsSetting(new WebsocketsSetting()) .jspSetting(new JSPSetting())) .handlerConfiguration(new HandlerConfiguration()); return this; }
/** * Create and configure a ServletContainer object to the list of * subresources * * @param key * The key for the ServletContainer resource * @param config * The ServletContainerConsumer to use * @return this */ @SuppressWarnings("unchecked") public T servletContainer(java.lang.String childKey, ServletContainerConsumer consumer) { ServletContainer<? extends ServletContainer> child = new ServletContainer<>( childKey); if (consumer != null) { consumer.accept(child); } servletContainer(child); return (T) this; }
/** * Create the default, HTTP-only fraction. * * @return The configured fraction. */ @Default public static UndertowFraction createDefaultFraction() { UndertowFraction fraction = new UndertowFraction(); final boolean enabled = ( System.getProperty( SwarmProperties.HTTP_EAGER ) != null ); fraction.server( new Server("default-server") .httpListener("default", (listener) -> { listener.socketBinding("http") .enabled(enabled); }) .host(new Host("default-host"))) .bufferCache(new BufferCache("default")) .servletContainer(new ServletContainer("default") .websocketsSetting(new WebsocketsSetting()) .jspSetting(new JSPSetting())) .handlerConfiguration(new HandlerConfiguration()); return fraction; }
/** * Create and configure a MimeMapping object to the list of subresources * * @param key * The key for the MimeMapping resource * @return this */ @SuppressWarnings("unchecked") public T mimeMapping(java.lang.String childKey) { mimeMapping(childKey, null); return (T) this; }
/** * Create and configure a WelcomeFile object to the list of subresources * * @param key * The key for the WelcomeFile resource * @return this */ @SuppressWarnings("unchecked") public T welcomeFile(java.lang.String childKey) { welcomeFile(childKey, null); return (T) this; }
public ServletContainer servletContainer(java.lang.String key) { return this.servletContainers.stream() .filter(e -> e.getKey().equals(key)).findFirst() .orElse(null); } /**
/** * Install a supplied MimeMapping object to the list of subresources */ @SuppressWarnings("unchecked") public T mimeMapping(MimeMappingSupplier supplier) { mimeMapping(supplier.get()); return (T) this; }
/** * Install a supplied WelcomeFile object to the list of subresources */ @SuppressWarnings("unchecked") public T welcomeFile(WelcomeFileSupplier supplier) { welcomeFile(supplier.get()); return (T) this; }
/** * Install a supplied MimeMapping object to the list of subresources */ @SuppressWarnings("unchecked") public T mimeMapping(MimeMappingSupplier supplier) { mimeMapping(supplier.get()); return (T) this; }
/** * Install a supplied WelcomeFile object to the list of subresources */ @SuppressWarnings("unchecked") public T welcomeFile(WelcomeFileSupplier supplier) { welcomeFile(supplier.get()); return (T) this; }
/** * Create and configure a MimeMapping object to the list of subresources * * @param key * The key for the MimeMapping resource * @param config * The MimeMappingConsumer to use * @return this */ @SuppressWarnings("unchecked") public T mimeMapping(java.lang.String childKey, MimeMappingConsumer consumer) { MimeMapping<? extends MimeMapping> child = new MimeMapping<>(childKey); if (consumer != null) { consumer.accept(child); } mimeMapping(child); return (T) this; }
/** * Create and configure a WelcomeFile object to the list of subresources * * @param key * The key for the WelcomeFile resource * @param config * The WelcomeFileConsumer to use * @return this */ @SuppressWarnings("unchecked") public T welcomeFile(java.lang.String childKey, WelcomeFileConsumer consumer) { WelcomeFile<? extends WelcomeFile> child = new WelcomeFile<>(childKey); if (consumer != null) { consumer.accept(child); } welcomeFile(child); return (T) this; }
/** * Create and configure a MimeMapping object to the list of subresources * * @param key * The key for the MimeMapping resource * @param config * The MimeMappingConsumer to use * @return this */ @SuppressWarnings("unchecked") public T mimeMapping(java.lang.String childKey, MimeMappingConsumer consumer) { MimeMapping<? extends MimeMapping> child = new MimeMapping<>(childKey); if (consumer != null) { consumer.accept(child); } mimeMapping(child); return (T) this; }
/** * Create and configure a WelcomeFile object to the list of subresources * * @param key * The key for the WelcomeFile resource * @param config * The WelcomeFileConsumer to use * @return this */ @SuppressWarnings("unchecked") public T welcomeFile(java.lang.String childKey, WelcomeFileConsumer consumer) { WelcomeFile<? extends WelcomeFile> child = new WelcomeFile<>(childKey); if (consumer != null) { consumer.accept(child); } welcomeFile(child); return (T) this; }