org.infinispan.server.configuration.security.RealmsConfiguration Maven / Gradle / Ivy
package org.infinispan.server.configuration.security;
import java.util.Map;
import java.util.Properties;
import org.infinispan.server.Server;
import org.infinispan.server.core.logging.Log;
/**
* @since 10.0
*/
public class RealmsConfiguration {
private final Map realms;
RealmsConfiguration(Map realms) {
this.realms = realms;
}
public Map realms() {
return realms;
}
public RealmConfiguration getRealm(String name) {
RealmConfiguration realm = realms.get(name);
if (realm == null) {
throw Server.log.unknownSecurityDomain(name);
} else {
return realm;
}
}
void init(SecurityConfiguration security, Properties properties) {
for(RealmConfiguration realm : realms.values()) {
realm.init(security, properties);
}
}
public void flushRealmCaches() {
for(RealmConfiguration realm : realms.values()) {
realm.flushCache();
Log.SERVER.flushRealmCache(realm.name());
}
}
}