Commit f70d3862 authored by neelesh thakur's avatar neelesh thakur
Browse files

Merge branch 'remove-deprecated-api' into 'master'

remove deprecated search API from client lib

See merge request !113
parents 7d3d9a5b e2a64496
Pipeline #61059 failed with stages
in 7 minutes and 39 seconds
...@@ -24,7 +24,7 @@ The following software have components provided under the terms of this license: ...@@ -24,7 +24,7 @@ The following software have components provided under the terms of this license:
- Expression Language 3.0 (from https://projects.eclipse.org/projects/ee4j.el) - Expression Language 3.0 (from https://projects.eclipse.org/projects/ee4j.el)
- FindBugs-jsr305 (from http://findbugs.sourceforge.net/) - FindBugs-jsr305 (from http://findbugs.sourceforge.net/)
- Google HTTP Client Library for Java (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client) - Google HTTP Client Library for Java (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client)
- Gson (from http://code.google.com/p/google-gson/) - Gson (from https://repo1.maven.org/maven2/com/google/code/gson/gson)
- Guava InternalFutureFailureAccess and InternalFutures (from https://repo1.maven.org/maven2/com/google/guava/failureaccess) - Guava InternalFutureFailureAccess and InternalFutures (from https://repo1.maven.org/maven2/com/google/guava/failureaccess)
- Guava: Google Core Libraries for Java (from https://repo1.maven.org/maven2/com/google/guava/guava) - Guava: Google Core Libraries for Java (from https://repo1.maven.org/maven2/com/google/guava/guava)
- HPPC Collections (from https://repo1.maven.org/maven2/com/carrotsearch/hppc) - HPPC Collections (from https://repo1.maven.org/maven2/com/carrotsearch/hppc)
......
...@@ -14,8 +14,11 @@ ...@@ -14,8 +14,11 @@
package org.opengroup.osdu.core.common.search; package org.opengroup.osdu.core.common.search;
import com.google.gson.JsonObject; import org.opengroup.osdu.core.common.model.search.CursorQueryRequest;
import org.opengroup.osdu.core.common.model.search.*; import org.opengroup.osdu.core.common.model.search.CursorQueryResponse;
import org.opengroup.osdu.core.common.model.search.QueryRequest;
import org.opengroup.osdu.core.common.model.search.QueryResponse;
import org.opengroup.osdu.core.common.model.search.SearchException;
public interface ISearchService { public interface ISearchService {
CursorQueryResponse getAllKindEntries(String kind) throws SearchException; CursorQueryResponse getAllKindEntries(String kind) throws SearchException;
...@@ -23,8 +26,4 @@ public interface ISearchService { ...@@ -23,8 +26,4 @@ public interface ISearchService {
QueryResponse search(QueryRequest searchRequest) throws SearchException; QueryResponse search(QueryRequest searchRequest) throws SearchException;
CursorQueryResponse searchCursor(CursorQueryRequest cursorRequest) throws SearchException; CursorQueryResponse searchCursor(CursorQueryRequest cursorRequest) throws SearchException;
JsonObject getIndexSchema(String kind) throws SearchException;
void deleteIndex(String kind) throws SearchException;
} }
\ No newline at end of file
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
package org.opengroup.osdu.core.common.search; package org.opengroup.osdu.core.common.search;
import com.google.gson.JsonObject;
import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper; import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper;
import org.opengroup.osdu.core.common.http.json.HttpResponseBodyParsingException; import org.opengroup.osdu.core.common.http.json.HttpResponseBodyParsingException;
import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.model.http.DpsHeaders;
...@@ -74,22 +73,6 @@ public class SearchService implements ISearchService { ...@@ -74,22 +73,6 @@ public class SearchService implements ISearchService {
return result.IsNotFoundCode() ? new CursorQueryResponse() : this.getResult(result, CursorQueryResponse.class); return result.IsNotFoundCode() ? new CursorQueryResponse() : this.getResult(result, CursorQueryResponse.class);
} }
@Override
public JsonObject getIndexSchema(String kind) throws SearchException {
String url = this.createUrl(String.format("/index/schema/%s", kind));
HttpResponse result = this.httpClient.send(
HttpRequest.get().url(url).headers(this.headers.getHeaders()).build());
return result.IsNotFoundCode() ? null : this.getResult(result, JsonObject.class);
}
@Override
public void deleteIndex(String kind) throws SearchException {
String url = this.createUrl(String.format("/index/%s", kind));
HttpResponse result = this.httpClient.send(
HttpRequest.delete().url(url).headers(this.headers.getHeaders()).build());
this.getResult(result, String.class);
}
private SearchException generateException(HttpResponse result) { private SearchException generateException(HttpResponse result) {
return new SearchException( return new SearchException(
"Error making request to Search service. Check the inner HttpResponse for more info.", result); "Error making request to Search service. Check the inner HttpResponse for more info.", result);
......
Supports Markdown
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