Java Code Examples for io.undertow.server.handlers.ResponseCodeHandler#HANDLE_404

The following examples show how to use io.undertow.server.handlers.ResponseCodeHandler#HANDLE_404 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleUndertowLoadBalancer.java    From keycloak with Apache License 2.0 6 votes vote down vote up
private HttpHandler createHandler() throws Exception {

        // TODO: configurable options if needed
        String[] sessionIds = {AUTH_SESSION_ID, AUTH_SESSION_ID + LEGACY_COOKIE};
        int connectionsPerThread = 20;
        int problemServerRetry = 5; // In case of unavailable node, we will try to ping him every 5 seconds to check if it's back
        int maxTime = 3600000; // 1 hour for proxy request timeout, so we can debug the backend keycloak servers
        int requestQueueSize = 10;
        int cachedConnectionsPerThread = 10;
        int connectionIdleTimeout = 60;
        int maxRetryAttempts = backendNodes.size() - 1;

        lb = new CustomLoadBalancingClient(exchange -> exchange.getRequestHeaders().contains(Headers.UPGRADE), maxRetryAttempts)
                .setConnectionsPerThread(connectionsPerThread)
                .setMaxQueueSize(requestQueueSize)
                .setSoftMaxConnectionsPerThread(cachedConnectionsPerThread)
                .setTtl(connectionIdleTimeout)
                .setProblemServerRetry(problemServerRetry);
        for (String id : sessionIds) {
            lb.addSessionCookieName(id);
        }

        return new ProxyHandler(lb, maxTime, ResponseCodeHandler.HANDLE_404);
    }
 
Example 2
Source File: ResourceHandler.java    From quarkus-http with Apache License 2.0 4 votes vote down vote up
public ResourceHandler(ResourceManager resourceSupplier) {
    this(resourceSupplier, ResponseCodeHandler.HANDLE_404);
}
 
Example 3
Source File: ResourceHandler.java    From quarkus-http with Apache License 2.0 4 votes vote down vote up
public ResourceHandler(ResourceSupplier resourceSupplier) {
    this(resourceSupplier, ResponseCodeHandler.HANDLE_404);
}
 
Example 4
Source File: ResourceHandler.java    From quarkus-http with Apache License 2.0 4 votes vote down vote up
/**
 * You should use {@link ResourceHandler(ResourceManager)} instead.
 */
@Deprecated
public ResourceHandler() {
    this.next = ResponseCodeHandler.HANDLE_404;
}
 
Example 5
Source File: ResourceHandler.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public ResourceHandler(ResourceManager resourceSupplier) {
    this(resourceSupplier, ResponseCodeHandler.HANDLE_404);
}
 
Example 6
Source File: ResourceHandler.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public ResourceHandler(ResourceSupplier resourceSupplier) {
    this(resourceSupplier, ResponseCodeHandler.HANDLE_404);
}
 
Example 7
Source File: ResourceHandler.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * You should use {@link ResourceHandler(ResourceManager)} instead.
 */
@Deprecated
public ResourceHandler() {
    this.next = ResponseCodeHandler.HANDLE_404;
}
 
Example 8
Source File: WebSocketProtocolHandshakeHandler.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a new {@link WebSocketProtocolHandshakeHandler}
 *
 * @param callback The {@link WebSocketConnectionCallback} which will be executed once the handshake was
 *                 established
 */
public WebSocketProtocolHandshakeHandler(final WebSocketConnectionCallback callback) {
    this(callback, ResponseCodeHandler.HANDLE_404);
}
 
Example 9
Source File: WebSocketProtocolHandshakeHandler.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a new {@link WebSocketProtocolHandshakeHandler}
 *
 * @param handshakes The supported handshake methods
 * @param callback   The {@link WebSocketConnectionCallback} which will be executed once the handshake was
 *                   established
 */
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, final WebSocketConnectionCallback callback) {
    this(handshakes, callback, ResponseCodeHandler.HANDLE_404);
}
 
Example 10
Source File: WebSocketProtocolHandshakeHandler.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a new {@link WebSocketProtocolHandshakeHandler}
 *
 * @param callback The {@link WebSocketConnectionCallback} which will be executed once the handshake was
 *                 established
 */
public WebSocketProtocolHandshakeHandler(final HttpUpgradeListener callback) {
    this(callback, ResponseCodeHandler.HANDLE_404);
}
 
Example 11
Source File: WebSocketProtocolHandshakeHandler.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a new {@link WebSocketProtocolHandshakeHandler}
 *
 * @param handshakes The supported handshake methods
 * @param callback   The {@link WebSocketConnectionCallback} which will be executed once the handshake was
 *                   established
 */
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, final HttpUpgradeListener callback) {
    this(handshakes, callback, ResponseCodeHandler.HANDLE_404);
}