Skip to content

Commit

Permalink
updates to match registry-common refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Niessner authored and Al Niessner committed Mar 31, 2024
1 parent a993cd3 commit 907e20e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 128 deletions.
96 changes: 0 additions & 96 deletions src/main/java/gov/nasa/pds/harvest/dao/EsRequestBuilder.java

This file was deleted.

18 changes: 8 additions & 10 deletions src/main/java/gov/nasa/pds/harvest/dao/RegistryDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import gov.nasa.pds.harvest.exception.InvalidPDS4ProductException;
import gov.nasa.pds.registry.common.Request;
import gov.nasa.pds.registry.common.Response;
import gov.nasa.pds.registry.common.RestClient;
Expand All @@ -22,7 +23,6 @@ public class RegistryDao
private String indexName;
private boolean pretty;

private EsRequestBuilder requestBld;
private SearchResponseParser parser;


Expand All @@ -48,8 +48,6 @@ public RegistryDao(RestClient client, String indexName, boolean pretty)
this.client = client;
this.indexName = indexName;
this.pretty = pretty;

requestBld = new EsRequestBuilder();
parser = new SearchResponseParser();
}

Expand Down Expand Up @@ -91,13 +89,13 @@ public Set<String> getNonExistingIds(Collection<String> ids) throws Exception

private Response searchIds(Collection<String> ids) throws Exception
{
String json = requestBld.createSearchIdsRequest(ids, ids.size());

String reqUrl = "/" + indexName + "/_search";
if(pretty) reqUrl += "?pretty";

Request req = client.createRequest(Request.Method.GET, reqUrl);
req.setJsonEntity(json);
if(ids == null || ids.isEmpty()) throw new InvalidPDS4ProductException("Error reading bundle/collection references. " +
"Verify the bundle/collection is valid prior to loading the data.");
Request.Search req = client.createSearchRequest()
.buildTheseIds(ids)
.setIndex(this.indexName)
.setPretty(pretty);
Response resp = client.performRequest(req);

return resp;
Expand Down
22 changes: 0 additions & 22 deletions src/test/java/tt/es/TestRequestBuilder.java

This file was deleted.

0 comments on commit 907e20e

Please sign in to comment.