Skip to content

Commit

Permalink
[MINDEXER-202] Reshuffle packages (#333)
Browse files Browse the repository at this point in the history
Rework, package changes in Search API to not share packages.

---

https://issues.apache.org/jira/browse/MINDEXER-202
  • Loading branch information
cstamas authored Oct 25, 2023
1 parent 34e3b46 commit ee91856
Show file tree
Hide file tree
Showing 39 changed files with 106 additions and 103 deletions.
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ under the License.
<exclude>src/test/**/*.txt</exclude>
<exclude>src/test/**/*.filename</exclude>
<exclude>src/test/**/.placeholder</exclude>
<!-- RAT is incapable to digest this -->
<exclude>**/module-info.java</exclude>
</excludes>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search;
package org.apache.maven.search.api;

import org.apache.maven.search.request.Field.BooleanField;
import org.apache.maven.search.request.Field.NumberField;
import org.apache.maven.search.request.Field.StringField;
import org.apache.maven.search.api.request.Field.BooleanField;
import org.apache.maven.search.api.request.Field.NumberField;
import org.apache.maven.search.api.request.Field.StringField;

/**
* The ontology of Apache Maven related fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search;
package org.apache.maven.search.api;

import java.util.Collections;
import java.util.Map;
import java.util.Set;

import org.apache.maven.search.request.Field;
import org.apache.maven.search.api.request.Field;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search;
package org.apache.maven.search.api;

import java.io.Closeable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search;
package org.apache.maven.search.api;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search;
package org.apache.maven.search.api;

import org.apache.maven.search.request.Paging;
import org.apache.maven.search.request.Query;
import org.apache.maven.search.api.request.Paging;
import org.apache.maven.search.api.request.Query;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search;
package org.apache.maven.search.api;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search.request;
package org.apache.maven.search.api.request;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search.request;
package org.apache.maven.search.api.request;

import java.time.Instant;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search.request;
package org.apache.maven.search.api.request;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search.request;
package org.apache.maven.search.api.request;

/**
* Paging.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search.request;
package org.apache.maven.search.api.request;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search.support;
package org.apache.maven.search.api.support;

import org.apache.maven.search.SearchBackend;
import org.apache.maven.search.api.SearchBackend;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search.support;
package org.apache.maven.search.api.support;

import java.util.List;

import org.apache.maven.search.Record;
import org.apache.maven.search.SearchRequest;
import org.apache.maven.search.SearchResponse;
import org.apache.maven.search.api.Record;
import org.apache.maven.search.api.SearchRequest;
import org.apache.maven.search.api.SearchResponse;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search.transport;
package org.apache.maven.search.api.transport;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.search.transport;
package org.apache.maven.search.api.transport;

import java.io.Closeable;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.io.IOException;

import org.apache.maven.index.context.IndexingContext;
import org.apache.maven.search.SearchBackend;
import org.apache.maven.search.SearchRequest;
import org.apache.maven.search.api.SearchBackend;
import org.apache.maven.search.api.SearchRequest;

/**
* The Indexer Core search backend.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import org.apache.lucene.search.Query;
import org.apache.maven.index.ArtifactInfo;
import org.apache.maven.search.SearchResponse;
import org.apache.maven.search.api.SearchResponse;

/**
* The Indexer Core search response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
import org.apache.maven.index.context.IndexingContext;
import org.apache.maven.index.expr.SourcedSearchExpression;
import org.apache.maven.index.search.grouping.GAGrouping;
import org.apache.maven.search.MAVEN;
import org.apache.maven.search.Record;
import org.apache.maven.search.SearchRequest;
import org.apache.maven.search.api.MAVEN;
import org.apache.maven.search.api.Record;
import org.apache.maven.search.api.SearchRequest;
import org.apache.maven.search.api.request.Field;
import org.apache.maven.search.api.request.FieldQuery;
import org.apache.maven.search.api.request.Paging;
import org.apache.maven.search.api.support.SearchBackendSupport;
import org.apache.maven.search.backend.indexer.IndexerCoreSearchBackend;
import org.apache.maven.search.backend.indexer.IndexerCoreSearchResponse;
import org.apache.maven.search.request.Field;
import org.apache.maven.search.request.FieldQuery;
import org.apache.maven.search.request.Paging;
import org.apache.maven.search.support.SearchBackendSupport;

import static java.util.Objects.requireNonNull;

Expand Down Expand Up @@ -146,9 +146,10 @@ public IndexerCoreSearchResponse search(SearchRequest searchRequest) throws IOEx
}
}

private Query toQuery(HashSet<Field> searchedFields, org.apache.maven.search.request.Query query) {
if (query instanceof org.apache.maven.search.request.BooleanQuery.And) {
org.apache.maven.search.request.BooleanQuery bq = (org.apache.maven.search.request.BooleanQuery) query;
private Query toQuery(HashSet<Field> searchedFields, org.apache.maven.search.api.request.Query query) {
if (query instanceof org.apache.maven.search.api.request.BooleanQuery.And) {
org.apache.maven.search.api.request.BooleanQuery bq =
(org.apache.maven.search.api.request.BooleanQuery) query;
return new BooleanQuery.Builder()
.add(new BooleanClause(toQuery(searchedFields, bq.getLeft()), BooleanClause.Occur.MUST))
.add(new BooleanClause(toQuery(searchedFields, bq.getRight()), BooleanClause.Occur.MUST))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

import org.apache.lucene.search.Query;
import org.apache.maven.index.ArtifactInfo;
import org.apache.maven.search.Record;
import org.apache.maven.search.SearchRequest;
import org.apache.maven.search.api.Record;
import org.apache.maven.search.api.SearchRequest;
import org.apache.maven.search.api.support.SearchResponseSupport;
import org.apache.maven.search.backend.indexer.IndexerCoreSearchResponse;
import org.apache.maven.search.support.SearchResponseSupport;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@
import org.apache.maven.index.updater.IndexUpdateResult;
import org.apache.maven.index.updater.IndexUpdater;
import org.apache.maven.index.updater.ResourceFetcher;
import org.apache.maven.search.MAVEN;
import org.apache.maven.search.Record;
import org.apache.maven.search.SearchRequest;
import org.apache.maven.search.SearchResponse;
import org.apache.maven.search.api.MAVEN;
import org.apache.maven.search.api.Record;
import org.apache.maven.search.api.SearchRequest;
import org.apache.maven.search.api.SearchResponse;
import org.apache.maven.search.api.request.FieldQuery;
import org.apache.maven.search.backend.indexer.IndexerCoreSearchBackend;
import org.apache.maven.search.backend.indexer.IndexerCoreSearchBackendFactory;
import org.apache.maven.search.request.FieldQuery;
import org.eclipse.sisu.launch.InjectedTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import static java.util.Objects.requireNonNull;
import static org.apache.maven.search.request.BooleanQuery.and;
import static org.apache.maven.search.request.Query.query;
import static org.apache.maven.search.api.request.BooleanQuery.and;
import static org.apache.maven.search.api.request.Query.query;

@Ignore("This is not a test, is more a showcase")
public class IndexerCoreSearchBackendImplTest extends InjectedTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
import java.util.HashMap;
import java.util.Map;

import org.apache.maven.search.MAVEN;
import org.apache.maven.search.SearchRequest;
import org.apache.maven.search.request.BooleanQuery;
import org.apache.maven.search.request.Field;
import org.apache.maven.search.request.FieldQuery;
import org.apache.maven.search.request.Query;
import org.apache.maven.search.api.MAVEN;
import org.apache.maven.search.api.SearchRequest;
import org.apache.maven.search.api.request.BooleanQuery;
import org.apache.maven.search.api.request.Field;
import org.apache.maven.search.api.request.FieldQuery;
import org.apache.maven.search.api.request.Query;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import java.util.HashMap;
import java.util.Map;

import org.apache.maven.search.MAVEN;
import org.apache.maven.search.Record;
import org.apache.maven.search.request.Field;
import org.apache.maven.search.api.MAVEN;
import org.apache.maven.search.api.Record;
import org.apache.maven.search.api.request.Field;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

import java.io.IOException;

import org.apache.maven.search.SearchBackend;
import org.apache.maven.search.SearchRequest;
import org.apache.maven.search.api.SearchBackend;
import org.apache.maven.search.api.SearchRequest;

/**
* The Remote Repository search backend.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
*/
package org.apache.maven.search.backend.remoterepository;

import org.apache.maven.search.api.transport.Java11HttpClientTransport;
import org.apache.maven.search.api.transport.Transport;
import org.apache.maven.search.backend.remoterepository.extractor.MavenCentralResponseExtractor;
import org.apache.maven.search.backend.remoterepository.extractor.Nx2ResponseExtractor;
import org.apache.maven.search.backend.remoterepository.internal.RemoteRepositorySearchBackendImpl;
import org.apache.maven.search.transport.Java11HttpClientTransport;
import org.apache.maven.search.transport.Transport;

/**
* The remote repository search backend factory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.maven.search.backend.remoterepository;

import org.apache.maven.search.SearchResponse;
import org.apache.maven.search.api.SearchResponse;
import org.jsoup.nodes.Document;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.util.List;

import org.apache.maven.search.Record;
import org.apache.maven.search.api.Record;
import org.jsoup.nodes.Document;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.util.List;

import org.apache.maven.search.Record;
import org.apache.maven.search.api.Record;
import org.apache.maven.search.backend.remoterepository.Context;
import org.apache.maven.search.backend.remoterepository.RecordFactory;
import org.jsoup.nodes.Document;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.util.List;

import org.apache.maven.search.Record;
import org.apache.maven.search.api.Record;
import org.apache.maven.search.backend.remoterepository.Context;
import org.apache.maven.search.backend.remoterepository.RecordFactory;
import org.jsoup.nodes.Document;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.util.List;

import org.apache.maven.search.Record;
import org.apache.maven.search.api.Record;
import org.apache.maven.search.backend.remoterepository.Context;
import org.apache.maven.search.backend.remoterepository.RecordFactory;
import org.apache.maven.search.backend.remoterepository.ResponseExtractor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
import java.util.Objects;
import java.util.Properties;

import org.apache.maven.search.Record;
import org.apache.maven.search.SearchRequest;
import org.apache.maven.search.api.Record;
import org.apache.maven.search.api.SearchRequest;
import org.apache.maven.search.api.support.SearchBackendSupport;
import org.apache.maven.search.api.transport.Transport;
import org.apache.maven.search.backend.remoterepository.Context;
import org.apache.maven.search.backend.remoterepository.RecordFactory;
import org.apache.maven.search.backend.remoterepository.RemoteRepositorySearchBackend;
import org.apache.maven.search.backend.remoterepository.RemoteRepositorySearchResponse;
import org.apache.maven.search.backend.remoterepository.ResponseExtractor;
import org.apache.maven.search.support.SearchBackendSupport;
import org.apache.maven.search.transport.Transport;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.parser.Parser;
Expand Down
Loading

0 comments on commit ee91856

Please sign in to comment.