Added getContextCache() to be able to get Context as Tree

This commit is contained in:
luca.frosini 2023-10-27 15:05:44 +02:00
parent 164be53064
commit 29b559a71a
4 changed files with 18 additions and 3 deletions

View File

@ -2,6 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for Resource Registry Client
## [v4.5.0-SNAPSHOT]
- Added getContextCache() to be able to get Context as Tree [#24555]
## [v4.4.0]
- Migrated code to reorganized E/R format [#24992]

View File

@ -9,7 +9,7 @@
<groupId>org.gcube.information-system</groupId>
<artifactId>resource-registry-client</artifactId>
<version>4.4.0</version>
<version>4.5.0-SNAPSHOT</version>
<name>Resource Registry Client</name>
<description>Resource Registry Client is a library designed to interact with idempotent Resource Registry APIs</description>

View File

@ -14,6 +14,7 @@ import org.gcube.informationsystem.model.reference.entities.Resource;
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
import org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate;
import org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache;
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
@ -48,6 +49,8 @@ public interface ResourceRegistryClient extends RequestInfo {
public List<Context> getAllContext() throws ResourceRegistryException;
public ContextCache getContextCache();
public boolean existContext(String uuid) throws ContextNotFoundException, ResourceRegistryException;
public boolean existContext(UUID uuid) throws ContextNotFoundException, ResourceRegistryException;

View File

@ -15,13 +15,12 @@ import org.gcube.common.gxhttp.reference.GXConnection;
import org.gcube.common.gxhttp.request.GXHTTPStringRequest;
import org.gcube.common.http.GXHTTPUtility;
import org.gcube.informationsystem.base.reference.Direction;
import org.gcube.informationsystem.base.reference.IdentifiableElement;
import org.gcube.informationsystem.contexts.reference.entities.Context;
import org.gcube.informationsystem.model.knowledge.ModelKnowledge;
import org.gcube.informationsystem.model.reference.ERElement;
import org.gcube.informationsystem.model.reference.entities.Entity;
import org.gcube.informationsystem.model.reference.entities.Facet;
import org.gcube.informationsystem.model.reference.entities.Resource;
import org.gcube.informationsystem.model.reference.properties.Metadata;
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
import org.gcube.informationsystem.model.reference.relations.Relation;
@ -45,6 +44,7 @@ import org.gcube.informationsystem.resourceregistry.api.rest.TypePath;
import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPUtility;
import org.gcube.informationsystem.serialization.ElementMapper;
import org.gcube.informationsystem.types.TypeMapper;
import org.gcube.informationsystem.types.knowledge.TypeInformation;
import org.gcube.informationsystem.types.reference.Type;
import org.gcube.informationsystem.utils.TypeUtility;
import org.slf4j.Logger;
@ -66,6 +66,8 @@ public class ResourceRegistryClientImpl extends BaseRequestInfo implements Resou
protected ContextCache contextCache;
protected ModelKnowledge<Type, TypeInformation> modelKnowledge;
@Deprecated
@Override
public boolean isIncludeContextsInHeader() {
@ -203,6 +205,11 @@ public class ResourceRegistryClientImpl extends BaseRequestInfo implements Resou
return contextCache.getContexts();
}
@Override
public ContextCache getContextCache() {
return contextCache;
}
/**
* It reads the context from server.
* The cache used for contexts is bypassed and not updated.