<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-artifact-converter</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-checksum</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-common</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-configuration</artifactId>
<defaultValue>/.indexer</defaultValue>
<description>The path of the merged index.</description>
</field>
+ <field>
+ <name>mergedIndexTtl</name>
+ <version>1.4.0+</version>
+ <type>int</type>
+ <required>false</required>
+ <defaultValue>30</defaultValue>
+ <description>The time to live of the merged index of the repository group.</description>
+ </field>
<field>
<name>repositories</name>
<version>1.2.0+</version>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-consumers</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-consumer-api</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-consumers</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-consumer-archetype</artifactId>
<packaging>maven-archetype</packaging>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-consumers</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-core-consumers</artifactId>
<packaging>bundle</packaging>
return false;
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
return null;
}
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-consumers</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-lucene-consumers</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>archiva-consumers</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-metadata-consumer</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-consumers</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-signature-consumers</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-consumers</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-converter</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-indexer</artifactId>
*/
import com.google.common.io.Files;
+
import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
-import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.io.File;
import java.io.IOException;
private List<TemporaryGroupIndex> temporaryGroupIndexes = new CopyOnWriteArrayList<TemporaryGroupIndex>();
- private int groupMergedIndexTtl;
-
@Inject
public DefaultIndexMerger( PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils )
throws PlexusSisuBridgeException
indexPacker = plexusSisuBridge.lookup( IndexPacker.class, "default" );
}
- @PostConstruct
- public void intialize()
- {
- this.groupMergedIndexTtl = Integer.getInteger( IndexMerger.TMP_GROUP_INDEX_SYS_KEY, DEFAULT_GROUP_INDEX_TTL );
- }
-
public IndexingContext buildMergedIndex( IndexMergerRequest indexMergerRequest )
throws IndexMergerException
{
indexPacker.packIndex( request );
}
temporaryGroupIndexes.add(
- new TemporaryGroupIndex( tempRepoFile, tempRepoId, indexMergerRequest.getGroupId() ) );
+ new TemporaryGroupIndex( tempRepoFile, tempRepoId, indexMergerRequest.getGroupId(), indexMergerRequest.getMergedIndexTtl() ) );
stopWatch.stop();
log.info( "merged index for repos {} in {} s", indexMergerRequest.getRepositoriesIds(),
stopWatch.getTime() );
{
return this.temporaryGroupIndexes;
}
-
- public int getGroupMergedIndexTtl()
- {
- return this.groupMergedIndexTtl;
- }
}
*/
public interface IndexMerger
{
-
- /**
- * system property which contains the value in s for ttl of temporary index groups
- */
- String TMP_GROUP_INDEX_SYS_KEY = "archiva.tmp.group.index.ttl";
-
/**
* @param indexMergerRequest
* @return a temporary directory with a merge index (directory marked deleteOnExit)
void cleanTemporaryGroupIndex( TemporaryGroupIndex temporaryGroupIndex );
Collection<TemporaryGroupIndex> getTemporaryGroupIndexes();
-
- /**
- * @return ttl of temporay group index
- */
- int getGroupMergedIndexTtl();
-
}
private String mergedIndexPath = "/.indexer";
+ private int mergedIndexTtl;
+
public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId )
{
this.repositoriesIds = repositoriesIds;
/**
* @since 1.4-M4
*/
- public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId,
- String mergedIndexPath )
+ public IndexMergerRequest(Collection<String> repositoriesIds, boolean packIndex, String groupId,
+ String mergedIndexPath, int mergedIndexTtl)
{
this.repositoriesIds = repositoriesIds;
this.packIndex = packIndex;
this.groupId = groupId;
this.mergedIndexPath = mergedIndexPath;
+ this.mergedIndexTtl = mergedIndexTtl;
}
public Collection<String> getRepositoriesIds()
this.mergedIndexPath = mergedIndexPath;
}
+ public int getMergedIndexTtl() {
+ return mergedIndexTtl;
+ }
+
+ public void setMergedIndexTtl(int mergedIndexTtl) {
+ this.mergedIndexTtl = mergedIndexTtl;
+ }
+
@Override
public String toString()
{
sb.append( ", packIndex=" ).append( packIndex );
sb.append( ", groupId='" ).append( groupId ).append( '\'' );
sb.append( ", mergedIndexPath='" ).append( mergedIndexPath ).append( '\'' );
+ sb.append( ", mergedIndexTtl='" ).append( mergedIndexTtl ).append( '\'' );
sb.append( '}' );
return sb.toString();
}
private String groupId;
- public TemporaryGroupIndex( File directory, String indexId, String groupId )
+ private int mergedIndexTtl;
+
+ public TemporaryGroupIndex(File directory, String indexId, String groupId, int mergedIndexTtl)
{
this.directory = directory;
this.indexId = indexId;
this.groupId = groupId;
+ this.mergedIndexTtl = mergedIndexTtl;
}
public long getCreationTime()
this.groupId = groupId;
}
+ public int getMergedIndexTtl() {
+ return mergedIndexTtl;
+ }
+
+ public void setMergedIndexTtl(int mergedIndexTtl) {
+ this.mergedIndexTtl = mergedIndexTtl;
+ }
+
@Override
public int hashCode()
{
for ( TemporaryGroupIndex temporaryGroupIndex : indexMerger.getTemporaryGroupIndexes() )
{
// cleanup files older than the ttl
- if ( new Date().getTime() - temporaryGroupIndex.getCreationTime() > indexMerger.getGroupMergedIndexTtl() )
+ if ( new Date().getTime() - temporaryGroupIndex.getCreationTime() > temporaryGroupIndex.getMergedIndexTtl() )
{
log.info( "cleanTemporaryIndex for groupId {}", temporaryGroupIndex.getGroupId() );
indexMerger.cleanTemporaryGroupIndex( temporaryGroupIndex );
return false; //To change body of implemented methods use File | Settings | File Templates.
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-maven2-metadata</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Archiva Base :: Maven 2 Metadata</name>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-maven2-model</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Archiva Base :: Maven 2 Model</name>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-model</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-plexus-bridge</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-policies</artifactId>
<parent>
<artifactId>archiva-base</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-proxy-api</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>archiva-base</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-proxy-common</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-proxy</artifactId>
return false;
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-repository-admin</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-repository-admin-api</artifactId>
<packaging>bundle</packaging>
*/
private String mergedIndexPath = "/.indexer";
+ /**
+ * The TTL (time to live) of the repo group's merged index.
+ */
+ private int mergedIndexTtl = 30;
+
public RepositoryGroup()
{
// no op
this.mergedIndexPath = mergedIndexPath;
}
- public RepositoryGroup mergedIndexPath( String mergedIndexPath )
- {
+ public int getMergedIndexTtl() {
+ return mergedIndexTtl;
+ }
+
+ /**
+ * Set the TTL of the repo group's merged index.
+ *
+ * @param mergedIndexTtl
+ */
+ public void setMergedIndexTtl(int mergedIndexTtl) {
+ this.mergedIndexTtl = mergedIndexTtl;
+ }
+
+ public RepositoryGroup mergedIndexPath( String mergedIndexPath ) {
this.mergedIndexPath = mergedIndexPath;
return this;
}
+ public RepositoryGroup mergedIndexTtl( int mergedIndexTtl ) {
+ this.mergedIndexTtl = mergedIndexTtl;
+ return this;
+ }
+
public boolean equals( Object other )
{
if ( this == other )
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-repository-admin</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-repository-admin-default</artifactId>
<packaging>bundle</packaging>
{
repositoriesGroups.add( new RepositoryGroup( repositoryGroupConfiguration.getId(), new ArrayList<String>(
repositoryGroupConfiguration.getRepositories() ) ).mergedIndexPath(
- repositoryGroupConfiguration.getMergedIndexPath() ) );
+ repositoryGroupConfiguration.getMergedIndexPath() ).mergedIndexTtl( repositoryGroupConfiguration.getMergedIndexTtl() ) );
}
return repositoriesGroups;
{
validateRepositoryGroup( repositoryGroup, false );
validateManagedRepositoriesExists( repositoryGroup.getRepositories() );
+
RepositoryGroupConfiguration repositoryGroupConfiguration = new RepositoryGroupConfiguration();
repositoryGroupConfiguration.setId( repositoryGroup.getId() );
repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
repositoryGroupConfiguration.setMergedIndexPath( repositoryGroup.getMergedIndexPath() );
+ repositoryGroupConfiguration.setMergedIndexTtl( repositoryGroup.getMergedIndexTtl() );
Configuration configuration = getArchivaConfiguration().getConfiguration();
configuration.addRepositoryGroup( repositoryGroupConfiguration );
saveConfiguration( configuration );
repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
repositoryGroupConfiguration.setMergedIndexPath( repositoryGroup.getMergedIndexPath() );
+ repositoryGroupConfiguration.setMergedIndexTtl( repositoryGroup.getMergedIndexTtl() );
configuration.addRepositoryGroup( repositoryGroupConfiguration );
saveConfiguration( configuration );
"Invalid character(s) found in identifier. Only the following characters are allowed: alphanumeric, '.', '-' and '_'" );
}
+ if ( repositoryGroup.getMergedIndexTtl() <= 0)
+ {
+ throw new RepositoryAdminException( "Merged Index TTL must be greater than 0." );
+ }
+
Configuration configuration = getArchivaConfiguration().getConfiguration();
if ( configuration.getRepositoryGroupsAsMap().containsKey( repoGroupId ) )
return false; //To change body of implemented methods use File | Settings | File Templates.
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
* under the License.
*/
+import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.admin.model.beans.RepositoryGroup;
import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+ // verify if default values were saved
+ assertEquals(30, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexTtl() );
+ assertEquals("/.indexer", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexPath() );
+
repositoryGroupAdmin.deleteRepositoryGroup( "repo-group-one", getFakeAuditInformation() );
assertEquals( 0, repositoryGroupAdmin.getRepositoriesGroups().size() );
managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
- RepositoryGroup repositoryGroup = new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one" ) );
+ RepositoryGroup repositoryGroup = new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one" ) )
+ .mergedIndexTtl( 20 ).mergedIndexPath( "/.nonDefaultPath" );
mockAuditListener.clearEvents();
assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
assertEquals( Arrays.asList( "test-new-one" ),
repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+ assertEquals( 20, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexTtl() );
+ assertEquals( "/.nonDefaultPath", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexPath() );
repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( "repo-group-one" );
assertNotNull( repositoryGroup );
}
}
-
@Test
- public void addAndDeleteGroupWithRemowingManagedRepo()
+ public void addAndDeleteGroupWithRemovedManagedRepo()
throws Exception
{
try
managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
}
}
+
+ @Test( expected = RepositoryAdminException.class )
+ public void testAddGroupWithInvalidMergedIndexTtl() throws Exception {
+ try {
+ ManagedRepository managedRepositoryOne =
+ getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
+
+ ManagedRepository managedRepositoryTwo =
+ getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
+
+ managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
+
+ managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
+
+ RepositoryGroup repositoryGroup =
+ new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) )
+ .mergedIndexTtl( -1 );
+
+ mockAuditListener.clearEvents();
+
+ repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+ }
+ finally
+ {
+ mockAuditListener.clearEvents();
+ managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
+ managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
+ }
+ }
+
+ @Test( expected = RepositoryAdminException.class )
+ public void testAddAndUpdateGroupWithInvalidMergedIndexTtl() throws Exception {
+ try {
+ ManagedRepository managedRepositoryOne =
+ getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
+
+ ManagedRepository managedRepositoryTwo =
+ getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
+
+ managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
+
+ managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
+
+ RepositoryGroup repositoryGroup =
+ new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) );
+
+ mockAuditListener.clearEvents();
+
+ repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+
+ assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
+ assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
+ assertEquals( 2, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
+ assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
+ repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+
+ // verify if default values were saved
+ assertEquals(30, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexTtl() );
+ assertEquals("/.indexer", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexPath() );
+
+ repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( "repo-group-one" );
+ assertNotNull( repositoryGroup );
+
+ repositoryGroup.mergedIndexTtl( -1 );
+
+ repositoryGroupAdmin.updateRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+ }
+ finally
+ {
+ mockAuditListener.clearEvents();
+ managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
+ managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
+ }
+ }
}
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-repository-admin</artifactId>
<name>Archiva Base :: Repository Admin</name>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-repository-layer</artifactId>
<parent>
<artifactId>archiva-base</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-repository-scanner</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>archiva-base</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-security-common</artifactId>
<parent>
<artifactId>archiva-base</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-test-utils</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-transaction</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-xml-tools</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-modules</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-base</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-karaf</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.archiva.karaf</groupId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-modules</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-karaf</artifactId>
<parent>
<artifactId>archiva-scheduler</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-scheduler-api</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>archiva-scheduler</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-scheduler-indexing</artifactId>
<packaging>bundle</packaging>
return false; //To change body of implemented methods use File | Settings | File Templates.
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
<parent>
<artifactId>archiva-scheduler</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-scheduler-repository-api</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>archiva-scheduler</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-scheduler-repository</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-modules</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-scheduler</artifactId>
~ specific language governing permissions and limitations
~ under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>archiva-rest</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-rest-api</artifactId>
<!-- DO NOT USE bundle packaging generated documentation is not included in the jar !!! -->
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-rest</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-rest-services</artifactId>
<packaging>bundle</packaging>
for ( org.apache.archiva.admin.model.beans.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() )
{
repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
- repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ) );
+ repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() )
+ .mergedIndexTtl( repoGroup.getMergedIndexTtl() ) );
}
return repositoriesGroups;
}
{
return repositoryGroupAdmin.addRepositoryGroup(
new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
- repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ),
- getAuditInformation() );
+ repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() )
+ .mergedIndexTtl( repoGroup.getMergedIndexTtl() ), getAuditInformation() );
}
catch ( RepositoryAdminException e )
{
{
return repositoryGroupAdmin.updateRepositoryGroup(
new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
- repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ),
- getAuditInformation() );
+ repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() )
+ .mergedIndexTtl( repoGroup.getMergedIndexTtl() ), getAuditInformation() );
}
catch ( RepositoryAdminException e )
{
managedRepositoriesService.addManagedRepository( managedRepository );
- RepositoryGroup repositoryGroup = new RepositoryGroup( "one", Arrays.asList( managedRepository.getId() ) );
+ RepositoryGroup repositoryGroup = new RepositoryGroup( "one", Arrays.asList( managedRepository.getId() ) )
+ .mergedIndexTtl( 40 );
service.addRepositoryGroup( repositoryGroup );
assertFalse( service.getRepositoriesGroups().isEmpty() );
assertEquals( 1, service.getRepositoriesGroups().size() );
+ assertEquals( 40, service.getRepositoriesGroups().get(0).getMergedIndexTtl() );
service.deleteRepositoryGroup( "one" );
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-rest</artifactId>
<name>Archiva Web :: REST support</name>
<parent>
<artifactId>archiva-web</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-rss</artifactId>
return false;
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
throw new UnsupportedOperationException();
}
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-security</artifactId>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-test-mocks</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
<name>Archiva Web :: Tests Mocks</name>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-web-common</artifactId>
repository-groups.grid.tab.title=Repository Groups
repository.group.delete.confirm=Are you sure to delete Repository Group {0} ?
repository.group.mergedIndexPath=Merged Index Path
+repository.group.mergedIndexTtl=Merged Index Time to Live (in Minutes)
#roles
roles.bulk.save.confirm=Are you sure to update {0} Role(s)
return false;
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
return null;
}
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-webapp-test</artifactId>
<packaging>pom</packaging>
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-webapp</artifactId>
<packaging>war</packaging>
<archiva.devMode>${archiva.devMode}</archiva.devMode>
<archiva.javascriptLog>${archiva.javascriptLog}</archiva.javascriptLog>
<archiva.logMissingI18n>${archiva.logMissingI18n}</archiva.logMissingI18n>
- <archiva.tmp.group.index.ttl>${archiva.groupIndexTtl}</archiva.tmp.group.index.ttl>
<!--
not needed as we use asyncLogger in configuration
<Log4jContextSelector>org.apache.logging.log4j.core.async.AsyncLoggerContextSelector</Log4jContextSelector>
-UL.jqueryFileTree {\r
- font-family: Verdana, sans-serif;\r
- font-size: 11px;\r
- line-height: 18px;\r
- padding: 0px;\r
- margin: 0px;\r
-}\r
-\r
-UL.jqueryFileTree LI {\r
- list-style: none;\r
- padding: 0px;\r
- padding-left: 20px;\r
- margin: 0px;\r
- white-space: nowrap;\r
-}\r
-\r
-UL.jqueryFileTree A {\r
- color: #333;\r
- text-decoration: none;\r
- display: block;\r
- padding: 0px 2px;\r
-}\r
-\r
-UL.jqueryFileTree A:hover {\r
- background: #BDF;\r
-}\r
-\r
-/* Core Styles */\r
-.jqueryFileTree LI.directory { background: url(images/folder-closed.gif) left top no-repeat; }\r
-.jqueryFileTree LI.expanded { background: url(images/folder.gif) left top no-repeat; }\r
-.jqueryFileTree LI.file { background: url(images/file.png) left top no-repeat; }\r
-.jqueryFileTree LI.wait { background: url(images/spinner.gif) left top no-repeat; }\r
-/* File Extensions*/\r
-.jqueryFileTree LI.ext_3gp { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_afp { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_afpa { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_asp { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_aspx { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_avi { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_bat { background: url(images/application.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_bmp { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_c { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_cfm { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_cgi { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_com { background: url(images/application.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_cpp { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_css { background: url(images/css.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_doc { background: url(images/doc.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_exe { background: url(images/application.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_gif { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_fla { background: url(images/flash.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_h { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_htm { background: url(images/html.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_html { background: url(images/html.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_jar { background: url(images/java.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_jpg { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_jpeg { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_js { background: url(images/script.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_lasso { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_log { background: url(images/txt.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_m4p { background: url(images/music.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mov { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mp3 { background: url(images/music.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mp4 { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mpg { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mpeg { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_ogg { background: url(images/music.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_pcx { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_pdf { background: url(images/pdf.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_php { background: url(images/php.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_png { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_ppt { background: url(images/ppt.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_psd { background: url(images/psd.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_pl { background: url(images/script.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_py { background: url(images/script.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_rb { background: url(images/ruby.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_rbx { background: url(images/ruby.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_rhtml { background: url(images/ruby.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_rpm { background: url(images/linux.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_ruby { background: url(images/ruby.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_sql { background: url(images/db.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_swf { background: url(images/flash.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_tif { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_tiff { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_txt { background: url(images/txt.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_vb { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_wav { background: url(images/music.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_wmv { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_xls { background: url(images/xls.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_xml { background: url(images/code.png) left top no-repeat; }\r
+UL.jqueryFileTree {
+ font-family: Verdana, sans-serif;
+ font-size: 11px;
+ line-height: 18px;
+ padding: 0px;
+ margin: 0px;
+}
+
+UL.jqueryFileTree LI {
+ list-style: none;
+ padding: 0px;
+ padding-left: 20px;
+ margin: 0px;
+ white-space: nowrap;
+}
+
+UL.jqueryFileTree A {
+ color: #333;
+ text-decoration: none;
+ display: block;
+ padding: 0px 2px;
+}
+
+UL.jqueryFileTree A:hover {
+ background: #BDF;
+}
+
+/* Core Styles */
+.jqueryFileTree LI.directory { background: url(images/folder-closed.gif) left top no-repeat; }
+.jqueryFileTree LI.expanded { background: url(images/folder.gif) left top no-repeat; }
+.jqueryFileTree LI.file { background: url(images/file.png) left top no-repeat; }
+.jqueryFileTree LI.wait { background: url(images/spinner.gif) left top no-repeat; }
+/* File Extensions*/
+.jqueryFileTree LI.ext_3gp { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_afp { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_afpa { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_asp { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_aspx { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_avi { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_bat { background: url(images/application.png) left top no-repeat; }
+.jqueryFileTree LI.ext_bmp { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_c { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_cfm { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_cgi { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_com { background: url(images/application.png) left top no-repeat; }
+.jqueryFileTree LI.ext_cpp { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_css { background: url(images/css.png) left top no-repeat; }
+.jqueryFileTree LI.ext_doc { background: url(images/doc.png) left top no-repeat; }
+.jqueryFileTree LI.ext_exe { background: url(images/application.png) left top no-repeat; }
+.jqueryFileTree LI.ext_gif { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_fla { background: url(images/flash.png) left top no-repeat; }
+.jqueryFileTree LI.ext_h { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_htm { background: url(images/html.png) left top no-repeat; }
+.jqueryFileTree LI.ext_html { background: url(images/html.png) left top no-repeat; }
+.jqueryFileTree LI.ext_jar { background: url(images/java.png) left top no-repeat; }
+.jqueryFileTree LI.ext_jpg { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_jpeg { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_js { background: url(images/script.png) left top no-repeat; }
+.jqueryFileTree LI.ext_lasso { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_log { background: url(images/txt.png) left top no-repeat; }
+.jqueryFileTree LI.ext_m4p { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mov { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mp3 { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mp4 { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mpg { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mpeg { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_ogg { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_pcx { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_pdf { background: url(images/pdf.png) left top no-repeat; }
+.jqueryFileTree LI.ext_php { background: url(images/php.png) left top no-repeat; }
+.jqueryFileTree LI.ext_png { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_ppt { background: url(images/ppt.png) left top no-repeat; }
+.jqueryFileTree LI.ext_psd { background: url(images/psd.png) left top no-repeat; }
+.jqueryFileTree LI.ext_pl { background: url(images/script.png) left top no-repeat; }
+.jqueryFileTree LI.ext_py { background: url(images/script.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rb { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rbx { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rhtml { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rpm { background: url(images/linux.png) left top no-repeat; }
+.jqueryFileTree LI.ext_ruby { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_sql { background: url(images/db.png) left top no-repeat; }
+.jqueryFileTree LI.ext_swf { background: url(images/flash.png) left top no-repeat; }
+.jqueryFileTree LI.ext_tif { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_tiff { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_txt { background: url(images/txt.png) left top no-repeat; }
+.jqueryFileTree LI.ext_vb { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_wav { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_wmv { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_xls { background: url(images/xls.png) left top no-repeat; }
+.jqueryFileTree LI.ext_xml { background: url(images/code.png) left top no-repeat; }
.jqueryFileTree LI.ext_zip { background: url(images/zip.png) left top no-repeat; }
\ No newline at end of file
data-bind="value: repositoryGroup.mergedIndexPath"/>
</div>
</div>
+ <div class="control-group">
+ <label class="control-label" for="mergedIndexPath">${$.i18n.prop('repository.group.mergedIndexTtl')}</label>
+ <div class="controls">
+ <input type="text" class="input-large required" id="mergedIndexTtl" name="mergedIndexTtl"
+ data-bind="value: repositoryGroup.mergedIndexTtl"/>
+ </div>
+ </div>
<div>
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank">
{{if repositoryGroup.id()}}
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-webdav</artifactId>
if ( tmp != null && tmp.getDirectory() != null && tmp.getDirectory().exists() )
{
- if ( System.currentTimeMillis() - tmp.getCreationTime() > ( indexMerger.getGroupMergedIndexTtl() * 60
- * 1000 ) )
+ if ( System.currentTimeMillis() - tmp.getCreationTime() > ( repositoryGroupConfiguration.getMergedIndexTtl() * 60 * 1000 ) )
{
log.debug( MarkerFactory.getMarker( "group.merged.index" ),
"tmp group index '{}' is too old so delete it", repositoryGroupConfiguration.getId() );
repositoryGroupConfiguration.getId(), authzRepos );
IndexingContext indexingContext = indexMerger.buildMergedIndex(
new IndexMergerRequest( authzRepos, true, repositoryGroupConfiguration.getId(),
- repositoryGroupConfiguration.getMergedIndexPath() ) );
+ repositoryGroupConfiguration.getMergedIndexPath(), repositoryGroupConfiguration.getMergedIndexTtl() ) );
File mergedRepoDir = indexingContext.getIndexDirectoryFile();
TemporaryGroupIndex temporaryGroupIndex = new TemporaryGroupIndex( mergedRepoDir, indexingContext.getId(),
- repositoryGroupConfiguration.getId() ).setCreationTime(
- new Date().getTime() );
+ repositoryGroupConfiguration.getId(),repositoryGroupConfiguration.getMergedIndexTtl() )
+ .setCreationTime(new Date().getTime() );
temporaryGroupIndexMap.put( repositoryGroupConfiguration.getId(), temporaryGroupIndex );
session.setAttribute( TemporaryGroupIndexSessionCleaner.TEMPORARY_INDEX_SESSION_KEY,
temporaryGroupIndexMap );
return false;
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
return null;
}
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-modules</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>archiva-web</artifactId>
<parent>
<artifactId>metadata</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>metadata-model-maven2</artifactId>
<packaging>bundle</packaging>
</Export-Package>
<Import-Package>
javax.xml.bind.annotation,
- org.apache.commons.lang
+ org.apache.commons.lang,
+ javax.persistence
</Import-Package>
</instructions>
</configuration>
<parent>
<artifactId>metadata</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>metadata-model</artifactId>
<packaging>bundle</packaging>
<name>Archiva Metadata :: Model</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ </dependency>
+ </dependencies>
+
<build>
<plugins>
<plugin>
org.apache.archiva.metadata.model;version=${project.version};-split-package:=merge-first
</Export-Package>
<Import-Package>
- javax.xml.bind.annotation
+ javax.xml.bind.annotation,javax.persistence
</Import-Package>
</instructions>
</configuration>
* under the License.
*/
+import javax.persistence.Entity;
import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
/**
* Information about the CI system used by the project.
*
* @todo considering moving this to a facet - avoid referring to it externally
*/
-@XmlRootElement( name = "ciManagement" )
+@XmlRootElement(name = "ciManagement")
+@Entity
public class CiManagement
+ implements Serializable
{
/**
* A simple identifier for the type of CI server used, eg <tt>continuum</tt>, <tt>bamboo</tt>, <tt>hudson</tt>, etc.
*/
import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
/**
* Information about a dependency that this project has on another project or artifact.
*
* @todo will be reviewing what is appropriate for the base here - rest should be in a maven dependency facet - avoid details on it externally
*/
-@XmlRootElement( name = "dependency" )
+@XmlRootElement(name = "dependency")
public class Dependency
+ implements Serializable
{
/**
* The Maven classifier of the dependency.
* under the License.
*/
+import javax.persistence.Entity;
import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
/**
* Information about the issue management system used by the project.
*
* @todo considering moving this to a facet - avoid referring to it externally
*/
-@XmlRootElement( name = "issueManagement" )
+@XmlRootElement(name = "issueManagement")
+@Entity
public class IssueManagement
+ implements Serializable
{
/**
* A simple identifier for the type of issue management server used, eg <tt>jira</tt>, <tt>bugzilla</tt>, etc.
*/
import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
/**
* A description of a particular license used by a project.
*/
-@XmlRootElement( name = "license" )
+@XmlRootElement(name = "license")
public class License
+ implements Serializable
{
/**
* The name of the license.
package org.apache.archiva.metadata.model;
import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
import java.util.List;
/*
*
* @todo considering moving this to a facet - avoid referring to it externally
*/
-@XmlRootElement( name = "mailingList" )
+@XmlRootElement(name = "mailingList")
public class MailingList
+ implements Serializable
{
/**
* The primary archive URL for this mailing list.
* under the License.
*/
+import javax.persistence.Entity;
import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
-@XmlRootElement( name = "organization" )
+@XmlRootElement(name = "organization")
+@Entity
public class Organization
+ implements Serializable
{
private String name;
{
this.namespace = namespace;
}
+
+ @Override
+ public String toString()
+ {
+ final StringBuilder sb = new StringBuilder( "ProjectMetadata{" );
+ sb.append( "namespace='" ).append( namespace ).append( '\'' );
+ sb.append( ", id='" ).append( id ).append( '\'' );
+ sb.append( '}' );
+ return sb.toString();
+ }
}
public class ProjectVersionMetadata
extends FacetedMetadata
{
+ /**
+ * id is the version
+ */
private String id;
private String url;
* under the License.
*/
+import javax.persistence.Entity;
import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
-@XmlRootElement( name = "scm" )
+@XmlRootElement(name = "scm")
+@Entity
public class Scm
+ implements Serializable
{
private String connection;
<parent>
<artifactId>metadata</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>metadata-repository-api</artifactId>
<packaging>bundle</packaging>
ProjectVersionMetadata versionMetadata )
throws MetadataRepositoryException;
+ /**
+ * create the namespace in the repository. (if not exist)
+ * @param repositoryId
+ * @param namespace
+ * @throws MetadataRepositoryException
+ */
void updateNamespace( String repositoryId, String namespace )
throws MetadataRepositoryException;
void removeMetadataFacet( String repositoryId, String facetId, String name )
throws MetadataRepositoryException;
+ /**
+ * if startTime or endTime are <code>null</code> they are not used for search
+ * @param repositoryId
+ * @param startTime can be <code>null</code>
+ * @param endTime can be <code>null</code>
+ * @return
+ * @throws MetadataRepositoryException
+ */
List<ArtifactMetadata> getArtifactsByDateRange( String repositoryId, Date startTime, Date endTime )
throws MetadataRepositoryException;
throws MetadataRepositoryException;
/**
+ * Only remove {@link MetadataFacet} for the artifact
* @param repositoryId
* @param namespace
* @param project
* @param version
- * @param metadataFacet will remove artifacts which have this {@link MetadataFacet} using equals
+ * @param metadataFacet
* @throws MetadataRepositoryException
* @since 1.4-M3
*/
List<ArtifactMetadata> getArtifacts( String repositoryId )
throws MetadataRepositoryException;
+ /**
+ * basically just checking it exists not complete data returned
+ * @param repoId
+ * @param namespace
+ * @param projectId
+ * @return
+ * @throws MetadataResolutionException
+ */
ProjectMetadata getProject( String repoId, String namespace, String projectId )
throws MetadataResolutionException;
boolean canObtainAccess( Class<?> aClass );
- Object obtainAccess( Class<?> aClass )
+ <T>T obtainAccess( Class<T> aClass )
throws MetadataRepositoryException;
}
// test that namespace is also constructed
- Assertions.assertThat( repository.getRootNamespaces( TEST_REPO_ID ) ).isNotNull().isNotEmpty().contains(
- TEST_NAMESPACE ).hasSize( 1 );
+ Collection<String> namespaces = repository.getRootNamespaces( TEST_REPO_ID );
+
+ Assertions.assertThat( namespaces ).isNotNull().isNotEmpty().contains( TEST_NAMESPACE ).hasSize( 1 );
}
@Test
// test that namespace and project is also constructed
assertEquals( Collections.singletonList( TEST_NAMESPACE ), repository.getRootNamespaces( TEST_REPO_ID ) );
ProjectMetadata projectMetadata = repository.getProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT );
+ assertNotNull( projectMetadata );
assertEquals( TEST_PROJECT, projectMetadata.getId() );
assertEquals( TEST_NAMESPACE, projectMetadata.getNamespace() );
}
repository.updateNamespace( TEST_REPO_ID, "namespace" );
repository.updateNamespace( OTHER_REPO_ID, "namespace" );
- assertEquals( "repository.getRepositories() -> " + repository.getRepositories(),
- Arrays.asList( TEST_REPO_ID, OTHER_REPO_ID ),
- new ArrayList<String>( repository.getRepositories() ) );
+ Collection<String> repositories = repository.getRepositories();
+
+ assertEquals( "repository.getRepositories() -> " + repositories, Arrays.asList( TEST_REPO_ID, OTHER_REPO_ID ),
+ new ArrayList<String>( repositories ) );
}
@Test
{
repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) );
- assertEquals( new TestMetadataFacet( TEST_VALUE ),
- repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) );
+ TestMetadataFacet test =
+ (TestMetadataFacet) repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME );
+
+ assertEquals( new TestMetadataFacet( TEST_VALUE ), test );
}
@Test
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 );
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 );
- assertEquals( Collections.singleton( TEST_PROJECT_VERSION ),
- repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
- TEST_PROJECT_VERSION ) );
+ Collection<String> versions =
+ repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
+
+ assertEquals( Collections.singleton( TEST_PROJECT_VERSION ), versions );
}
@Test
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
repository.save();
- assertEquals( Collections.singletonList( artifact ),
- repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) );
+ List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, null );
+
+ assertEquals( Collections.singletonList( artifact ), artifacts );
}
@Test
repository.updateArtifact( TEST_REPO_ID, namespace, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
repository.save();
- assertEquals( Collections.singletonList( artifact ),
- repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) );
+ List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, null );
+
+ assertEquals( Collections.singletonList( artifact ), artifacts );
}
@Test
repository.save();
Date date = new Date( artifact.getWhenGathered().getTime() - 10000 );
- assertEquals( Collections.singletonList( artifact ),
- repository.getArtifactsByDateRange( TEST_REPO_ID, date, null ) );
+
+ List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, date, null );
+
+ assertEquals( Collections.singletonList( artifact ), artifacts );
}
@Test
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
Date date = new Date( artifact.getWhenGathered().getTime() + 10000 );
- assertTrue( repository.getArtifactsByDateRange( TEST_REPO_ID, date, null ).isEmpty() );
+
+ List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, date, null );
+
+ Assertions.assertThat( artifacts ).isNotNull().isEmpty();
}
@Test
Date lower = new Date( artifact.getWhenGathered().getTime() - 10000 );
Date upper = new Date( artifact.getWhenGathered().getTime() + 10000 );
- assertEquals( Collections.singletonList( artifact ),
- repository.getArtifactsByDateRange( TEST_REPO_ID, lower, upper ) );
+
+ List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, lower, upper );
+
+ assertEquals( Collections.singletonList( artifact ), artifacts );
}
@Test
repository.save();
Date upper = new Date( artifact.getWhenGathered().getTime() + 10000 );
- assertEquals( Collections.singletonList( artifact ),
- repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper ) );
+
+ List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper );
+
+ assertEquals( Collections.singletonList( artifact ), artifacts );
}
@Test
repository.save();
Date upper = new Date( artifact.getWhenGathered().getTime() - 10000 );
- assertTrue( repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper ).isEmpty() );
+
+ List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper );
+
+ //assertTrue( .isEmpty() );
+
+ Assertions.assertThat( artifacts ).isNotNull().isEmpty();
}
@Test
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
repository.save();
- assertEquals( Collections.singletonList( artifact ), repository.getArtifacts( TEST_REPO_ID ) );
+ List<ArtifactMetadata> artifacts = repository.getArtifacts( TEST_REPO_ID );
+
+ assertEquals( Collections.singletonList( artifact ), artifacts );
}
@Test
repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
- assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>(
- repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ) );
+ Collection<ArtifactMetadata> artifacts =
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
+
+ assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>( artifacts ) );
repository.removeArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() );
- assertTrue(
- repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ).isEmpty() );
+ artifacts =
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
+
+ Assertions.assertThat( artifacts ).isNotNull().isEmpty();
}
@Test
<parent>
<artifactId>archiva-modules</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>metadata</artifactId>
<name>Archiva :: Metadata</name>
<parent>
<artifactId>metadata</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>test-repository</artifactId>
<name>Archiva Metadata :: Repository for Testing</name>
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>audit</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>generic-metadata-support</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>maven1-repository</artifactId>
<name>Archiva Core Plugins :: Maven 1.x Repository Support</name>
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>maven2-repository</artifactId>
<packaging>bundle</packaging>
public void save()
{
- //To change body of implemented methods use File | Settings | File Templates.
+ //
}
public void close()
{
- //To change body of implemented methods use File | Settings | File Templates.
+ //
}
public void revert()
{
- //To change body of implemented methods use File | Settings | File Templates.
+ //
}
public boolean canObtainAccess( Class<?> aClass )
{
- return false; //To change body of implemented methods use File | Settings | File Templates.
+ return false;
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
public void removeArtifact( String repositoryId, String namespace, String project, String version,
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>metadata-store-file</artifactId>
<packaging>bundle</packaging>
return false;
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
{
throw new IllegalArgumentException(
"Access using " + aClass + " is not supported on the file metadata storage" );
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>metadata-store-jcr</artifactId>
<packaging>bundle</packaging>
return aClass == Session.class;
}
- public Object obtainAccess( Class<?> aClass )
+ public <T>T obtainAccess( Class<T> aClass )
throws MetadataRepositoryException
{
if ( aClass == Session.class )
{
try
{
- return getJcrSession();
+ return (T) getJcrSession();
}
catch ( RepositoryException e )
{
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>npanday-support</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>archiva-modules</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>plugins</artifactId>
<name>Archiva :: Core Plugins</name>
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>problem-reports</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<artifactId>repository-statistics</artifactId>
<packaging>bundle</packaging>
long startGather = System.currentTimeMillis();
+ // FIXME what about other implementations ?
+
if ( metadataRepository.canObtainAccess( Session.class ) )
{
// TODO: this is currently very raw and susceptible to changes in content structure. Should we instead
populateStatisticsFromRepositoryWalk( metadataRepository, repositoryId, repositoryStatistics );
}
- log.info( "Gathering statistics executed in " + ( System.currentTimeMillis() - startGather ) + "ms" );
+ log.info( "Gathering statistics executed in {} ms", ( System.currentTimeMillis() - startGather ) );
metadataRepository.addMetadataFacet( repositoryId, repositoryStatistics );
}
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<groupId>org.apache.archiva</groupId>
<artifactId>stage-repository-merge</artifactId>
<parent>
<artifactId>archiva</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.4-M4-SNAPSHOT</version>
+ <version>1.4-M5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-modules</artifactId>