Commit 675ebe89 authored by Matija Obreza's avatar Matija Obreza

GenesysClient#toArrayNode

parent 21216be6
......@@ -238,20 +238,14 @@ public class GenesysClient {
public String updateMLS(String instCode, Collection<ObjectNode> accns) throws GenesysApiException {
ArrayNode arr = mapper.createArrayNode();
for (ObjectNode accn : accns) {
arr.add(accn);
}
ArrayNode arr = toArrayNode(accns);
_log.debug("Sending: " + arr);
return query(Verb.PUT, "/acn/" + instCode + "/update", null, arr.toString());
}
public String accessionExists(String instCode, Collection<ObjectNode> accns) throws GenesysApiException {
ArrayNode arr = mapper.createArrayNode();
for (ObjectNode accn : accns) {
arr.add(accn);
}
ArrayNode arr = toArrayNode(accns);
_log.debug("Sending: " + arr);
return query(Verb.PUT, "/acn/" + instCode + "/check", null, arr.toString());
......@@ -263,12 +257,15 @@ public class GenesysClient {
return null;
}
return updateAccessions(instCode, toArrayNode(accns));
}
public static ArrayNode toArrayNode(Collection<ObjectNode> accns) {
ArrayNode arr = mapper.createArrayNode();
for (ObjectNode accn : accns) {
arr.add(accn);
}
return updateAccessions(instCode, arr);
return arr;
}
public String updateAccessions(String instCode, ArrayNode arr) throws OAuthAuthenticationException, GenesysApiException, InterruptedException {
......@@ -319,7 +316,7 @@ public class GenesysClient {
}
public String deleteAccessions(String instCode, ArrayNode array) throws GenesysApiException {
return query(Verb.PUT, "/acn/" + instCode + "/delete", null, array.toString());
return query(Verb.POST, "/acn/" + instCode + "/delete-named", null, array.toString());
}
public String deleteAccession(String instCode, ArrayNode ids) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment