You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2017/11/08 22:57:12 UTC
[4/4] archiva git commit: Rearranging modules and adding indexer api
Rearranging modules and adding indexer api
Combining the indexer api and repository api into archiva-repository-api
They have bidirectional dependencies so they are put together in one module.
Adding new classes for a generalized indexer api that will be used for interfaces
and implementation independent tasks.
Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/e2cdbc2b
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/e2cdbc2b
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/e2cdbc2b
Branch: refs/heads/master
Commit: e2cdbc2b7229b4c141a61c8f9aa118304bee2632
Parents: 2ab8942
Author: Martin Stockhammer <ma...@ars.de>
Authored: Wed Nov 8 22:59:33 2017 +0100
Committer: Martin Stockhammer <ma...@ars.de>
Committed: Wed Nov 8 22:59:33 2017 +0100
----------------------------------------------------------------------
.../src/main/java/SimpleArtifactConsumer.java | 2 +-
.../consumers/core/MetadataUpdaterConsumer.java | 2 +-
...CleanupReleasedSnapshotsRepositoryPurge.java | 8 +-
.../core/repository/DaysOldRepositoryPurge.java | 2 +-
.../RetentionCountRepositoryPurge.java | 2 +-
.../legacy/LegacyConverterArtifactConsumer.java | 2 +-
.../archiva-base/archiva-indexer-api/pom.xml | 99 -----
.../indexer/search/ArtifactInfoFilter.java | 33 --
.../indexer/search/RepositorySearch.java | 59 ---
.../search/RepositorySearchException.java | 44 --
.../archiva/indexer/search/SearchFields.java | 324 --------------
.../archiva/indexer/search/SearchResultHit.java | 435 -------------------
.../indexer/search/SearchResultLimits.java | 87 ----
.../archiva/indexer/search/SearchResults.java | 148 -------
.../apache/archiva/indexer/util/SearchUtil.java | 36 --
.../main/resources/META-INF/spring-context.xml | 39 --
.../archiva-base/archiva-indexer/pom.xml | 6 -
.../apache/archiva/proxy/ErrorHandlingTest.java | 2 +-
.../archiva-base/archiva-repository-api/pom.xml | 107 +++++
.../archiva/indexer/ArchivaIndexManager.java | 71 +++
.../archiva/indexer/ArchivaIndexingContext.java | 130 ++++++
.../archiva/indexer/IndexManagerFactory.java | 53 +++
.../indexer/search/ArtifactInfoFilter.java | 33 ++
.../indexer/search/RepositorySearch.java | 59 +++
.../search/RepositorySearchException.java | 44 ++
.../archiva/indexer/search/SearchFields.java | 324 ++++++++++++++
.../archiva/indexer/search/SearchResultHit.java | 435 +++++++++++++++++++
.../indexer/search/SearchResultLimits.java | 87 ++++
.../archiva/indexer/search/SearchResults.java | 148 +++++++
.../apache/archiva/indexer/util/SearchUtil.java | 36 ++
.../repository/ContentNotFoundException.java | 50 +++
.../repository/EditableManagedRepository.java | 56 +++
.../repository/EditableRemoteRepository.java | 82 ++++
.../archiva/repository/EditableRepository.java | 124 ++++++
.../archiva/repository/LayoutException.java | 40 ++
.../archiva/repository/ManagedRepository.java | 52 +++
.../repository/ManagedRepositoryContent.java | 225 ++++++++++
.../archiva/repository/ReleaseScheme.java | 27 ++
.../archiva/repository/RemoteRepository.java | 73 ++++
.../repository/RemoteRepositoryContent.java | 82 ++++
.../apache/archiva/repository/Repository.java | 169 +++++++
.../repository/RepositoryCapabilities.java | 99 +++++
.../archiva/repository/RepositoryContent.java | 51 +++
.../repository/RepositoryContentFactory.java | 216 +++++++++
.../repository/RepositoryContentProvider.java | 82 ++++
.../repository/RepositoryCredentials.java | 31 ++
.../archiva/repository/RepositoryException.java | 51 +++
.../repository/RepositoryNotFoundException.java | 49 +++
.../archiva/repository/RepositoryProvider.java | 139 ++++++
.../archiva/repository/RepositoryType.java | 29 ++
.../repository/StandardCapabilities.java | 131 ++++++
.../repository/UnsupportedFeatureException.java | 47 ++
.../UnsupportedRepositoryTypeException.java | 45 ++
.../repository/UnsupportedURIException.java | 51 +++
.../repository/features/RepositoryFeature.java | 41 ++
.../main/resources/META-INF/spring-context.xml | 39 ++
.../archiva-repository-layer/pom.xml | 4 +
.../archiva/repository/AbstractRepository.java | 7 +
.../repository/ContentNotFoundException.java | 50 ---
.../repository/EditableManagedRepository.java | 56 ---
.../repository/EditableRemoteRepository.java | 82 ----
.../archiva/repository/EditableRepository.java | 124 ------
.../archiva/repository/ManagedRepository.java | 49 ---
.../repository/ManagedRepositoryContent.java | 226 ----------
.../archiva/repository/ReleaseScheme.java | 27 --
.../archiva/repository/RemoteRepository.java | 73 ----
.../repository/RemoteRepositoryContent.java | 83 ----
.../apache/archiva/repository/Repository.java | 162 -------
.../repository/RepositoryCapabilities.java | 99 -----
.../archiva/repository/RepositoryContent.java | 52 ---
.../repository/RepositoryContentFactory.java | 216 ---------
.../repository/RepositoryContentProvider.java | 82 ----
.../repository/RepositoryCredentials.java | 31 --
.../archiva/repository/RepositoryException.java | 51 ---
.../repository/RepositoryNotFoundException.java | 49 ---
.../archiva/repository/RepositoryProvider.java | 139 ------
.../archiva/repository/RepositoryType.java | 29 --
.../repository/StandardCapabilities.java | 131 ------
.../repository/UnsupportedFeatureException.java | 47 --
.../repository/UnsupportedURIException.java | 51 ---
.../archiva/repository/content/PathParser.java | 2 +-
.../repository/features/RepositoryFeature.java | 41 --
.../repository/layout/LayoutException.java | 40 --
.../repository/metadata/MetadataTools.java | 2 +-
archiva-modules/archiva-base/pom.xml | 2 +-
.../scheduler/repository/TestConsumer.java | 2 +-
.../webdav/ArchivaDavResourceFactory.java | 2 +-
.../storage/maven2/Maven2RepositoryStorage.java | 2 +-
.../AbstractDefaultRepositoryContent.java | 5 +-
.../content/maven2/DefaultPathParser.java | 2 +-
.../maven2/ManagedDefaultRepositoryContent.java | 10 +-
.../maven2/RemoteDefaultRepositoryContent.java | 6 +-
.../content/maven2/RepositoryRequest.java | 6 +-
...bstractDefaultRepositoryContentTestCase.java | 14 +-
.../ManagedDefaultRepositoryContentTest.java | 3 +-
.../RemoteDefaultRepositoryContentTest.java | 3 +-
.../content/maven2/DefaultPathParserTest.java | 18 +-
.../content/maven2/RepositoryRequestTest.java | 2 +-
.../repository/metadata/MetadataToolsTest.java | 3 +-
pom.xml | 10 +-
100 files changed, 3669 insertions(+), 3364 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java
index 59ca6b0..54e04dc 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java
@@ -38,7 +38,7 @@ import org.apache.archiva.redback.components.registry.RegistryListener;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.RepositoryException;
-import org.apache.archiva.repository.layout.LayoutException;
+import org.apache.archiva.repository.LayoutException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.PostConstruct;
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java
index a09ff24..8f537b5 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java
@@ -33,7 +33,7 @@ import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.repository.RepositoryNotFoundException;
import org.apache.archiva.repository.RepositoryRegistry;
-import org.apache.archiva.repository.layout.LayoutException;
+import org.apache.archiva.repository.LayoutException;
import org.apache.archiva.repository.metadata.MetadataTools;
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
import org.slf4j.Logger;
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java
index 181cbf4..265c8e2 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java
@@ -19,9 +19,6 @@ package org.apache.archiva.consumers.core.repository;
* under the License.
*/
-import org.apache.archiva.admin.model.RepositoryAdminException;
-import org.apache.archiva.admin.model.beans.ManagedRepository;
-import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
import org.apache.archiva.common.utils.VersionComparator;
import org.apache.archiva.common.utils.VersionUtil;
import org.apache.archiva.metadata.repository.MetadataRepository;
@@ -33,16 +30,13 @@ import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.ReleaseScheme;
-import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.RepositoryException;
-import org.apache.archiva.repository.RepositoryNotFoundException;
import org.apache.archiva.repository.RepositoryRegistry;
import org.apache.archiva.repository.events.RepositoryListener;
-import org.apache.archiva.repository.layout.LayoutException;
+import org.apache.archiva.repository.LayoutException;
import org.apache.archiva.repository.metadata.MetadataTools;
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
-import javax.inject.Inject;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
index 73fc456..2952f7f 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
@@ -27,7 +27,7 @@ import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.events.RepositoryListener;
-import org.apache.archiva.repository.layout.LayoutException;
+import org.apache.archiva.repository.LayoutException;
import org.apache.commons.lang.time.DateUtils;
import java.io.IOException;
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java
index 98929ba..bcecc8a 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java
@@ -27,7 +27,7 @@ import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.events.RepositoryListener;
-import org.apache.archiva.repository.layout.LayoutException;
+import org.apache.archiva.repository.LayoutException;
import java.nio.file.Files;
import java.nio.file.Path;
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
index 9cdde0a..04653a5 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
+++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
@@ -32,7 +32,7 @@ import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.ManagedRepository;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent;
-import org.apache.archiva.repository.layout.LayoutException;
+import org.apache.archiva.repository.LayoutException;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/pom.xml b/archiva-modules/archiva-base/archiva-indexer-api/pom.xml
deleted file mode 100644
index 5aec104..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/pom.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<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">
- <parent>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-base</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>archiva-indexer-api</artifactId>
- <packaging>bundle</packaging>
- <name>Archiva Base :: Indexer API</name>
- <dependencies>
-
- <dependency>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-common</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-model</artifactId>
- </dependency>
- </dependencies>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>src/test/maven-search-test-repo*/**</exclude>
- <exclude>src/test/repo-release*/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>org.apache.archiva.indexer.api</Bundle-SymbolicName>
- <Bundle-Version>${project.version}</Bundle-Version>
- <Export-Package>
- org.apache.archiva.indexer.*;version=${project.version};-split-package:=merge-first
- </Export-Package>
- <Import-Package>
- javax.annotation,
- javax.inject,
- org.apache.commons.lang*;version="[2.4,3)",
- org.slf4j;resolution:=optional
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemPropertyVariables>
- <appserver.base>${project.build.directory}/appserver-base</appserver.base>
- <plexus.home>${project.build.directory}/appserver-base</plexus.home>
- <derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
- <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
- <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
- <archiva.repositorySessionFactory.id>mock</archiva.repositorySessionFactory.id>
- <openjpa.Log>${openjpa.Log}</openjpa.Log>
- </systemPropertyVariables>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java
deleted file mode 100644
index 39c32da..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.apache.archiva.indexer.search;
-/*
- * 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.model.ArchivaArtifactModel;
-import org.apache.archiva.model.ArtifactReference;
-
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M1
- */
-public interface ArtifactInfoFilter
-{
- boolean addArtifactInResult( ArchivaArtifactModel artifact, Map<String, SearchResultHit> currentResult );
-}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java
deleted file mode 100644
index 272561b..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.apache.archiva.indexer.search;
-
-/*
- * 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 java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-
-public interface RepositorySearch
-{
- /**
- * Quick search by won't return artifact with file extension pom
- *
- * @param principal
- * @param selectedRepos
- * @param term
- * @param limits
- * @param previousSearchTerms
- * @return
- */
- SearchResults search( String principal, List<String> selectedRepos, String term, SearchResultLimits limits,
- List<String> previousSearchTerms )
- throws RepositorySearchException;
-
- /**
- * Advanced search.
- *
- * @param principal
- * @param searchFields
- * @param limits
- * @return
- */
- SearchResults search( String principal, SearchFields searchFields, SearchResultLimits limits )
- throws RepositorySearchException;
-
- Collection<String> getAllGroupIds( String principal, List<String> selectedRepos )
- throws RepositorySearchException;
-
- Set<String> getRemoteIndexingContextIds( String managedRepoId )
- throws RepositorySearchException;
-}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java
deleted file mode 100644
index e3da551..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.apache.archiva.indexer.search;
-
-/*
- * 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.
- */
-
-public class RepositorySearchException
- extends Exception
-{
- public RepositorySearchException()
- {
- super();
- }
-
- public RepositorySearchException( String msg )
- {
- super( msg );
- }
-
- public RepositorySearchException( Throwable e )
- {
- super( e );
- }
-
- public RepositorySearchException( String msg, Throwable e )
- {
- super( msg, e );
- }
-}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchFields.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchFields.java b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchFields.java
deleted file mode 100644
index e5844a7..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchFields.java
+++ /dev/null
@@ -1,324 +0,0 @@
-package org.apache.archiva.indexer.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/*
- * 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.
- */
-
-public class SearchFields
-{
- /**
- * groupId
- */
- private String groupId;
-
- /**
- * artifactId
- */
- private String artifactId;
-
- /**
- * version
- */
- private String version;
-
- /**
- * packaging (jar, war, pom, etc.)
- */
- private String packaging;
-
- /**
- * class name or package name
- */
- private String className;
-
- /**
- * repositories
- */
- private List<String> repositories = new ArrayList<>();
-
-
- /**
- * contains osgi metadata Bundle-Version if available
- *
- * @since 1.4-M1
- */
- private String bundleVersion;
-
- /**
- * contains osgi metadata Bundle-SymbolicName if available
- *
- * @since 1.4-M1
- */
- private String bundleSymbolicName;
-
- /**
- * contains osgi metadata Export-Package if available
- *
- * @since 1.4-M1
- */
- private String bundleExportPackage;
-
- /**
- * contains osgi metadata import package if available
- *
- * @since 1.4-M1
- */
- private String bundleImportPackage;
-
- /**
- * contains osgi metadata name if available
- *
- * @since 1.4-M1
- */
- private String bundleName;
-
- /**
- * contains osgi metadata Export-Service if available
- *
- * @since 1.4-M1
- */
- private String bundleExportService;
-
-
- /**
- * contains osgi metadata Require-Bundle if available
- *
- * @since 1.4-M3
- */
- private String bundleRequireBundle;
-
- /**
- * not return artifact with file extension pom
- *
- * @since 1.4-M2
- */
- private boolean includePomArtifacts = false;
-
- private String classifier;
-
- /**
- * we use exact String matching search
- *
- * @since 2.1.0
- */
- private boolean exactSearch = false;
-
- public SearchFields()
- {
- // no op
- }
-
- public SearchFields( String groupId, String artifactId, String version, String packaging, String className,
- List<String> repositories )
- {
- this.groupId = groupId;
- this.artifactId = artifactId;
- this.version = version;
- this.packaging = packaging;
- this.className = className;
- this.repositories = repositories;
- }
-
- public String getGroupId()
- {
- return groupId;
- }
-
- public void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- public String getArtifactId()
- {
- return artifactId;
- }
-
- public void setArtifactId( String artifactId )
- {
- this.artifactId = artifactId;
- }
-
- public String getVersion()
- {
- return version;
- }
-
- public void setVersion( String version )
- {
- this.version = version;
- }
-
- public String getPackaging()
- {
- return packaging;
- }
-
- public void setPackaging( String packaging )
- {
- this.packaging = packaging;
- }
-
- public String getClassName()
- {
- return className;
- }
-
- public void setClassName( String className )
- {
- this.className = className;
- }
-
- public List<String> getRepositories()
- {
- return repositories;
- }
-
- public void setRepositories( List<String> repositories )
- {
- this.repositories = repositories;
- }
-
-
- public String getBundleVersion()
- {
- return bundleVersion;
- }
-
- public void setBundleVersion( String bundleVersion )
- {
- this.bundleVersion = bundleVersion;
- }
-
- public String getBundleSymbolicName()
- {
- return bundleSymbolicName;
- }
-
- public void setBundleSymbolicName( String bundleSymbolicName )
- {
- this.bundleSymbolicName = bundleSymbolicName;
- }
-
- public String getBundleExportPackage()
- {
- return bundleExportPackage;
- }
-
- public void setBundleExportPackage( String bundleExportPackage )
- {
- this.bundleExportPackage = bundleExportPackage;
- }
-
- public String getBundleExportService()
- {
- return bundleExportService;
- }
-
- public void setBundleExportService( String bundleExportService )
- {
- this.bundleExportService = bundleExportService;
- }
-
- public String getClassifier()
- {
- return classifier;
- }
-
- public void setClassifier( String classifier )
- {
- this.classifier = classifier;
- }
-
- public String getBundleImportPackage()
- {
- return bundleImportPackage;
- }
-
- public void setBundleImportPackage( String bundleImportPackage )
- {
- this.bundleImportPackage = bundleImportPackage;
- }
-
- public String getBundleName()
- {
- return bundleName;
- }
-
- public void setBundleName( String bundleName )
- {
- this.bundleName = bundleName;
- }
-
- public boolean isIncludePomArtifacts()
- {
- return includePomArtifacts;
- }
-
- public void setIncludePomArtifacts( boolean includePomArtifacts )
- {
- this.includePomArtifacts = includePomArtifacts;
- }
-
- public String getBundleRequireBundle()
- {
- return bundleRequireBundle;
- }
-
- public void setBundleRequireBundle( String bundleRequireBundle )
- {
- this.bundleRequireBundle = bundleRequireBundle;
- }
-
- public boolean isExactSearch()
- {
- return exactSearch;
- }
-
- public void setExactSearch( boolean exactSearch )
- {
- this.exactSearch = exactSearch;
- }
-
- @Override
- public String toString()
- {
- final StringBuilder sb = new StringBuilder();
- sb.append( "SearchFields" );
- sb.append( "{groupId='" ).append( groupId ).append( '\'' );
- sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
- sb.append( ", version='" ).append( version ).append( '\'' );
- sb.append( ", packaging='" ).append( packaging ).append( '\'' );
- sb.append( ", className='" ).append( className ).append( '\'' );
- sb.append( ", repositories=" ).append( repositories );
- sb.append( ", bundleVersion='" ).append( bundleVersion ).append( '\'' );
- sb.append( ", bundleSymbolicName='" ).append( bundleSymbolicName ).append( '\'' );
- sb.append( ", bundleExportPackage='" ).append( bundleExportPackage ).append( '\'' );
- sb.append( ", bundleImportPackage='" ).append( bundleImportPackage ).append( '\'' );
- sb.append( ", bundleName='" ).append( bundleName ).append( '\'' );
- sb.append( ", bundleExportService='" ).append( bundleExportService ).append( '\'' );
- sb.append( ", bundleRequireBundle='" ).append( bundleRequireBundle ).append( '\'' );
- sb.append( ", includePomArtifacts=" ).append( includePomArtifacts );
- sb.append( ", classifier='" ).append( classifier ).append( '\'' );
- sb.append( '}' );
- return sb.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java
deleted file mode 100644
index a493431..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java
+++ /dev/null
@@ -1,435 +0,0 @@
-package org.apache.archiva.indexer.search;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.List;
-
-/**
- * SearchResultHit
- *
- */
-public class SearchResultHit
-{
- // The (optional) context for this result.
- private String context;
-
- // Basic hit, direct to non-artifact resource.
- private String url;
-
- // Advanced hit, reference to groupId.
- private String groupId;
-
- // Advanced hit, reference to artifactId.
- private String artifactId;
-
- private String repositoryId = "";
-
- private List<String> versions = new ArrayList<>();
-
- private String packaging;
-
- /**
- * Plugin goal prefix (only if packaging is "maven-plugin")
- */
- private String prefix;
-
- /**
- * Plugin goals (only if packaging is "maven-plugin")
- */
- private List<String> goals;
-
- /**
- * contains osgi metadata Bundle-Version if available
- *
- * @since 1.4-M1
- */
- private String bundleVersion;
-
- /**
- * contains osgi metadata Bundle-SymbolicName if available
- *
- * @since 1.4-M1
- */
- private String bundleSymbolicName;
-
- /**
- * contains osgi metadata Export-Package if available
- *
- * @since 1.4-M1
- */
- private String bundleExportPackage;
-
- /**
- * contains osgi metadata Export-Service if available
- *
- * @since 1.4-M1
- */
- private String bundleExportService;
-
- /**
- * contains osgi metadata Bundle-Description if available
- *
- * @since 1.4-M1
- */
- private String bundleDescription;
-
- /**
- * contains osgi metadata Bundle-Name if available
- *
- * @since 1.4-M1
- */
- private String bundleName;
-
- /**
- * contains osgi metadata Bundle-License if available
- *
- * @since 1.4-M1
- */
- private String bundleLicense;
-
- /**
- * contains osgi metadata Bundle-DocURL if available
- *
- * @since 1.4-M1
- */
- private String bundleDocUrl;
-
- /**
- * contains osgi metadata Import-Package if available
- *
- * @since 1.4-M1
- */
- private String bundleImportPackage;
-
- /**
- * contains osgi metadata Require-Bundle if available
- *
- * @since 1.4-M1
- */
- private String bundleRequireBundle;
-
- private String classifier;
-
- /**
- * file extension of the search result
- * @since 1.4-M2
- */
- private String fileExtension;
-
- public String getContext()
- {
- return context;
- }
-
- public void setContext( String context )
- {
- this.context = context;
- }
-
- public String getUrl()
- {
- return url;
- }
-
- public void setUrl( String url )
- {
- this.url = url;
- }
-
- public String getUrlFilename()
- {
- return this.url.substring( this.url.lastIndexOf( '/' ) );
- }
-
- public String getArtifactId()
- {
- return artifactId;
- }
-
- public void setArtifactId( String artifactId )
- {
- this.artifactId = artifactId;
- }
-
- public String getGroupId()
- {
- return groupId;
- }
-
- public void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- public List<String> getVersions()
- {
- return versions;
- }
-
- public void setVersions( List<String> versions )
- {
- this.versions = versions;
- }
-
- public String getRepositoryId()
- {
- return repositoryId;
- }
-
- public void setRepositoryId( String repositoryId )
- {
- this.repositoryId = repositoryId;
- }
-
- public void addVersion( String version )
- {
- versions.add( version );
- }
-
- public String getBundleVersion()
- {
- return bundleVersion;
- }
-
- public void setBundleVersion( String bundleVersion )
- {
- this.bundleVersion = bundleVersion;
- }
-
- public String getBundleSymbolicName()
- {
- return bundleSymbolicName;
- }
-
- public void setBundleSymbolicName( String bundleSymbolicName )
- {
- this.bundleSymbolicName = bundleSymbolicName;
- }
-
- public String getBundleExportPackage()
- {
- return bundleExportPackage;
- }
-
- public void setBundleExportPackage( String bundleExportPackage )
- {
- this.bundleExportPackage = bundleExportPackage;
- }
-
- public String getBundleExportService()
- {
- return bundleExportService;
- }
-
- public void setBundleExportService( String bundleExportService )
- {
- this.bundleExportService = bundleExportService;
- }
-
- public String getPrefix()
- {
- return prefix;
- }
-
- public void setPrefix( String prefix )
- {
- this.prefix = prefix;
- }
-
- public List<String> getGoals()
- {
- return goals;
- }
-
- public void setGoals( List<String> goals )
- {
- this.goals = goals;
- }
-
- public String getBundleDescription()
- {
- return bundleDescription;
- }
-
- public void setBundleDescription( String bundleDescription )
- {
- this.bundleDescription = bundleDescription;
- }
-
- public String getBundleName()
- {
- return bundleName;
- }
-
- public void setBundleName( String bundleName )
- {
- this.bundleName = bundleName;
- }
-
- public String getBundleLicense()
- {
- return bundleLicense;
- }
-
- public void setBundleLicense( String bundleLicense )
- {
- this.bundleLicense = bundleLicense;
- }
-
- public String getBundleDocUrl()
- {
- return bundleDocUrl;
- }
-
- public void setBundleDocUrl( String bundleDocUrl )
- {
- this.bundleDocUrl = bundleDocUrl;
- }
-
- public String getBundleImportPackage()
- {
- return bundleImportPackage;
- }
-
- public void setBundleImportPackage( String bundleImportPackage )
- {
- this.bundleImportPackage = bundleImportPackage;
- }
-
- public String getBundleRequireBundle()
- {
- return bundleRequireBundle;
- }
-
- public void setBundleRequireBundle( String bundleRequireBundle )
- {
- this.bundleRequireBundle = bundleRequireBundle;
- }
-
- public String getPackaging()
- {
- return packaging;
- }
-
- public void setPackaging( String packaging )
- {
- this.packaging = packaging;
- }
-
- public String getType()
- {
- return getPackaging();
- }
-
- public String getClassifier()
- {
- return classifier;
- }
-
- public void setClassifier( String classifier )
- {
- this.classifier = classifier;
- }
-
- public String getFileExtension()
- {
- return fileExtension;
- }
-
- public void setFileExtension( String fileExtension )
- {
- this.fileExtension = fileExtension;
- }
-
- @Override
- public String toString()
- {
- final StringBuilder sb = new StringBuilder();
- sb.append( "SearchResultHit" );
- sb.append( "{context='" ).append( context ).append( '\'' );
- sb.append( ", url='" ).append( url ).append( '\'' );
- sb.append( ", groupId='" ).append( groupId ).append( '\'' );
- sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
- sb.append( ", repositoryId='" ).append( repositoryId ).append( '\'' );
- sb.append( ", versions=" ).append( versions );
- sb.append( ", packaging='" ).append( packaging ).append( '\'' );
- sb.append( ", prefix='" ).append( prefix ).append( '\'' );
- sb.append( ", goals=" ).append( goals );
- sb.append( ", bundleVersion='" ).append( bundleVersion ).append( '\'' );
- sb.append( ", bundleSymbolicName='" ).append( bundleSymbolicName ).append( '\'' );
- sb.append( ", bundleExportPackage='" ).append( bundleExportPackage ).append( '\'' );
- sb.append( ", bundleExportService='" ).append( bundleExportService ).append( '\'' );
- sb.append( ", bundleDescription='" ).append( bundleDescription ).append( '\'' );
- sb.append( ", bundleName='" ).append( bundleName ).append( '\'' );
- sb.append( ", bundleLicense='" ).append( bundleLicense ).append( '\'' );
- sb.append( ", bundleDocUrl='" ).append( bundleDocUrl ).append( '\'' );
- sb.append( ", bundleImportPackage='" ).append( bundleImportPackage ).append( '\'' );
- sb.append( ", bundleRequireBundle='" ).append( bundleRequireBundle ).append( '\'' );
- sb.append( ", classifier='" ).append( classifier ).append( '\'' );
- sb.append( ", fileExtension='" ).append( fileExtension ).append( '\'' );
- sb.append( '}' );
- return sb.toString();
- }
-
- @Override
- public boolean equals( Object o )
- {
- if ( this == o )
- {
- return true;
- }
- if ( o == null || getClass() != o.getClass() )
- {
- return false;
- }
-
- SearchResultHit that = (SearchResultHit) o;
-
- if ( artifactId != null ? !artifactId.equals( that.artifactId ) : that.artifactId != null )
- {
- return false;
- }
- if ( classifier != null ? !classifier.equals( that.classifier ) : that.classifier != null )
- {
- return false;
- }
- if ( groupId != null ? !groupId.equals( that.groupId ) : that.groupId != null )
- {
- return false;
- }
- if ( packaging != null ? !packaging.equals( that.packaging ) : that.packaging != null )
- {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode()
- {
- int result = groupId != null ? groupId.hashCode() : 0;
- result = 31 * result + ( artifactId != null ? artifactId.hashCode() : 0 );
- result = 31 * result + ( packaging != null ? packaging.hashCode() : 0 );
- result = 31 * result + ( classifier != null ? classifier.hashCode() : 0 );
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultLimits.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultLimits.java b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultLimits.java
deleted file mode 100644
index 967ecc5..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultLimits.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.apache.archiva.indexer.search;
-
-/*
- * 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.
- */
-
-/**
- * SearchResultLimits - used to provide the search some limits on how the results are returned.
- * This can provide paging for the result
- */
-public class SearchResultLimits
-{
- /**
- * Constant to use for {@link #setSelectedPage(int)} to indicate a desire to get ALL PAGES.
- * USE WITH CAUTION!!
- */
- public static final int ALL_PAGES = ( -1 );
-
- private int pageSize = 30;
-
- private int selectedPage = 0;
-
- /**
- * @param selectedPage page selected use -1 for all pages
- */
- public SearchResultLimits( int selectedPage )
- {
- this.selectedPage = selectedPage;
- }
-
- /**
- * @param pageSize number of groupId:artifact per page
- * @param selectedPage page selected use -1 for all pages
- * @since 1.4-M4
- */
- public SearchResultLimits( int pageSize, int selectedPage )
- {
- this.pageSize = pageSize;
- this.selectedPage = selectedPage;
- }
-
- public int getPageSize()
- {
- return pageSize;
- }
-
- /**
- * Set page size for maximum # of hits to return per page.
- *
- * @param pageSize size of page by # of hits.
- */
- public void setPageSize( int pageSize )
- {
- this.pageSize = pageSize;
- }
-
- public int getSelectedPage()
- {
- return selectedPage;
- }
-
- public void setSelectedPage( int selectedPage )
- {
- this.selectedPage = selectedPage;
- }
-
- @Override
- public String toString()
- {
- return "SearchResultLimits{" + "pageSize=" + pageSize + ", selectedPage=" + selectedPage + '}';
- }
-}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResults.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResults.java b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResults.java
deleted file mode 100644
index 9dc650f..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResults.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.apache.archiva.indexer.search;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * SearchResults
- *
- */
-public class SearchResults
-{
- private Map<String, SearchResultHit> hits = new HashMap<>();
-
- private int totalHits;
-
- private int totalHitsMapSize;
-
- private int returnedHitsCount;
-
- private SearchResultLimits limits;
-
- public SearchResults()
- {
- /* do nothing */
- }
-
- // for new RepositorySearch
- public void addHit( String id, SearchResultHit hit )
- {
- hits.put( id, hit );
- }
-
- /**
- * Get the list of {@link SearchResultHit} objects.
- *
- * @return the list of {@link SearchResultHit} objects.
- */
- public List<SearchResultHit> getHits()
- {
- return new ArrayList<>( hits.values() );
- }
-
- /**
- * see SearchUtil on how to generate the key
- *
- * @param key
- * @return
- */
- public SearchResultHit getSearchResultHit( String key )
- {
- return hits.get( key );
- }
-
- public Map<String, SearchResultHit> getHitsMap()
- {
- return hits;
- }
-
- public boolean isEmpty()
- {
- return hits.isEmpty();
- }
-
- public SearchResultLimits getLimits()
- {
- return limits;
- }
-
- public void setLimits( SearchResultLimits limits )
- {
- this.limits = limits;
- }
-
- public int getTotalHits()
- {
- return totalHits;
- }
-
- public void setTotalHits( int totalHits )
- {
- this.totalHits = totalHits;
- }
-
- /**
- * @return
- * @since 1.4-M1
- */
- public int getReturnedHitsCount()
- {
- return returnedHitsCount;
- }
-
- /**
- * @param returnedHitsCount
- * @since 1.4-M1
- */
- public void setReturnedHitsCount( int returnedHitsCount )
- {
- this.returnedHitsCount = returnedHitsCount;
- }
-
- /**
- * @return
- * @since 1.4-M1
- */
- public int getTotalHitsMapSize()
- {
- return totalHitsMapSize;
- }
-
- /**
- * @param totalHitsMapSize
- * @since 1.4-M1
- */
- public void setTotalHitsMapSize( int totalHitsMapSize )
- {
- this.totalHitsMapSize = totalHitsMapSize;
- }
-
- @Override
- public String toString()
- {
- return "SearchResults{" + "hits=" + hits + ", totalHits=" + totalHits + ", returnedHitsCount="
- + returnedHitsCount + ", limits=" + limits + '}';
- }
-}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java b/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java
deleted file mode 100644
index 0a0c922..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.apache.archiva.indexer.util;
-
-/*
- * 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.commons.lang.StringUtils;
-
-/**
- * SearchUtil - utility class for search.
- */
-public class SearchUtil
-{
- public static String getHitId( String groupId, String artifactId, String classifier, String packaging )
- {
- return ( StringUtils.isBlank( groupId ) ? "" : StringUtils.trim( groupId ) ) + ":" //
- + ( StringUtils.isBlank( artifactId ) ? "" : StringUtils.trim( artifactId ) ) + ":" //
- + ( StringUtils.isBlank( classifier ) ? "" : StringUtils.trim( classifier ) ) + ":" //
- + ( StringUtils.isBlank( packaging ) ? "" : StringUtils.trim( packaging ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer-api/src/main/resources/META-INF/spring-context.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-indexer-api/src/main/resources/META-INF/spring-context.xml
deleted file mode 100644
index ce334de..0000000
--- a/archiva-modules/archiva-base/archiva-indexer-api/src/main/resources/META-INF/spring-context.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- ~ 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.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:task="http://www.springframework.org/schema/task"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/task
- http://www.springframework.org/schema/task/spring-task-3.0.xsd"
- default-lazy-init="false">
-
- <context:annotation-config/>
- <context:component-scan base-package="org.apache.archiva.indexer.search,org.apache.archiva.indexer.merger"/>
-
-
-
-</beans>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-indexer/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-indexer/pom.xml b/archiva-modules/archiva-base/archiva-indexer/pom.xml
index ab0d897..9634b7c 100644
--- a/archiva-modules/archiva-base/archiva-indexer/pom.xml
+++ b/archiva-modules/archiva-base/archiva-indexer/pom.xml
@@ -43,12 +43,6 @@
<artifactId>archiva-repository-layer</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-indexer-api</artifactId>
- </dependency>
-
-
- <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java
index 614a5fb..9137993 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java
@@ -26,7 +26,7 @@ import org.apache.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy;
import org.apache.archiva.policies.ProxyDownloadException;
import org.apache.archiva.policies.ReleasesPolicy;
import org.apache.archiva.policies.SnapshotsPolicy;
-import org.apache.archiva.repository.layout.LayoutException;
+import org.apache.archiva.repository.LayoutException;
import org.apache.maven.wagon.ResourceDoesNotExistException;
import org.apache.maven.wagon.TransferFailedException;
import org.apache.maven.wagon.authorization.AuthorizationException;
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-repository-api/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-repository-api/pom.xml b/archiva-modules/archiva-base/archiva-repository-api/pom.xml
new file mode 100644
index 0000000..168426c
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-api/pom.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<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">
+ <parent>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-base</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>archiva-repository-api</artifactId>
+ <packaging>bundle</packaging>
+ <name>Archiva Base :: Repository API</name>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-common</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-model</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-configuration</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>src/test/maven-search-test-repo*/**</exclude>
+ <exclude>src/test/repo-release*/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>org.apache.archiva.indexer.api</Bundle-SymbolicName>
+ <Bundle-Version>${project.version}</Bundle-Version>
+ <Export-Package>
+ org.apache.archiva.indexer.*;version=${project.version};-split-package:=merge-first
+ </Export-Package>
+ <Import-Package>
+ javax.annotation,
+ javax.inject,
+ org.apache.commons.lang*;version="[2.4,3)",
+ org.slf4j;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <appserver.base>${project.build.directory}/appserver-base</appserver.base>
+ <plexus.home>${project.build.directory}/appserver-base</plexus.home>
+ <derby.system.home>${project.build.directory}/appserver-base</derby.system.home>
+ <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
+ <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
+ <archiva.repositorySessionFactory.id>mock</archiva.repositorySessionFactory.id>
+ <openjpa.Log>${openjpa.Log}</openjpa.Log>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
new file mode 100644
index 0000000..d829983
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
@@ -0,0 +1,71 @@
+package org.apache.archiva.indexer;
+
+/*
+ * 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.model.ArtifactReference;
+import org.apache.archiva.repository.RepositoryType;
+
+import java.net.URI;
+
+public interface ArchivaIndexManager {
+
+ /**
+ * Compresses the index to a more dense packed format.
+ * @param context
+ */
+ void pack(ArchivaIndexingContext context);
+
+ /**
+ * Rescans the whole repository, this index is associated to.
+ * @param context
+ * @param update
+ */
+ void scan(ArchivaIndexingContext context, boolean update);
+
+ /**
+ * Updates the index from the remote url.
+ * @param context
+ * @param remoteUpdateUri
+ * @param fullUpdate
+ */
+ void update(ArchivaIndexingContext context, URI remoteUpdateUri, boolean fullUpdate);
+
+ /**
+ * Adds a artifact to the index.
+ * @param context
+ * @param artifactReference
+ */
+ void addArtifactToIndex(ArchivaIndexingContext context, ArtifactReference artifactReference);
+
+ /**
+ * Removes a artifact from the index.
+ * @param context
+ * @param artifactReference
+ */
+ void removeArtifactFromIndex(ArchivaIndexingContext context, ArtifactReference artifactReference);
+
+
+ /**
+ * Returns true, if this manager is able to apply the index actions for the given repository type.
+ * @param type
+ * @return
+ */
+ boolean supportsRepository(RepositoryType type);
+}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java
new file mode 100644
index 0000000..23496e7
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java
@@ -0,0 +1,130 @@
+package org.apache.archiva.indexer;
+
+/*
+ * 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.repository.Repository;
+import org.apache.archiva.repository.RepositoryType;
+
+import java.io.IOException;
+import java.net.URI;
+import java.time.LocalDateTime;
+import java.util.Set;
+
+/**
+ * This represents a indexing context that is used to manage the index of a certain repository.
+ *
+ */
+public interface ArchivaIndexingContext {
+
+ /**
+ * The identifier of the context
+ * @return
+ */
+ String getId();
+
+ /**
+ * Returns the repository this index context is associated to.
+ * @return
+ */
+ Repository getRepository();
+
+ /**
+ * The path where the index is stored.
+ * @return
+ */
+ URI getPath();
+
+ /**
+ * Returns true, if the index has no entries or is not initialized.
+ * @return
+ */
+ boolean isEmpty();
+
+ /**
+ * Writes the last changes to the index.
+ * @throws IOException
+ */
+ void commit() throws IOException;
+
+ /**
+ * Throws away the last changes.
+ * @throws IOException
+ */
+ void rollback() throws IOException;
+
+ /**
+ * Optimizes the index
+ * @throws IOException
+ */
+ void optimize() throws IOException;
+
+ /**
+ * Closes any resources, this context has open.
+ * @param deleteFiles True, if the index files should be deleted.
+ * @throws IOException
+ */
+ void close(boolean deleteFiles) throws IOException;
+
+ /**
+ * Removes all entries from the index. After this method finished,
+ * isEmpty() should return true.
+ * @throws IOException
+ */
+ void purge() throws IOException;
+
+ /**
+ * Returns true, if this index implementation has support for the given repository specific
+ * implementation class.
+ * @param clazz
+ * @return
+ */
+ boolean supports(Class<?> clazz);
+
+ /**
+ * Returns the repository specific implementation of the index. E.g. the maven index class.
+ * @param clazz the specific class
+ * @return the instance of the given class representing this index
+ * @throws UnsupportedOperationException if the implementation is not supported
+ */
+ <T> T getBaseContext(Class<T> clazz) throws UnsupportedOperationException;
+
+
+
+ /**
+ * Returns the list of groups that are assigned to this index
+ * @return
+ */
+ Set<String> getGroups();
+
+ /**
+ * Updates the timestamp of the index.
+ * @param save
+ * @throws IOException
+ */
+ void updateTimestamp(boolean save) throws IOException;
+
+ /**
+ * Updates the timestamp with the given time.
+ * @param save
+ * @param time
+ * @throws IOException
+ */
+ void updateTimestamp(boolean save, LocalDateTime time) throws IOException;
+}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/IndexManagerFactory.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/IndexManagerFactory.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/IndexManagerFactory.java
new file mode 100644
index 0000000..3eb3a14
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/IndexManagerFactory.java
@@ -0,0 +1,53 @@
+package org.apache.archiva.indexer;
+
+/*
+ * 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.repository.RepositoryType;
+import org.apache.archiva.repository.UnsupportedRepositoryTypeException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This factory is used to get a index manager for a certain repository type.
+ */
+@Service("indexerManagerFactory")
+public class IndexManagerFactory {
+
+ Map<RepositoryType, ArchivaIndexManager> managers= new HashMap<>();
+
+ @Inject
+ ApplicationContext applicationContext;
+
+ ArchivaIndexManager getIndexManager(RepositoryType type) {
+ if (managers.containsKey(type)) {
+ return managers.get(type);
+ } else {
+ ArchivaIndexManager manager = applicationContext.getBeansOfType(ArchivaIndexManager.class).values().stream().
+ filter(m -> m.supportsRepository(type)).
+ findFirst().orElseThrow(() -> new UnsupportedRepositoryTypeException(type));
+ managers.put(type, manager);
+ return manager;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java
new file mode 100644
index 0000000..39c32da
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java
@@ -0,0 +1,33 @@
+package org.apache.archiva.indexer.search;
+/*
+ * 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.model.ArchivaArtifactModel;
+import org.apache.archiva.model.ArtifactReference;
+
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M1
+ */
+public interface ArtifactInfoFilter
+{
+ boolean addArtifactInResult( ArchivaArtifactModel artifact, Map<String, SearchResultHit> currentResult );
+}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java
new file mode 100644
index 0000000..272561b
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java
@@ -0,0 +1,59 @@
+package org.apache.archiva.indexer.search;
+
+/*
+ * 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 java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+
+public interface RepositorySearch
+{
+ /**
+ * Quick search by won't return artifact with file extension pom
+ *
+ * @param principal
+ * @param selectedRepos
+ * @param term
+ * @param limits
+ * @param previousSearchTerms
+ * @return
+ */
+ SearchResults search( String principal, List<String> selectedRepos, String term, SearchResultLimits limits,
+ List<String> previousSearchTerms )
+ throws RepositorySearchException;
+
+ /**
+ * Advanced search.
+ *
+ * @param principal
+ * @param searchFields
+ * @param limits
+ * @return
+ */
+ SearchResults search( String principal, SearchFields searchFields, SearchResultLimits limits )
+ throws RepositorySearchException;
+
+ Collection<String> getAllGroupIds( String principal, List<String> selectedRepos )
+ throws RepositorySearchException;
+
+ Set<String> getRemoteIndexingContextIds( String managedRepoId )
+ throws RepositorySearchException;
+}
http://git-wip-us.apache.org/repos/asf/archiva/blob/e2cdbc2b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java
new file mode 100644
index 0000000..e3da551
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java
@@ -0,0 +1,44 @@
+package org.apache.archiva.indexer.search;
+
+/*
+ * 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.
+ */
+
+public class RepositorySearchException
+ extends Exception
+{
+ public RepositorySearchException()
+ {
+ super();
+ }
+
+ public RepositorySearchException( String msg )
+ {
+ super( msg );
+ }
+
+ public RepositorySearchException( Throwable e )
+ {
+ super( e );
+ }
+
+ public RepositorySearchException( String msg, Throwable e )
+ {
+ super( msg, e );
+ }
+}