Commit 42b17fe1 authored by michael.simon's avatar michael.simon
Browse files

Filter empty federations

parent e651989d
......@@ -53,11 +53,12 @@ public class FederationSingletonBean {
public void refreshCache() {
if (System.currentTimeMillis() - lastRefresh > 1000L * 60L * 60L) {
sortedFederationList = federationDao.findAll();
List<FederationEntity> tempFederationList = federationDao.findAll();
sortedFederationList = new ArrayList<FederationEntity>();
idpMap.clear();
for (FederationEntity federation : sortedFederationList) {
for (FederationEntity federation : tempFederationList) {
logger.info("Loading federation {} ({})", federation.getId(), federation.getEntityId());
List<SamlIdpMetadataEntity> idpList = idpDao.findAllByFederationOrderByOrgname(federation);
......@@ -65,6 +66,10 @@ public class FederationSingletonBean {
for (SamlIdpMetadataEntity idp : idpList) {
idpMap.put(idp.getEntityId(), idp);
}
if (idpList.size() > 0) {
sortedFederationList.add(federation);
}
}
lastRefresh = System.currentTimeMillis();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment