summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-converter
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-09-13 12:12:39 +0000
committerOlivier Lamy <olamy@apache.org>2011-09-13 12:12:39 +0000
commit919a5ac3eb725dc676e81fcbf868f3cc165598a4 (patch)
tree9aecd4829e214ecbb256dbd0ec5f13f428016ab3 /archiva-modules/archiva-base/archiva-converter
parent5c067f2a4deaa775213a3b5c2ca44ce62f4ba914 (diff)
downloadarchiva-919a5ac3eb725dc676e81fcbf868f3cc165598a4.tar.gz
archiva-919a5ac3eb725dc676e81fcbf868f3cc165598a4.zip
[MRM-1504] Add a new module for repository administration management
split the repo admin in two modules : api and default implementation (to be able to more easily change the impl). Use the repo admin api consumers and indexing modules. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1170135 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-converter')
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java3
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java6
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/mock/MockArchivaAdministration.java148
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml1
4 files changed, 154 insertions, 4 deletions
diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java
index 02950448b..dd45dce71 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java
+++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java
@@ -19,6 +19,7 @@ package org.apache.maven.archiva.converter.legacy;
* under the License.
*/
+import org.apache.archiva.admin.model.managed.ManagedRepository;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
import org.apache.archiva.repository.scanner.RepositoryScanner;
@@ -89,7 +90,7 @@ public class DefaultLegacyRepositoryConverter
{
String defaultRepositoryUrl = PathUtil.toUrl( repositoryDirectory );
- ManagedRepositoryConfiguration legacyRepository = new ManagedRepositoryConfiguration();
+ ManagedRepository legacyRepository = new ManagedRepository();
legacyRepository.setId( "legacy" );
legacyRepository.setName( "Legacy Repository" );
legacyRepository.setLocation( legacyRepositoryDirectory.getAbsolutePath() );
diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
index 92a7d0cc6..9921de22f 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
+++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
@@ -19,9 +19,9 @@ package org.apache.maven.archiva.converter.legacy;
* under the License.
*/
+import org.apache.archiva.admin.model.managed.ManagedRepository;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
import org.apache.maven.archiva.consumers.ConsumerException;
import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
@@ -88,14 +88,14 @@ public class LegacyConverterArtifactConsumer
artifactFactory = plexusSisuBridge.lookup( ArtifactFactory.class );
}
- public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered )
+ public void beginScan( ManagedRepository repository, Date whenGathered )
throws ConsumerException
{
this.managedRepository = new ManagedDefaultRepositoryContent();
this.managedRepository.setRepository( repository );
}
- public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo )
+ public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo )
throws ConsumerException
{
beginScan( repository, whenGathered );
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/mock/MockArchivaAdministration.java b/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/mock/MockArchivaAdministration.java
new file mode 100644
index 000000000..4a3f6e91c
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/mock/MockArchivaAdministration.java
@@ -0,0 +1,148 @@
+package org.apache.maven.archiva.converter.mock;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.admin.model.AuditInformation;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.admin.ArchivaAdministration;
+import org.apache.archiva.admin.model.admin.FileType;
+import org.apache.archiva.admin.model.admin.LegacyArtifactPath;
+import org.apache.archiva.admin.model.admin.OrganisationInformation;
+
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ */
+public class MockArchivaAdministration implements ArchivaAdministration
+{
+ public List<LegacyArtifactPath> getLegacyArtifactPaths()
+ throws RepositoryAdminException
+ {
+ return null;
+ }
+
+ public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public void deleteLegacyArtifactPath( String path, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public List<FileType> getFileTypes()
+ throws RepositoryAdminException
+ {
+ return null;
+ }
+
+ public FileType getFileType( String fileTypeId )
+ throws RepositoryAdminException
+ {
+ return null;
+ }
+
+ public void addFileType( FileType fileType, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public void removeFileType( String fileTypeId, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public void setKnownContentConsumers( List<String> knownContentConsumers, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public List<String> getKnownContentConsumers()
+ throws RepositoryAdminException
+ {
+ return null;
+ }
+
+ public void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public void setInvalidContentConsumers( List<String> invalidContentConsumers, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public List<String> getInvalidContentConsumers()
+ throws RepositoryAdminException
+ {
+ return null;
+ }
+
+ public void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+
+ public OrganisationInformation getOrganisationInformation()
+ throws RepositoryAdminException
+ {
+ return null;
+ }
+
+ public void setOrganisationInformation( OrganisationInformation organisationInformation )
+ throws RepositoryAdminException
+ {
+
+ }
+}
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml
index 60142d781..0f39f64a0 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml
@@ -27,5 +27,6 @@
http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-lazy-init="true">
+ <bean name="mockArchivaAdministration" class="org.apache.maven.archiva.converter.mock.MockArchivaAdministration"/>
</beans> \ No newline at end of file