Skip to content

Commit

Permalink
Merge pull request #7312 from davidradl/git7229
Browse files Browse the repository at this point in the history
#7229 do not create a 2nd unneeded default audit log destination, when adding an audit log destination
  • Loading branch information
davidradl committed Jan 10, 2023
2 parents 014cc56 + f84e6e3 commit 400f94e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2776,7 +2776,7 @@ public VoidResponse addAuditLogDestination(String userId,
{
OMRSConfigurationFactory configurationFactory = new OMRSConfigurationFactory();

repositoryServicesConfig = configurationFactory.getDefaultRepositoryServicesConfig();
repositoryServicesConfig = configurationFactory.getDefaultRepositoryServicesConfig(false);
}

List<Connection> auditLogDestinations = repositoryServicesConfig.getAuditLogConnections();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,18 +353,31 @@ public CohortConfig getDefaultCohortConfig(String localServerName,
/**
* Returns a repository services config with the audit log set up.
*
* @param addDefaultAuditLog when set add a default audit log.
* @return minimally configured repository services config
*/
public RepositoryServicesConfig getDefaultRepositoryServicesConfig()
public RepositoryServicesConfig getDefaultRepositoryServicesConfig(boolean addDefaultAuditLog)
{
RepositoryServicesConfig repositoryServicesConfig = new RepositoryServicesConfig();

List<Connection> auditLogStoreConnections = new ArrayList<>();
if (addDefaultAuditLog)
{
List<Connection> auditLogStoreConnections = new ArrayList<>();
auditLogStoreConnections.add(connectorConfigurationFactory.getDefaultAuditLogConnection());
repositoryServicesConfig.setAuditLogConnections(auditLogStoreConnections);
}

auditLogStoreConnections.add(connectorConfigurationFactory.getDefaultAuditLogConnection());
return repositoryServicesConfig;
}

repositoryServicesConfig.setAuditLogConnections(auditLogStoreConnections);

return repositoryServicesConfig;
/**
* Returns a repository services config with the audit log set up.
*
* @return minimally configured repository services config
*/
public RepositoryServicesConfig getDefaultRepositoryServicesConfig()
{
return getDefaultRepositoryServicesConfig(true);
}
}

0 comments on commit 400f94e

Please sign in to comment.