You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@archiva.apache.org by Brett Porter <br...@apache.org> on 2007/10/22 01:45:14 UTC

Re: svn commit: r586919 - in /maven/archiva/trunk: archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ archiva-database/src/main/java/org/apache/maven/archiva/database/ archiva-database/src/m...

Hi Deng,

On 22/10/2007, at 3:30 AM, oching@apache.org wrote:

> @@ -89,13 +105,12 @@
>          try
>          {
>              Configuration configuration =  
> archivaConfiguration.getConfiguration();
> +            cleanupRepositoryData( existingRepository );
>              removeRepository( repoid, configuration );
>              result = saveConfiguration( configuration );
>
>              if ( result.equals( SUCCESS ) )
>              {
> -                cleanupRepositoryData( existingRepository );
> -

Can you just clarify why this was moved?

>      private void cleanupRepositoryData 
> ( ManagedRepositoryConfiguration cleanupRepository )
> -        throws RoleManagerException
> +        throws RoleManagerException, ArchivaDatabaseException
>      {
>          removeRepositoryRoles( cleanupRepository );
>
>          // TODO: [MRM-382] Remove index from artifacts of deleted  
> managed repositories.
>
> -        // TODO: [MRM-265] After removing a managed repository -  
> Browse/Search still see it
> -
> +        // [MRM-265] After removing a managed repository - Browse/ 
> Search still see it
> +        cleanupDatabase( cleanupRepository.getId() );
> +        cleanupScanStats( cleanupRepository.getId() );
> +
>          // [MRM-520] Proxy Connectors are not deleted with the  
> deletion of a Repository.
>          List<ProxyConnectorConfiguration> proxyConnectors =  
> getProxyConnectors();
>          for ( ProxyConnectorConfiguration proxyConnector :  
> proxyConnectors )

Just a general note (not specific to this commit) - we need to start  
thinking about the accumulation of logic in the web actions and  
shuffle it over to the business layer.

Thanks!

Cheers,
Brett

--
Brett Porter - brett@apache.org
Blog: http://www.devzuz.org/blogs/bporter/

Re: svn commit: r586919 - in /maven/archiva/trunk: archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ archiva-database/src/main/java/org/apache/maven/archiva/database/ archiva-database/src/m...

Posted by Brett Porter <br...@apache.org>.
On 22/10/2007, at 10:42 AM, Maria Odea Ching wrote:

> Hi Brett,
>
> I thought that if there was a problem cleaning up the repository  
> data, the delete of the repo shouldn't proceed.. or should it? :-)

That makes sense - I just wanted to check if there was anything else.

My only concern is the saveConfiguration method returning something  
other than success and the repository will still be configured but  
most of the data deleted. I'm not sure if that's possible, though :)

Anyway, this should be fine for now - if we do push these back from  
the web layer we should ensure we have some more testing around the  
exception cases.

Thanks,
Brett

>
> Thanks,
> Deng
>
> Brett Porter wrote:
>> Hi Deng,
>>
>> On 22/10/2007, at 3:30 AM, oching@apache.org wrote:
>>
>>> @@ -89,13 +105,12 @@
>>> try
>>> {
>>> Configuration configuration =  
>>> archivaConfiguration.getConfiguration();
>>> + cleanupRepositoryData( existingRepository );
>>> removeRepository( repoid, configuration );
>>> result = saveConfiguration( configuration );
>>>
>>> if ( result.equals( SUCCESS ) )
>>> {
>>> - cleanupRepositoryData( existingRepository );
>>> -
>>
>> Can you just clarify why this was moved?

Re: svn commit: r586919 - in /maven/archiva/trunk: archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ archiva-database/src/main/java/org/apache/maven/archiva/database/ archiva-database/src/m...

Posted by Maria Odea Ching <oc...@exist.com>.
Hi Brett,

I thought that if there was a problem cleaning up the repository data, 
the delete of the repo shouldn't proceed.. or should it? :-)

Thanks,
Deng

Brett Porter wrote:
> Hi Deng,
>
> On 22/10/2007, at 3:30 AM, oching@apache.org wrote:
>
>> @@ -89,13 +105,12 @@
>> try
>> {
>> Configuration configuration = archivaConfiguration.getConfiguration();
>> + cleanupRepositoryData( existingRepository );
>> removeRepository( repoid, configuration );
>> result = saveConfiguration( configuration );
>>
>> if ( result.equals( SUCCESS ) )
>> {
>> - cleanupRepositoryData( existingRepository );
>> -
>
> Can you just clarify why this was moved?
>
>> private void cleanupRepositoryData( ManagedRepositoryConfiguration 
>> cleanupRepository )
>> - throws RoleManagerException
>> + throws RoleManagerException, ArchivaDatabaseException
>> {
>> removeRepositoryRoles( cleanupRepository );
>>
>> // TODO: [MRM-382] Remove index from artifacts of deleted managed 
>> repositories.
>>
>> - // TODO: [MRM-265] After removing a managed repository - 
>> Browse/Search still see it
>> -
>> + // [MRM-265] After removing a managed repository - Browse/Search 
>> still see it
>> + cleanupDatabase( cleanupRepository.getId() );
>> + cleanupScanStats( cleanupRepository.getId() );
>> +
>> // [MRM-520] Proxy Connectors are not deleted with the deletion of a 
>> Repository.
>> List<ProxyConnectorConfiguration> proxyConnectors = 
>> getProxyConnectors();
>> for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
>
> Just a general note (not specific to this commit) - we need to start 
> thinking about the accumulation of logic in the web actions and 
> shuffle it over to the business layer.
>
> Thanks!
>
> Cheers,
> Brett
>
> -- 
> Brett Porter - brett@apache.org
> Blog: http://www.devzuz.org/blogs/bporter/
>