diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7bc2ba3..0d5c9aa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [v1.2.0-SNAPSHOT] - [2021-06-08]
+
+- Feature #21584 added support for /ServiceEndpoint/{category} REST call
+
## [v1.1.0-SNAPSHOT] - [2016-10-03]
- porting to auth v.2
diff --git a/pom.xml b/pom.xml
index 9b349f5..c03c6c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
4.0.0
org.gcube.information-system
icproxy
- 1.1.1-SNAPSHOT
+ 1.2.0-SNAPSHOT
ICProxy
war
diff --git a/src/main/java/org/gcube/informationsystem/icproxy/resources/ServiceEndpointResource.java b/src/main/java/org/gcube/informationsystem/icproxy/resources/ServiceEndpointResource.java
index eb672e2..fb20b48 100644
--- a/src/main/java/org/gcube/informationsystem/icproxy/resources/ServiceEndpointResource.java
+++ b/src/main/java/org/gcube/informationsystem/icproxy/resources/ServiceEndpointResource.java
@@ -23,6 +23,19 @@ import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
@Slf4j
@Path("ServiceEndpoint")
public class ServiceEndpointResource {
+
+ @GET
+ @Path("/{category}")
+ @Produces(MediaType.APPLICATION_XML)
+ public List retrieve(@NotNull @PathParam("category") String resourceCategory) {
+ log.info("ServiceEndpoint called with category {} in context {}",resourceCategory, ScopeProvider.instance.get());
+
+ DiscoveryClient client = clientFor(ServiceEndpoint.class);
+
+ List endpoints = client.submit(getQuery(resourceCategory));
+ log.debug("retrieved resources are "+endpoints.size());
+ return endpoints;
+ }
@GET
@Path("/{category}/{name}")
@@ -72,4 +85,10 @@ public class ServiceEndpointResource {
return query;
}
+ private SimpleQuery getQuery(String resourceCategory){
+ SimpleQuery query = queryFor(ServiceEndpoint.class);
+ query.addCondition(String.format("$resource/Profile/Category/text() eq '%s'",resourceCategory));
+ return query;
+ }
+
}