* @author Olivier Lamy
* @since 1.4-M2
*/
-@Service( "indexMerger#default" )
+@Service("indexMerger#default")
public class DefaultIndexMerger
implements IndexMerger
{
private List<TemporaryGroupIndex> temporaryGroupIndexes = new CopyOnWriteArrayList<TemporaryGroupIndex>();
- private int defaultGroupIndexTtl;
+ private int groupMergedIndexTtl;
@Inject
public DefaultIndexMerger( PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils )
@PostConstruct
public void intialize()
{
- String ttlStr =
- System.getProperty( IndexMerger.TMP_GROUP_INDEX_SYS_KEY, Integer.toString( DEFAULT_GROUP_INDEX_TTL ) );
- this.defaultGroupIndexTtl = NumberUtils.toInt( ttlStr, DEFAULT_GROUP_INDEX_TTL );
-
+ this.groupMergedIndexTtl = Integer.getInteger( IndexMerger.TMP_GROUP_INDEX_SYS_KEY, DEFAULT_GROUP_INDEX_TTL );
}
public IndexingContext buildMergedIndex( Collection<String> repositoriesIds, boolean packIndex )
public int getGroupMergedIndexTtl()
{
- return this.defaultGroupIndexTtl;
+ return this.groupMergedIndexTtl;
}
}
import org.codehaus.plexus.digest.DigesterException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MarkerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
/**
*
*/
-@Service ("davResourceFactory#archiva")
+@Service("davResourceFactory#archiva")
public class ArchivaDavResourceFactory
implements DavResourceFactory, Auditable
{
*
*/
@Inject
- @Named (value = "repositoryProxyConnectors#default")
+ @Named(value = "repositoryProxyConnectors#default")
private RepositoryProxyConnectors connectors;
/**
*
*/
@Inject
- @Named (value = "httpAuthenticator#basic")
+ @Named(value = "httpAuthenticator#basic")
private HttpAuthenticator httpAuth;
@Inject
*
*/
@Inject
- @Named (value = "archivaTaskScheduler#repository")
+ @Named(value = "archivaTaskScheduler#repository")
private RepositoryArchivaTaskScheduler scheduler;
private ApplicationContext applicationContext;
if ( System.currentTimeMillis() - tmp.getCreationTime() > ( indexMerger.getGroupMergedIndexTtl() * 60
* 1000 ) )
{
- log.debug( "tmp group index is too old so delete it" );
+ log.debug( MarkerFactory.getDetachedMarker( "group.merged.index" ),
+ "tmp group index '{}' is too old so delete it", groupId );
indexMerger.cleanTemporaryGroupIndex( tmp );
}
else
{
+ log.debug( MarkerFactory.getDetachedMarker( "group.merged.index" ),
+ "merged index for group '{}' found in cache", groupId );
return tmp.getDirectory();
}
}