private TaskQueueManager taskQueueManager;
public LocalRepository addLocalRepository( LocalRepository localRepository )
throws RepositoryServiceException
{
LocalRepository repository = null;
try
{
List<LocalRepository> repos = getAllLocalRepositories();
for ( LocalRepository repo : repos )
{
if ( repo.getName().equals( localRepository.getName() ) )
{
throw new RepositoryServiceException( "Local repository name must be unique" );
}
if ( repo.getLocation().equals( localRepository.getLocation() ) )
{
throw new RepositoryServiceException( "Local repository location must be unique" );
}
}
localRepository.setName( localRepository.getName().trim() );
localRepository.setLocation( localRepository.getLocation().trim() );
repository = localRepositoryDao.addLocalRepository( localRepository );
log.info( "Added new local repository: " + repository.getName() );
}
catch ( ContinuumStoreException e )
{
throw new RepositoryServiceException( "Unable to add the requested local repository", e );
}