org.wildfly.clustering.web.undertow.IdentifierFactoryAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wildfly-clustering-web-undertow Show documentation
Show all versions of wildfly-clustering-web-undertow Show documentation
This module adapts an implementation of wildfly-clustering-web-spi to the Undertow servlet container.
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.wildfly.clustering.web.undertow;
import io.undertow.server.session.SessionIdGenerator;
import java.util.function.Supplier;
/**
* Adapts a {@link SessionIdGenerator} to a {@link IdentifierFactory}.
* @author Paul Ferraro
*/
public class IdentifierFactoryAdapter implements Supplier {
private final SessionIdGenerator generator;
public IdentifierFactoryAdapter(SessionIdGenerator generator) {
this.generator = generator;
}
@Override
public String get() {
return this.generator.createSessionId();
}
}