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

org.wildfly.clustering.session.cache.affinity.UnarySessionAffinity Maven / Gradle / Ivy

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

package org.wildfly.clustering.session.cache.affinity;

import java.util.function.Function;
import java.util.function.UnaryOperator;

import org.wildfly.clustering.server.GroupMember;

/**
 * Session affinity to a multiple members.
 * @param  the group member type
 * @author Paul Ferraro
 */
public class UnarySessionAffinity implements UnaryOperator {

	private Function affinity;
	private Function mapper;

	public UnarySessionAffinity(Function affinity, Function mapper) {
		this.affinity = affinity;
		this.mapper = mapper;
	}

	@Override
	public String apply(String id) {
		return this.affinity.andThen(this.mapper).apply(id);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy