Turning down the noise in the log.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@548828 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joakim Erdfelt 2007-06-19 19:14:37 +00:00
parent a19f5c6e86
commit 0c58a1c253
3 changed files with 35 additions and 47 deletions

View File

@ -71,8 +71,8 @@ public class ProjectModel400Reader
if ( !"http://maven.apache.org/POM/4.0.0".equals( xml.getDefaultNamespaceURI() ) ) if ( !"http://maven.apache.org/POM/4.0.0".equals( xml.getDefaultNamespaceURI() ) )
{ {
// No namespace defined
// TODO: Output to monitor the problem with the Namespace. // TODO: Output to monitor the problem with the Namespace.
System.out.println( "No namespace defined: " + pomFile );
} }
xml.removeNamespaces(); xml.removeNamespaces();
@ -220,16 +220,11 @@ public class ProjectModel400Reader
if ( dependencyList.contains( dependency ) ) if ( dependencyList.contains( dependency ) )
{ {
// TODO: throw into monitor as issue. // TODO: throw into monitor as issue.
System.err.println( "Duplicate non-unique dependency detected [" + StringUtils.join( parts, ":" )
+ "]: " + toDependencyKey( dependency ) );
} }
dependencyList.add( dependency ); dependencyList.add( dependency );
System.out.println( "Added (list.size:" + dependencyList.size() + ") dependency: "
+ toDependencyKey( dependency ) );
} }
System.out.println( "## Returning dependency list: size=" + dependencyList.size() );
return dependencyList; return dependencyList;
} }
@ -559,11 +554,4 @@ public class ProjectModel400Reader
return defaultValue; return defaultValue;
} }
} }
private String toDependencyKey( Dependency dep )
{
return "[" + dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getVersion() + ":" + dep.getClassifier()
+ ":" + dep.getType() + "]";
}
} }

View File

