diff --git a/pic-sure-api-data/pom.xml b/pic-sure-api-data/pom.xml index 55b6eecd..beed91bd 100755 --- a/pic-sure-api-data/pom.xml +++ b/pic-sure-api-data/pom.xml @@ -40,7 +40,6 @@ io.swagger.core.v3 swagger-annotations - 2.2.8 diff --git a/pic-sure-api-war/pom.xml b/pic-sure-api-war/pom.xml index b2c3ae41..9d476c96 100755 --- a/pic-sure-api-war/pom.xml +++ b/pic-sure-api-war/pom.xml @@ -32,7 +32,6 @@ com.github.tomakehurst wiremock-jre8 - 2.27.2 test @@ -69,7 +68,6 @@ org.apache.cxf cxf-rt-frontend-jaxrs - 3.4.1 test diff --git a/pic-sure-api-wildfly/pom.xml b/pic-sure-api-wildfly/pom.xml index 8b8dc576..6d0e0b58 100644 --- a/pic-sure-api-wildfly/pom.xml +++ b/pic-sure-api-wildfly/pom.xml @@ -35,12 +35,6 @@ classes ${project.version} - - edu.harvard.hms.dbmi.avillach - pic-sure-hsapi-resource - classes - ${project.version} - edu.harvard.hms.dbmi.avillach pic-sure-resource-api diff --git a/pic-sure-api-wildfly/src/test/java/edu/harvard/dbmi/avillach/HSAPIResourceIT.java b/pic-sure-api-wildfly/src/test/java/edu/harvard/dbmi/avillach/HSAPIResourceIT.java deleted file mode 100644 index b4d174af..00000000 --- a/pic-sure-api-wildfly/src/test/java/edu/harvard/dbmi/avillach/HSAPIResourceIT.java +++ /dev/null @@ -1,209 +0,0 @@ -package edu.harvard.dbmi.avillach; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import edu.harvard.dbmi.avillach.domain.QueryRequest; -import edu.harvard.dbmi.avillach.util.exception.ApplicationException; -import edu.harvard.dbmi.avillach.util.exception.ProtocolException; -import org.apache.commons.io.IOUtils; -import org.apache.http.Header; -import org.apache.http.HttpResponse; -import org.junit.Test; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.github.tomakehurst.wiremock.client.WireMock.*; -import static edu.harvard.dbmi.avillach.util.HttpClientUtil.*; -import static org.junit.Assert.*; - -public class HSAPIResourceIT extends BaseIT { - - private final String targetURL = "http://localhost:8079"; - private Header[] headers; - - @Test - public void testStatus() throws UnsupportedOperationException { - HttpResponse response = retrieveGetResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/status"), headers); - assertEquals("Status should return a 200", 200, response.getStatusLine().getStatusCode()); - } - - @Test - public void testInfo() throws UnsupportedOperationException, IOException { - QueryRequest request = new GeneralQueryRequest(); - - String body = objectMapper.writeValueAsString(request); - HttpResponse response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/info"), headers, body); - assertEquals("Request should return a 200",200, response.getStatusLine().getStatusCode()); - JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Response should not be null", responseNode); - assertNotNull("Response should have a name", responseNode.get("name")); - ArrayNode queryFormats = (ArrayNode) responseNode.get("queryFormats"); - assertNotNull("Response should have data in queryFormats", queryFormats); - assertEquals("Response should have 3 queryFormats", 3, queryFormats.size()); - JsonNode firstFormat = queryFormats.get(0); - assertNotNull("QueryFormat should have specifications", firstFormat.get("specification")); - - } - - @Test - public void testSearch() throws UnsupportedOperationException, IOException { - QueryRequest queryRequest = new GeneralQueryRequest(); - - String body = objectMapper.writeValueAsString(queryRequest); - - HttpResponse response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/search"), headers, body); - assertEquals("Search should return a 501",501, response.getStatusLine().getStatusCode()); - JsonNode responseMessage = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Response message should not be null", responseMessage); - String errorMessage = responseMessage.get("message").asText(); - assertEquals("Error message should be 'Search is not implemented for this resource'", "Search is not implemented for this resource", errorMessage); - } - - @Test - public void testQuery() throws UnsupportedOperationException, IOException { - QueryRequest queryRequest = new GeneralQueryRequest(); - - String body = objectMapper.writeValueAsString(queryRequest); - - HttpResponse response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query"), headers, body); - assertEquals("Search should return a 501",501, response.getStatusLine().getStatusCode()); - JsonNode responseMessage = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Response message should not be null", responseMessage); - String errorMessage = responseMessage.get("message").asText(); - assertEquals("Error message should be 'Query is not implemented in this resource. Please use query/sync'", "Query is not implemented in this resource. Please use query/sync", errorMessage); - } - - //These tests will throw a 404 unless we have a valid queryId which can't really be gotten just for a test.... - /*@Test - public void testQueryStatus() throws UnsupportedOperationException, IOException { - } - - @Test - public void testRequest() throws UnsupportedOperationException, IOException { - }*/ - - @Test - public void testQuerySync() throws UnsupportedOperationException, IOException { - Map resourceResponse = new HashMap<>(); - List> results = new ArrayList<>(); - Map firstResult = new HashMap<>(); - firstResult.put("resource_id", "123abc"); - firstResult.put("url", "http://aUrl.org/path/contents/file.csv"); - results.add(firstResult); - resourceResponse.put("results", results); - - wireMockRule.stubFor(any(urlPathMatching("/resource")) - .willReturn(aResponse() - .withStatus(200) - .withBody(objectMapper.writeValueAsString(resourceResponse)))); - - wireMockRule.stubFor(any(urlPathMatching("/resource/.*/files")) - .willReturn(aResponse() - .withStatus(200) - .withBody(objectMapper.writeValueAsString(resourceResponse)))); - - wireMockRule.stubFor(any(urlPathMatching("/resource/.*/files/.*")) - .willReturn(aResponse() - .withStatus(200) - .withBody(objectMapper.writeValueAsString(resourceResponse)))); - - QueryRequest queryRequest = new GeneralQueryRequest(); - String body = objectMapper.writeValueAsString(queryRequest); - - //Should throw an error if missing query object - HttpResponse response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); - assertEquals("Missing query object should return a 500",500, response.getStatusLine().getStatusCode()); - JsonNode responseMessage = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Response message should not be null", responseMessage); - String errorMessage = responseMessage.get("message").asText(); - System.out.println("Response message is: " + responseMessage); - assertTrue("Error message should be " + ProtocolException.MISSING_DATA, errorMessage.contains(ProtocolException.MISSING_DATA)); - - //Should throw an error if missing targetURL - Map queryNode = new HashMap<>(); - queryRequest.setQuery(queryNode); -// body = objectMapper.writeValueAsString(queryRequest); -// response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); -// assertEquals("Missing target URL should return 500",500, response.getStatusLine().getStatusCode()); -// responseMessage = objectMapper.readTree(response.getEntity().getContent()); -// assertNotNull("Response message should not be null", responseMessage); -// errorMessage = responseMessage.get("message").asText(); -// assertTrue("Error message should be " + ApplicationException.MISSING_TARGET_URL, errorMessage.contains(ApplicationException.MISSING_TARGET_URL)); - - //Should throw error if no 'entity' included - body = objectMapper.writeValueAsString(queryRequest); - response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); - assertEquals("Missing entity should return 500",500, response.getStatusLine().getStatusCode()); - responseMessage = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Response message should not be null", responseMessage); - errorMessage = responseMessage.get("message").asText(); - assertTrue("Error message should be 'Entity required'", errorMessage.contains("Entity required")); - - queryNode.put("entity", "nonentity"); - body = objectMapper.writeValueAsString(queryRequest); - response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); - assertEquals("Incorrect entity should return 500",500, response.getStatusLine().getStatusCode()); - responseMessage = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Response message should not be null", responseMessage); - errorMessage = responseMessage.get("message").asText(); - //TODO Should we do something different instead? - assertTrue("Error message should be '404 NOT FOUND'", errorMessage.toUpperCase().contains("404 NOT FOUND")); - - //Ok this one should work - queryNode.put("entity", "resource"); - body = objectMapper.writeValueAsString(queryRequest); - response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); - assertEquals(200, response.getStatusLine().getStatusCode()); - - //Need to get an id to use - JsonNode result = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Results should not be null", result.get("results")); - String id = result.get("results").get(0).get("resource_id").asText(); - - //This skips over the required id - queryNode.put("subentity", "files"); - body = objectMapper.writeValueAsString(queryRequest); - response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); - assertEquals("Incorrect entity should return 500",500, response.getStatusLine().getStatusCode()); - responseMessage = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Response message should not be null", responseMessage); - errorMessage = responseMessage.get("message").asText(); - assertTrue("Error message should be 'Cannot have subentity without an id'", errorMessage.contains("Cannot have subentity without an id")); - - queryNode.put("id", id); - body = objectMapper.writeValueAsString(queryRequest); - response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); - assertEquals(200, response.getStatusLine().getStatusCode()); - - //Need to get a pathname to use - result = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Results should not be null", result.get("results")); - - String pathname = result.get("results").get(0).get("url").asText(); - pathname = pathname.substring(pathname.lastIndexOf("/")); - queryNode.put("pathname", pathname); - queryNode.put("subentity", "files"); - body = objectMapper.writeValueAsString(queryRequest); - response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); - assertEquals(200, response.getStatusLine().getStatusCode()); - - //Should fail with a page where it isn't allowed - queryNode.put("page", "2"); - body = objectMapper.writeValueAsString(queryRequest); - response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); - assertEquals(500, response.getStatusLine().getStatusCode()); - - //But should work with a page for this one - queryNode.remove("pathname"); - body = objectMapper.writeValueAsString(queryRequest); - response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query/sync"), headers, body); - assertEquals(200, response.getStatusLine().getStatusCode()); - result = objectMapper.readTree(response.getEntity().getContent()); - assertNotNull("Response message should not be null", result.get("results")); - - } -} diff --git a/pic-sure-initializer/pom.xml b/pic-sure-initializer/pom.xml index c17e7f4a..24162e53 100644 --- a/pic-sure-initializer/pom.xml +++ b/pic-sure-initializer/pom.xml @@ -7,16 +7,12 @@ edu.harvard.hms.dbmi.avillach 2.0.0-SNAPSHOT - pic-sure-initializer - pic-sure-initializer - commons-io commons-io - 2.7 edu.harvard.hms.dbmi.avillach @@ -26,19 +22,16 @@ junit junit - 4.11 test org.apache.httpcomponents httpclient - 4.5.13 compile commons-cli commons-cli - 1.4 diff --git a/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/pom.xml b/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/pom.xml index 69fec0d2..47ac0ff4 100644 --- a/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/pom.xml +++ b/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/pom.xml @@ -40,7 +40,6 @@ org.apache.httpcomponents httpclient - 4.5.13 org.apache.httpcomponents @@ -53,12 +52,10 @@ commons-io commons-io - 2.7 org.jboss.resteasy resteasy-jaxb-provider - 3.0.8.Final edu.harvard.hms.dbmi.avillach @@ -68,7 +65,6 @@ org.apache.commons commons-lang3 - 3.7 org.hibernate.javax.persistence diff --git a/pic-sure-resources/pic-sure-ga4gh-dos/pom.xml b/pic-sure-resources/pic-sure-ga4gh-dos/pom.xml index fb9694f7..2bc99fa9 100644 --- a/pic-sure-resources/pic-sure-ga4gh-dos/pom.xml +++ b/pic-sure-resources/pic-sure-ga4gh-dos/pom.xml @@ -31,7 +31,6 @@ org.apache.httpcomponents httpclient - 4.5.13 com.fasterxml.jackson.core @@ -40,12 +39,10 @@ commons-io commons-io - 2.7 org.jboss.resteasy resteasy-jaxb-provider - 3.0.8.Final edu.harvard.hms.dbmi.avillach @@ -55,7 +52,6 @@ org.apache.commons commons-lang3 - 3.7 org.hibernate.javax.persistence diff --git a/pic-sure-resources/pic-sure-hsapi-resource/README.md b/pic-sure-resources/pic-sure-hsapi-resource/README.md deleted file mode 100644 index ed78b6d4..00000000 --- a/pic-sure-resources/pic-sure-hsapi-resource/README.md +++ /dev/null @@ -1,58 +0,0 @@ -### HSAPI Commons Resource - -This resource queries the [CommonsShare API](https://beta.commonsshare.org/) - -The following endpoints are supported: -* /hsapi/resource/ -* /haspi/resource/{id} -* /hsapi/resource/{id}/files/ -* /hsapi/resource/{id}/files/{pathname}/ -* /hsapi/resource/{id}/folders/{pathname}/ - -`resource` is the entity being queried; `files` and `folders` are the subentities. - -Sample resource query: -``` -{ "resourceUUID" : "${HSAPI-RESOURCE-ID}", - "query": - { - "entity": "resource - } -} -``` - -Sample resource query by page: -``` -{ "resourceUUID" : "${HSAPI-RESOURCE-ID}", - "query": - { - "entity": "resource, - "page": "2" - } -} -``` - -Sample files query: -``` -{ "resourceUUID" : "${HSAPI-RESOURCE-ID}", - "query": - { - "entity": "resource, - "id": "123-abc", - "subentity": "files" - } -} -``` - -Sample single file query: -``` -{ "resourceUUID" : "${HSAPI-RESOURCE-ID}", - "query": - { - "entity": "resource, - "id": "123-abc", - "subentity": "files", - "pathname": "/content/filename.csv" - } -} -``` \ No newline at end of file diff --git a/pic-sure-resources/pic-sure-hsapi-resource/pom.xml b/pic-sure-resources/pic-sure-hsapi-resource/pom.xml deleted file mode 100644 index c5505a8e..00000000 --- a/pic-sure-resources/pic-sure-hsapi-resource/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - 4.0.0 - - edu.harvard.hms.dbmi.avillach - pic-sure-resources - 2.1.0-SNAPSHOT - - pic-sure-hsapi-resource - pic-sure-hsapi-resource - war - http://maven.apache.org - - 13.0.0.Final - ${project.build.directory}/wildfly-${wildfly.version} - UTF-8 - - - - edu.harvard.hms.dbmi.avillach - pic-sure-resource-api - ${project.version} - - - javax - javaee-api - provided - - - org.apache.httpcomponents - httpclient - 4.5.13 - - - com.fasterxml.jackson.core - jackson-databind - - - commons-io - commons-io - 2.7 - - - org.jboss.resteasy - resteasy-jaxb-provider - 3.0.8.Final - - - edu.harvard.hms.dbmi.avillach - pic-sure-util - ${project.version} - - - org.apache.commons - commons-lang3 - 3.7 - - - org.hibernate.javax.persistence - hibernate-jpa-2.1-api - - - org.hibernate - hibernate-annotations - - - diff --git a/pic-sure-resources/pic-sure-hsapi-resource/src/main/java/edu/harvard/hms/dbmi/avillach/HSAPIResourceRS.java b/pic-sure-resources/pic-sure-hsapi-resource/src/main/java/edu/harvard/hms/dbmi/avillach/HSAPIResourceRS.java deleted file mode 100644 index 58d94262..00000000 --- a/pic-sure-resources/pic-sure-hsapi-resource/src/main/java/edu/harvard/hms/dbmi/avillach/HSAPIResourceRS.java +++ /dev/null @@ -1,225 +0,0 @@ -package edu.harvard.hms.dbmi.avillach; - -import java.io.IOException; -import java.util.*; - -import javax.ws.rs.*; -import javax.ws.rs.core.Response; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import edu.harvard.dbmi.avillach.domain.*; -import edu.harvard.dbmi.avillach.util.exception.ApplicationException; -import edu.harvard.dbmi.avillach.util.exception.ProtocolException; -import edu.harvard.dbmi.avillach.util.exception.ResourceInterfaceException; -import org.apache.http.Header; -import org.apache.http.HttpResponse; - -import edu.harvard.dbmi.avillach.service.IResourceRS; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static edu.harvard.dbmi.avillach.util.HttpClientUtil.*; - - -@Path("/hsapi") -@Produces("application/json") -@Consumes("application/json") -public class HSAPIResourceRS implements IResourceRS -{ - private final static ObjectMapper json = new ObjectMapper(); - private ResourceInfo HSAPIresourceInfo = new ResourceInfo(); - private Header[] headers; - private Logger logger = LoggerFactory.getLogger(this.getClass()); - - public static String targetURL = System.getenv("HSAPI_TARGET_URL"); - - public HSAPIResourceRS() { - //This only needs to be done once - List queryFormats = new ArrayList<>(); - - // /hsapi/resource/ - QueryFormat resource = new QueryFormat().setName("Resource List").setDescription("List existing resources"); - Map specification = new HashMap<>(); - specification.put("entity", "The type of entity you wish to retrieve or explore - e.g. resource or user"); - specification.put("page", "Optional - A page number within the paginated result set"); - resource.setSpecification(specification); - - Map example = new HashMap<>(); - example.put("entity", "resource"); - List> examples = new ArrayList<>(); - examples.add(example); - - Map example2 = new HashMap<>(); - example2.put("entity", "resource"); - example2.put("page", "2"); - examples.add(example2); - - resource.setExamples(examples); - queryFormats.add(resource); - - // /hsapi/resource/{id}/files/ - QueryFormat files = new QueryFormat().setName("File List").setDescription("Get a listing of files within a resource"); - specification.put("entity", "The type of entity you wish to retrieve or explore - e.g. resource or user"); - specification.put("id", "The id of the specific entity to retrieve or explore"); - specification.put("subentity", "A type of entity within the main entity - e.g. file (under resource)"); - specification.put("page", "Optional - A page number within the paginated result set"); - files.setSpecification(specification); - - example = new HashMap<>(); - example.put("entity", "resource"); - example.put("id", "a1b23c"); - example.put("subentity", "files"); - examples = new ArrayList<>(); - examples.add(example); - - example2 = new HashMap<>(); - example2.put("entity", "resource"); - example2.put("id", "a1b23c"); - example2.put("subentity", "files"); - example2.put("page", "2"); - examples.add(example2); - files.setExamples(examples); - queryFormats.add(files); - - // /hsapi/resource/{id}/files/{pathname}/ - QueryFormat filePath = new QueryFormat().setName("Get File").setDescription("Retrieve a resource file"); - - specification.put("entity", "The type of entity you wish to retrieve or explore - e.g. resource or user"); - specification.put("id", "The id of the specific entity to retrieve or explore"); - specification.put("subentity", "A type of entity within the main entity - e.g. file (under resource)"); - specification.put("pathname", "The name or path of the specific subentity you are looking for"); - files.setSpecification(specification); - - example = new HashMap<>(); - example.put("entity", "resource"); - example.put("id", "a1b23c"); - example.put("subentity", "files"); - example.put("pathname", "abc.csv"); - examples = new ArrayList<>(); - examples.add(example); - filePath.setExamples(examples); - queryFormats.add(filePath); - - HSAPIresourceInfo.setQueryFormats(queryFormats); - } - - @GET - @Path("/status") - public Response status() { - return Response.ok().build(); - } - - @POST - @Path("/info") - @Override - public ResourceInfo info(QueryRequest queryRequest) { - logger.debug("Calling HSAPI Resource info()"); - HSAPIresourceInfo.setName("HSAPI Resource : " + targetURL); - return HSAPIresourceInfo; - } - - @POST - @Path("/search") - @Override - public SearchResults search(QueryRequest searchJson) { - logger.debug("Calling HSAPI Resource search()"); - throw new UnsupportedOperationException("Search is not implemented for this resource"); - } - - @POST - @Path("/query") - @Override - public QueryStatus query(QueryRequest queryJson) { - logger.debug("Calling HSAPI Resource query()"); - throw new UnsupportedOperationException("Query is not implemented in this resource. Please use query/sync"); - } - - @POST - @Path("/query/{resourceQueryId}/status") - @Override - public QueryStatus queryStatus(@PathParam("resourceQueryId") UUID queryId, QueryRequest statusQuery) { - logger.debug("calling HSAPI Resource queryStatus() for query {}", queryId); - throw new UnsupportedOperationException("Query status is not implemented in this resource. Please use query/sync"); - - } - - @POST - @Path("/query/{resourceQueryId}/result") - @Override - public Response queryResult(@PathParam("resourceQueryId") UUID queryId, QueryRequest statusQuery) { - logger.debug("calling HSAPI Resource queryResult() for query {}", queryId); - throw new UnsupportedOperationException("Query result is not implemented in this resource. Please use query/sync"); - } - - @POST - @Path("/query/sync") - @Override - public Response querySync(QueryRequest resultRequest) { - logger.debug("calling HSAPI Resource querySync()"); - if (targetURL == null || targetURL.isEmpty()){ - throw new ApplicationException(ApplicationException.MISSING_TARGET_URL); - } - - if (resultRequest == null){ - throw new ProtocolException(ProtocolException.MISSING_DATA); - } - - Object queryObject = resultRequest.getQuery(); - if (queryObject == null) { - throw new ProtocolException(ProtocolException.MISSING_DATA); - } - - String path = buildPath(resultRequest); - - HttpResponse response = retrieveGetResponse(path, headers); - if (response.getStatusLine().getStatusCode() != 200) { - logger.error(targetURL + " did not return a 200: {} {}", response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase()); - throwResponseError(response, targetURL); - } - try { - return Response.ok(response.getEntity().getContent()).build(); - } catch (IOException e){ - throw new ResourceInterfaceException("Unable to read the resource response: " + e.getMessage()); - } - } - - private String buildPath (QueryRequest request){ - JsonNode node = json.valueToTree(request.getQuery()); - - if (!node.has("entity")){ - throw new ProtocolException("Entity required"); - } - String path = node.get("entity").asText(); - - //Alert user if their request is ill-formed - if (node.has("id")) { - path += "/" + node.get("id").asText(); - } - - if (node.has("subentity")) { - if (!node.has("id")) { - throw new ProtocolException("Cannot have subentity without an id"); - } - path += "/" + node.get("subentity").asText(); - } - - if (node.has("pathname")){ - if (!node.has("subentity")) { - throw new ProtocolException("Cannot have pathname without subentity"); - } - path += "/" + node.get("pathname").asText(); - } - - if (node.has("page")){ - if (node.has("pathname") || (node.has("id") && !node.has("subentity"))){ - throw new ProtocolException("Page can only be included at the end of entities or subentities"); - } - String query = "/?page=" + node.get("page").asText(); - return composeURL(targetURL, path, query); - } - - return composeURL(targetURL, path); - } - -} diff --git a/pic-sure-resources/pic-sure-hsapi-resource/src/main/java/edu/harvard/hms/dbmi/avillach/JAXRSConfiguration.java b/pic-sure-resources/pic-sure-hsapi-resource/src/main/java/edu/harvard/hms/dbmi/avillach/JAXRSConfiguration.java deleted file mode 100755 index 8a8c4932..00000000 --- a/pic-sure-resources/pic-sure-hsapi-resource/src/main/java/edu/harvard/hms/dbmi/avillach/JAXRSConfiguration.java +++ /dev/null @@ -1,26 +0,0 @@ -package edu.harvard.hms.dbmi.avillach; - -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.annotation.WebListener; -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("pic-sure") -@WebListener -public class JAXRSConfiguration extends Application implements ServletContextListener { - - @Override - public void contextInitialized(ServletContextEvent event) { - ServletContext servletContext = event.getServletContext(); - servletContext.setInitParameter("resteasy.resources", "org.jboss.resteasy.plugins.stats.RegistryStatsResource"); - } - - @Override - public void contextDestroyed(ServletContextEvent event) { - // NOOP. - } - - -} diff --git a/pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/webapp/META-INF/context.xml b/pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/webapp/META-INF/context.xml deleted file mode 100755 index 9f4aa7fd..00000000 --- a/pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/webapp/META-INF/context.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/webapp/WEB-INF/beans.xml b/pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/webapp/WEB-INF/beans.xml deleted file mode 100755 index 9a692dbe..00000000 --- a/pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - \ No newline at end of file diff --git a/pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/wildflyConfiguration/standalone.xml b/pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/wildflyConfiguration/standalone.xml deleted file mode 100644 index 9e2a698e..00000000 --- a/pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/wildflyConfiguration/standalone.xml +++ /dev/null @@ -1,519 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - - - jdbc:h2:mem:picsure;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - - - - org.h2.jdbcx.JdbcDataSource - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${jboss.bind.address:127.0.0.1} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pic-sure-resources/pic-sure-passthrough-resource/pom.xml b/pic-sure-resources/pic-sure-passthrough-resource/pom.xml index ff591ceb..e4eec756 100644 --- a/pic-sure-resources/pic-sure-passthrough-resource/pom.xml +++ b/pic-sure-resources/pic-sure-passthrough-resource/pom.xml @@ -14,10 +14,6 @@ 13.0.0.Final ${project.build.directory}/wildfly-${wildfly.version} UTF-8 - 25.1-jre - 5.6.2 - 3.5.10 - 3.5.10 @@ -54,24 +50,20 @@ com.google.guava guava - ${guava.version} org.junit.jupiter junit-jupiter - ${junit-jupiter.version} test org.mockito mockito-core - ${mockito-core.version} test org.mockito mockito-junit-jupiter - ${mockito-junit-jupiter.version} test diff --git a/pic-sure-resources/pic-sure-resource-api/pom.xml b/pic-sure-resources/pic-sure-resource-api/pom.xml index edcd0e62..cae79567 100755 --- a/pic-sure-resources/pic-sure-resource-api/pom.xml +++ b/pic-sure-resources/pic-sure-resource-api/pom.xml @@ -59,18 +59,16 @@ io.swagger.core.v3 swagger-annotations - 2.2.8 org.junit.vintage junit-vintage-engine - 5.9.3 test edu.harvard.hms.dbmi.avillach pic-sure-api-data - 2.1.0-SNAPSHOT + ${project.version} diff --git a/pic-sure-resources/pic-sure-visualization-resource/pom.xml b/pic-sure-resources/pic-sure-visualization-resource/pom.xml index 500b4386..164e002f 100644 --- a/pic-sure-resources/pic-sure-visualization-resource/pom.xml +++ b/pic-sure-resources/pic-sure-visualization-resource/pom.xml @@ -19,60 +19,49 @@ org.apache.commons commons-math3 - 3.6.1 com.fasterxml.jackson.core jackson-core - 2.13.1 com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider - 2.13.1 org.springframework spring-core - 5.3.15 org.springframework spring-web - 5.3.15 org.junit.jupiter junit-jupiter-api - 5.9.0 test org.mockito mockito-junit-jupiter - 4.6.1 test org.projectlombok lombok - 1.18.22 org.knowm.xchart xchart - 3.8.1 javax javaee-api - 8.0 provided org.slf4j slf4j-api - 1.7.36 com.fasterxml.jackson.core @@ -85,28 +74,24 @@ edu.harvard.hms.dbmi.avillach pic-sure-resource-api - 2.1.0-SNAPSHOT + ${project.version} compile org.jboss.resteasy resteasy-jaxb-provider - 3.0.8.Final org.reactivestreams reactive-streams - 1.0.4 org.glassfish.jersey.core jersey-common - 2.39.1 org.apache.cxf cxf-rt-transports-http - 3.4.1 compile diff --git a/pic-sure-resources/pom.xml b/pic-sure-resources/pom.xml index 2770f877..f6c59db2 100644 --- a/pic-sure-resources/pom.xml +++ b/pic-sure-resources/pom.xml @@ -12,7 +12,6 @@ pic-sure-resource-api pic-sure-ga4gh-dos - pic-sure-hsapi-resource pic-sure-passthrough-resource pic-sure-aggregate-data-sharing-resource pic-sure-visualization-resource @@ -26,7 +25,6 @@ org.slf4j slf4j-jdk14 - 1.7.32 diff --git a/pic-sure-util/pom.xml b/pic-sure-util/pom.xml index 12dc3f87..22470efb 100644 --- a/pic-sure-util/pom.xml +++ b/pic-sure-util/pom.xml @@ -8,11 +8,8 @@ 2.1.0-SNAPSHOT 4.0.0 - pic-sure-util - - com.fasterxml.jackson.core jackson-core @@ -31,14 +28,11 @@ org.slf4j slf4j-api - org.slf4j slf4j-jdk14 - 1.7.32 - org.apache.httpcomponents httpcore @@ -52,5 +46,4 @@ commons-io - diff --git a/pom.xml b/pom.xml index 13692a02..d09e1d9d 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,16 @@ - 2.10.5 + 2.16.0 + 32.1.3-jre + 5.6.2 + 3.5.10 + 3.5.10 + 5.3.31 + 6.4.0.Final + 4.5.13 + 2.15.1 + 1.18.30 2.41.1 @@ -64,8 +73,8 @@ 2.22.0 - --illegal-access=permit - + --illegal-access=permit + @@ -75,7 +84,7 @@ junit junit - 4.13.1 + 4.13.2 test @@ -89,7 +98,7 @@ com.fasterxml.jackson.core jackson-databind - 2.10.5.1 + ${jackson.version} com.fasterxml.jackson.core @@ -171,10 +180,9 @@ org.hibernate hibernate-core - 3.5.6-Final + ${hibernate-core.version} provided - org.apache.httpcomponents httpcore @@ -183,12 +191,12 @@ org.apache.httpcomponents httpclient - 4.5.13 + ${httpclient.version} commons-io commons-io - 2.7 + ${commons-io.version} com.github.tomakehurst @@ -199,18 +207,18 @@ org.glassfish.jersey.core jersey-common - 2.26 + 2.39.1 test org.jboss.resteasy resteasy-jaxb-provider - 3.15.1 + 3.0.8.Final org.mockito mockito-core - 2.23.4 + ${mockito-core.version} test @@ -234,6 +242,104 @@ swagger-annotations 2.2.8 + + org.apache.cxf + cxf-rt-frontend-jaxrs + 3.4.1 + test + + + com.github.tomakehurst + wiremock-jre8 + 2.27.2 + test + + + com.google.guava + guava + ${guava.version} + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.mockito + mockito-junit-jupiter + ${mockito-junit-jupiter.version} + test + + + commons-cli + commons-cli + 1.4 + + + org.slf4j + slf4j-jdk14 + 1.7.32 + + + junit + junit + 4.13.1 + test + + + org.junit.vintage + junit-vintage-engine + 5.9.3 + test + + + org.reactivestreams + reactive-streams + 1.0.4 + + + org.projectlombok + lombok + ${lombok.version} + + + org.knowm.xchart + xchart + 3.8.1 + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + 2.13.1 + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + org.junit.jupiter + junit-jupiter-api + 5.9.0 + test + + + org.apache.commons + commons-math3 + 3.6.1 + + + org.apache.cxf + cxf-rt-transports-http + 3.4.1 + compile +