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

pl.edu.icm.unity.saml.idp.TrustedServiceProviders Maven / Gradle / Ivy

There is a newer version: 4.0.4
Show newest version
/*
 * Copyright (c) 2018 Bixbit - Krzysztof Benedyczak. All rights reserved.
 * See LICENCE.txt file for licensing information.
 */
package pl.edu.icm.unity.saml.idp;

import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

public class TrustedServiceProviders
{
	private final Map entityIdToSPConfiguration;

	public TrustedServiceProviders(Collection trustedSPs)
	{
		this.entityIdToSPConfiguration = trustedSPs.stream()
				.collect(Collectors.toMap(sp -> sp.entityId, sp -> sp));
	}

	public TrustedServiceProvider getSPConfig(SamlEntityId entityId)
	{
		return entityIdToSPConfiguration.get(entityId);
	}

	public Set getSPConfigs()
	{
		return Set.copyOf(entityIdToSPConfiguration.values());
	}

	public void replace(Set trustedIdPs)
	{
		trustedIdPs.forEach(config -> entityIdToSPConfiguration.put(config.entityId, config));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy