From: Patrick Schmitz Date: Mon, 12 Mar 2012 20:23:38 +0000 (-0700) Subject: CSPACE-4192 - Ensure tenant ID values are unique at startup. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=77f93dd0443ec52dac84bdcc8bb628b3eb1090f2;p=tmp%2Fjakarta-migration.git CSPACE-4192 - Ensure tenant ID values are unique at startup. --- diff --git a/services/common/src/main/java/org/collectionspace/services/common/config/TenantBindingConfigReaderImpl.java b/services/common/src/main/java/org/collectionspace/services/common/config/TenantBindingConfigReaderImpl.java index 1cd35ed80..dfbb4fe1f 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/config/TenantBindingConfigReaderImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/common/config/TenantBindingConfigReaderImpl.java @@ -177,6 +177,14 @@ public class TenantBindingConfigReaderImpl tenantBindingTypeList = readTenantConfigs(protoBindingsFile, tenantDirs); for (TenantBindingType tenantBinding : tenantBindingTypeList) { + if(tenantBindings.get(tenantBinding.getId()) != null) { + TenantBindingType tenantBindingOld = tenantBindings.get(tenantBinding.getId()); + logger.error("Ignoring duplicate binding definition for tenant id=" + + tenantBinding.getId() + + " existing name=" + tenantBindingOld.getName() + + " conflicting (ignored) name=" + tenantBinding.getName()); + continue; + } tenantBindings.put(tenantBinding.getId(), tenantBinding); readDomains(tenantBinding); readServiceBindings(tenantBinding);