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

org.infinispan.server.configuration.security.RealmsConfiguration Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev05
Show newest version
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());
      }
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy