All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wildfly.clustering.web.undertow.session.SimpleSessionConfig Maven / Gradle / Ivy

Go to download

This module adapts an implementation of wildfly-clustering-web-spi to the Undertow servlet container.

There is a newer version: 34.0.0.Final
Show newest version
/*
 * Copyright The WildFly Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package org.wildfly.clustering.web.undertow.session;

import io.undertow.server.HttpServerExchange;
import io.undertow.server.session.SessionConfig;

/**
 * {@link SessionConfig} implementation that returns a fixed sessionId.
 * @author Paul Ferraro
 */
public class SimpleSessionConfig implements SessionConfig {

    private final String sessionId;

    public SimpleSessionConfig(String sessionId) {
        this.sessionId = sessionId;
    }

    @Override
    public void setSessionId(HttpServerExchange exchange, String sessionId) {
        // No-op
    }

    @Override
    public void clearSession(HttpServerExchange exchange, String sessionId) {
        // No-op
    }

    @Override
    public String findSessionId(HttpServerExchange exchange) {
        return this.sessionId;
    }

    @Override
    public SessionCookieSource sessionCookieSource(HttpServerExchange exchange) {
        return SessionCookieSource.NONE;
    }

    @Override
    public String rewriteUrl(String originalUrl, String sessionId) {
        return originalUrl;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy