public Boolean addRepositoryToGroup( String repositoryGroupId, String repositoryId,
AuditInformation auditInformation )
throws RepositoryAdminException
{
RepositoryGroup repositoryGroup = getRepositoryGroup( repositoryGroupId );
if ( repositoryGroup == null )
{
throw new RepositoryAdminException(
"repositoryGroup with id " + repositoryGroupId + " doesn't not exists so cannot add repository to it" );
}
if ( repositoryGroup.getRepositories().contains( repositoryId ) )
{
throw new RepositoryAdminException(
"repositoryGroup with id " + repositoryGroupId + " already contain repository with id" + repositoryId );
}
validateManagedRepositoriesExists( Arrays.asList( repositoryId ) );
repositoryGroup.addRepository( repositoryId );
updateRepositoryGroup( repositoryGroup, auditInformation, false );
triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.ADD_REPO_TO_GROUP, auditInformation );
return Boolean.TRUE;
}