Exposed get all context through access port type
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@160191 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ba83014726
commit
2421c33ec6
|
@ -29,6 +29,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.er.ERNotFound
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.query.InvalidQueryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.query.InvalidQueryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
|
import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
|
||||||
|
import org.gcube.informationsystem.resourceregistry.api.rest.ContextPath;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPCall.HTTPMETHOD;
|
import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPCall.HTTPMETHOD;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.ContextManagement;
|
import org.gcube.informationsystem.resourceregistry.context.ContextManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.ERManagement;
|
import org.gcube.informationsystem.resourceregistry.er.ERManagement;
|
||||||
|
@ -273,10 +274,15 @@ public class Access {
|
||||||
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
|
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
|
||||||
public String getContext(@PathParam(ID_PATH_PARAM) String uuid)
|
public String getContext(@PathParam(ID_PATH_PARAM) String uuid)
|
||||||
throws ContextNotFoundException, ResourceRegistryException {
|
throws ContextNotFoundException, ResourceRegistryException {
|
||||||
logger.info("Requested to read {} with id {} ", org.gcube.informationsystem.model.entity.Context.NAME, uuid);
|
|
||||||
ContextManagement contextManagement = new ContextManagement();
|
ContextManagement contextManagement = new ContextManagement();
|
||||||
|
if(uuid.compareTo(ContextPath.ALL_PATH_PART)==0) {
|
||||||
|
logger.info("Requested to read all {}s", org.gcube.informationsystem.model.entity.Context.NAME);
|
||||||
|
return contextManagement.all(false);
|
||||||
|
}else {
|
||||||
|
logger.info("Requested to read {} with id {} ", org.gcube.informationsystem.model.entity.Context.NAME, uuid);
|
||||||
contextManagement.setUUID(UUID.fromString(uuid));
|
contextManagement.setUUID(UUID.fromString(uuid));
|
||||||
return contextManagement.read();
|
return contextManagement.read();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -67,6 +67,7 @@ public class ContextManager {
|
||||||
throws ContextNotFoundException, ResourceRegistryException {
|
throws ContextNotFoundException, ResourceRegistryException {
|
||||||
ContextManagement contextManagement = new ContextManagement();
|
ContextManagement contextManagement = new ContextManagement();
|
||||||
if(uuid.compareTo(ContextPath.ALL_PATH_PART)==0) {
|
if(uuid.compareTo(ContextPath.ALL_PATH_PART)==0) {
|
||||||
|
logger.info("Requested to read all {}s", Context.NAME);
|
||||||
return contextManagement.all(false);
|
return contextManagement.all(false);
|
||||||
}else {
|
}else {
|
||||||
logger.info("Requested to read {} with id {} ", Context.NAME, uuid);
|
logger.info("Requested to read {} with id {} ", Context.NAME, uuid);
|
||||||
|
|
Loading…
Reference in New Issue