Skip to content

Commit

Permalink
Move CDX_URL to config
Browse files Browse the repository at this point in the history
  • Loading branch information
ato committed Mar 14, 2024
1 parent 28341f1 commit d1d4929
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion delivery/src/pandas/delivery/CdxClient.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pandas.delivery;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;
Expand All @@ -16,7 +17,11 @@

@Service
public class CdxClient {
private final WebClient webClient = WebClient.create("http://winch.nla.gov.au:9901/trove/ap/public");
public CdxClient(@Value("${CDX_URL}") String cdxUrl) {
webClient = WebClient.create(cdxUrl);
}

private final WebClient webClient;

public Map<Instance,Decision> checkInstanceRestrictions(List<Instance> instances) {
var map = new HashMap<Instance,Decision>();
Expand Down
7 changes: 6 additions & 1 deletion ui/src/pandas/collection/CaptureIndex.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pandas.collection;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.io.BufferedReader;
Expand All @@ -15,7 +16,11 @@

@Service
public class CaptureIndex {
private String baseUrl = "http://winch.nla.gov.au:9901/trove";
public CaptureIndex(@Value("${CDX_URL:}") String cdxUrl) {
this.baseUrl = cdxUrl;
}

private String baseUrl;

public List<Capture> query(String q, boolean excludeErrors) {
List<String> urls = new ArrayList<>();
Expand Down

0 comments on commit d1d4929

Please sign in to comment.