@ -19,15 +19,12 @@ package org.apache.maven.archiva.web.action.admin.database;
* under the License. * under the License.
*/ */
import java.io.IOException; import com.opensymphony.xwork.Preparable;
import java.util.Collections;
import java.util.List;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.DatabaseScanningConfiguration; import org.apache.maven.archiva.configuration.DatabaseScanningConfiguration;
import org.apache.maven.archiva.configuration.InvalidConfigurationException;
import org.apache.maven.archiva.database.updater.DatabaseConsumers; import org.apache.maven.archiva.database.updater.DatabaseConsumers;
import org.apache.maven.archiva.security.ArchivaRoleConstants; import org.apache.maven.archiva.security.ArchivaRoleConstants;
import org.apache.maven.archiva.web.action.admin.scanning.AdminRepositoryConsumerComparator; import org.apache.maven.archiva.web.action.admin.scanning.AdminRepositoryConsumerComparator;
@ -35,10 +32,10 @@ import org.codehaus.plexus.redback.rbac.Resource;
import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; import org.codehaus.plexus.redback.xwork.interceptor.SecureAction;
import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException;
import org.codehaus.plexus.registry.RegistryException;
import org.codehaus.plexus.xwork.action.PlexusActionSupport; import org.codehaus.plexus.xwork.action.PlexusActionSupport;
import com.opensymphony.xwork.Preparable; import java.util.Collections;
import java.util.List;
/** /**
* DatabaseAction * DatabaseAction
@ -94,9 +91,6 @@ public class DatabaseAction
AddAdminDatabaseConsumerClosure addAdminDbConsumer; AddAdminDatabaseConsumerClosure addAdminDbConsumer;
getLogger().info( "Total Available Unprocessed Consumers: " + databaseConsumers.getAvailableUnprocessedConsumers().size() );
getLogger().info( "Total Available Cleanup Consumers: " + databaseConsumers.getAvailableCleanupConsumers().size() );
addAdminDbConsumer = new AddAdminDatabaseConsumerClosure( dbscanning.getUnprocessedConsumers() ); addAdminDbConsumer = new AddAdminDatabaseConsumerClosure( dbscanning.getUnprocessedConsumers() );
CollectionUtils.forAllDo( databaseConsumers.getAvailableUnprocessedConsumers(), addAdminDbConsumer ); CollectionUtils.forAllDo( databaseConsumers.getAvailableUnprocessedConsumers(), addAdminDbConsumer );
this.unprocessedConsumers = addAdminDbConsumer.getList(); this.unprocessedConsumers = addAdminDbConsumer.getList();
@ -110,8 +104,6 @@ public class DatabaseAction
public String updateUnprocessedConsumers() public String updateUnprocessedConsumers()
{ {
getLogger().info( "updateUnprocesedConsumers()" );
archivaConfiguration.getConfiguration().getDatabaseScanning().setUnprocessedConsumers( enabledUnprocessedConsumers ); archivaConfiguration.getConfiguration().getDatabaseScanning().setUnprocessedConsumers( enabledUnprocessedConsumers );
return saveConfiguration(); return saveConfiguration();
@ -119,8 +111,6 @@ public class DatabaseAction
public String updateCleanupConsumers() public String updateCleanupConsumers()
{ {
getLogger().info( "updateCleanupConsumers()" );
archivaConfiguration.getConfiguration().getDatabaseScanning().setCleanupConsumers( enabledCleanupConsumers ); archivaConfiguration.getConfiguration().getDatabaseScanning().setCleanupConsumers( enabledCleanupConsumers );
return saveConfiguration(); return saveConfiguration();
@ -128,8 +118,6 @@ public class DatabaseAction
public String updateSchedule() public String updateSchedule()
{ {
getLogger().info( "updateSchedule()" );
archivaConfiguration.getConfiguration().getDatabaseScanning().setCronExpression( cron ); archivaConfiguration.getConfiguration().getDatabaseScanning().setCronExpression( cron );
return saveConfiguration(); return saveConfiguration();
@ -137,8 +125,6 @@ public class DatabaseAction
private String saveConfiguration() private String saveConfiguration()
{ {
getLogger().info( ".saveConfiguration()" );
try try
{ {
archivaConfiguration.save( archivaConfiguration.getConfiguration() ); archivaConfiguration.save( archivaConfiguration.getConfiguration() );

View File

@ -139,9 +139,12 @@ public class RepositoryServlet
} }
public RepositoryConfiguration getRepository( DavServerRequest request ) public RepositoryConfiguration getRepository( DavServerRequest request )
{
synchronized ( this.repositoryMap )
{ {
return (RepositoryConfiguration) repositoryMap.get( request.getPrefix() ); return (RepositoryConfiguration) repositoryMap.get( request.getPrefix() );
} }
}
public String getRepositoryName( DavServerRequest request ) public String getRepositoryName( DavServerRequest request )
{ {
@ -160,9 +163,12 @@ public class RepositoryServlet
Closure localRepoMap = IfClosure.getInstance( LocalRepositoryPredicate.getInstance(), repoMapClosure ); Closure localRepoMap = IfClosure.getInstance( LocalRepositoryPredicate.getInstance(), repoMapClosure );
CollectionUtils.forAllDo( configuration.getConfiguration().getRepositories(), localRepoMap ); CollectionUtils.forAllDo( configuration.getConfiguration().getRepositories(), localRepoMap );
synchronized ( this.repositoryMap )
{
this.repositoryMap.clear(); this.repositoryMap.clear();
this.repositoryMap.putAll( repoMapClosure.getMap() ); this.repositoryMap.putAll( repoMapClosure.getMap() );
} }
}
public boolean isAuthenticated( DavServerRequest davRequest, HttpServletResponse response ) public boolean isAuthenticated( DavServerRequest davRequest, HttpServletResponse response )
throws ServletException, IOException throws ServletException, IOException
@ -227,7 +233,8 @@ public class RepositoryServlet
if ( authzResult.getException() != null ) if ( authzResult.getException() != null )
{ {
log( "Authorization Denied [ip=" + request.getRemoteAddr() + ",isWriteRequest=" + isWriteRequest log( "Authorization Denied [ip=" + request.getRemoteAddr() + ",isWriteRequest=" + isWriteRequest
+ ",permission=" + permission + ",repo=" + davRequest.getPrefix() + "] : " + authzResult.getException().getMessage() ); + ",permission=" + permission + ",repo=" + davRequest.getPrefix() + "] : "
+ authzResult.getException().getMessage() );
} }
// Issue HTTP Challenge. // Issue HTTP Challenge.
@ -252,6 +259,11 @@ public class RepositoryServlet
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
{ {
if ( ConfigurationNames.isRepositories( propertyName ) ) if ( ConfigurationNames.isRepositories( propertyName ) )
{
// Attempt to reduce the number of times we refresh the repository map.
if ( propertyName.endsWith( ".id" ) || propertyName.endsWith( ".url" ) )
{
synchronized ( this.repositoryMap )
{ {
updateRepositoryMap(); updateRepositoryMap();
@ -263,8 +275,10 @@ public class RepositoryServlet
} }
catch ( DavServerException e ) catch ( DavServerException e )
{ {
log( "Error restarting WebDAV server after configuration change - service disabled: " + e.getMessage(), log( "Error restarting WebDAV server after configuration change - service disabled: "
e ); + e.getMessage(), e );
}
}
} }
} }
} }