public RealmConfiguration getRealmConfigForTenantToPersist(RealmConfiguration bootStrapConfig,
TenantMgtConfiguration tenantMgtConfig,
Tenant tenantInfo, int tenantId)
throws UserStoreException {
RealmConfiguration realmConfig;
try {
realmConfig = bootStrapConfig.cloneRealmConfiguration();
realmConfig.setAdminUserName(tenantInfo.getAdminName());
realmConfig.setAdminPassword(UUIDGenerator.getUUID());
Map<String, String> realmProps = realmConfig.getRealmProperties();
realmProps.remove(JDBCRealmConstants.URL);
realmProps.remove(JDBCRealmConstants.DRIVER_NAME);
realmProps.remove(JDBCRealmConstants.USER_NAME);
realmProps.remove(JDBCRealmConstants.PASSWORD);
realmProps.remove(WSRemoteUserMgtConstants.SERVER_URL);
realmProps.remove(WSRemoteUserMgtConstants.USER_NAME);
realmProps.remove(WSRemoteUserMgtConstants.PASSWORD);
realmProps.remove(WSRemoteUserMgtConstants.SINGLE_USER_AUTHENTICATION);
realmProps.put("MultiTenantRealmConfigBuilder", IdaasWSRealmConfigBuilder.class.getName());
realmConfig.setTenantId(tenantId);
if (log.isDebugEnabled()) {
OMElement omElement = RealmConfigXMLProcessor.serialize(realmConfig);
log.debug("Saving RealmConfiguration **** " + omElement.toString());
}