Skip to content

Commit

Permalink
Merge pull request #1136 from thusithathilina/release-4.4.9
Browse files Browse the repository at this point in the history
CARBON-16038: Cherry-picked the fix from 4.4.x
  • Loading branch information
thusithathilina committed Aug 26, 2016
2 parents c20dcfc + a7df027 commit ef10837
Showing 1 changed file with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4091,25 +4091,26 @@ public void addSecondaryUserStoreManager(RealmConfiguration userStoreRealmConfig
return;
}

// Creating new UserStoreManager
UserStoreManager manager = createSecondaryUserStoreManager(userStoreRealmConfig, realm);
boolean isDisabled = Boolean.parseBoolean(userStoreRealmConfig
.getUserStoreProperty(UserCoreConstants.RealmConfig.USER_STORE_DISABLED));

String domainName = userStoreRealmConfig
.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_DOMAIN_NAME);

if (domainName != null) {
if (this.getSecondaryUserStoreManager(domainName) != null) {
String errmsg = "Could not initialize new user store manager : " + domainName
+ " Duplicate domain names not allowed.";
if (log.isDebugEnabled()) {
log.debug(errmsg);
}
throw new UserStoreException(errmsg);
} else {
boolean isDisabled = Boolean.parseBoolean(userStoreRealmConfig
.getUserStoreProperty(UserCoreConstants.RealmConfig.USER_STORE_DISABLED));
if (isDisabled) {
log.warn("Secondary user store disabled with domain " + domainName + ".");
if (isDisabled) {
log.warn("Secondary user store disabled with domain " + domainName + ".");
} else {
// Creating new UserStoreManager
UserStoreManager manager = createSecondaryUserStoreManager(userStoreRealmConfig, realm);

if (domainName != null) {
if (this.getSecondaryUserStoreManager(domainName) != null) {
String errmsg = "Could not initialize new user store manager : " + domainName
+ " Duplicate domain names not allowed.";
if (log.isDebugEnabled()) {
log.debug(errmsg);
}
throw new UserStoreException(errmsg);
} else {
// Fulfilled requirements for adding UserStore,

Expand All @@ -4127,10 +4128,10 @@ public void addSecondaryUserStoreManager(RealmConfiguration userStoreRealmConfig
log.debug("UserStoreManager : " + domainName + "added to the list");
}
}
} else {
log.warn("Could not initialize new user store manager. "
+ "Domain name is not defined");
}
} else {
log.warn("Could not initialize new user store manager. "
+ "Domain name is not defined");
}
}

Expand Down

0 comments on commit ef10837

Please sign in to comment.