Aligning overrided APIs refs #21979
This commit is contained in:
parent
352709f9dc
commit
c76c983b7c
|
@ -16,9 +16,17 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExcep
|
|||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAvailableInAnotherContextException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAlreadyPresentException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAvailableInAnotherContextException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfAlreadyPresentException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfAvailableInAnotherContextException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.isrelatedto.IsRelatedToAlreadyPresentException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.isrelatedto.IsRelatedToAvailableInAnotherContextException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.isrelatedto.IsRelatedToNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaViolationException;
|
||||
|
||||
/**
|
||||
|
@ -26,52 +34,61 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.Schema
|
|||
*/
|
||||
public interface ResourceRegistryPublisher {
|
||||
|
||||
public <ERElem extends ERElement, R extends Resource> List<R> list(Class<ERElem> clazz, Boolean polymorphic)
|
||||
public <ERElem extends ERElement> List<ERElem> list(Class<ERElem> clazz, Boolean polymorphic)
|
||||
throws ResourceRegistryException;
|
||||
|
||||
public String list(String type, Boolean polymorphic)
|
||||
throws ResourceRegistryException;
|
||||
|
||||
public String list(String type, Boolean polymorphic) throws ResourceRegistryException;
|
||||
|
||||
public <ERElem extends ERElement> ERElem create(ERElem er)
|
||||
throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException;
|
||||
|
||||
public String create(String json)
|
||||
throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException;
|
||||
|
||||
public <ERElem extends ERElement> boolean exists(Class<ERElem> clazz, UUID uuid)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
|
||||
|
||||
public <ERElem extends ERElement> boolean exists(ERElem er)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public <ERElem extends ERElement> boolean exists(Class<ERElem> clazz, UUID uuid)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public boolean exists(String type, UUID uuid)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
|
||||
public <ERElem extends ERElement> ERElem read(ERElem er)
|
||||
throws NotFoundException, ResourceRegistryException;
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public <ERElem extends ERElement> ERElem read(Class<ERElem> clazz, UUID uuid)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public String read(String type, UUID uuid) throws NotFoundException, ResourceRegistryException;
|
||||
|
||||
public String read(String type, UUID uuid)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
|
||||
public <ERElem extends ERElement> ERElem update(ERElem er)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
|
||||
public String update(String json) throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
public String update(String json)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
|
||||
public String update(String type, String json)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
|
||||
public String update(String type, String json, UUID uuid)
|
||||
throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException;
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
|
||||
|
||||
|
||||
public <ERElem extends ERElement> boolean delete(ERElem er)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
|
||||
public boolean delete(String type, UUID uuid)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
|
||||
|
||||
/* ----- */
|
||||
|
||||
public <F extends Facet> F createFacet(F facet)
|
||||
|
@ -80,9 +97,11 @@ public interface ResourceRegistryPublisher {
|
|||
public String createFacet(String facet)
|
||||
throws SchemaViolationException, FacetAlreadyPresentException, ResourceRegistryException;
|
||||
|
||||
public <F extends Facet> F readFacet(F facet) throws FacetNotFoundException, ResourceRegistryException;
|
||||
public <F extends Facet> F readFacet(F facet)
|
||||
throws FacetNotFoundException, FacetAvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public String readFacet(String facetType, UUID uuid) throws FacetNotFoundException, ResourceRegistryException;
|
||||
public String readFacet(String facetType, UUID uuid)
|
||||
throws FacetNotFoundException, FacetAvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public <F extends Facet> F updateFacet(F facet)
|
||||
throws SchemaViolationException, FacetNotFoundException, ResourceRegistryException;
|
||||
|
@ -104,10 +123,11 @@ public interface ResourceRegistryPublisher {
|
|||
public String createResource(String resource)
|
||||
throws SchemaViolationException, ResourceAlreadyPresentException, ResourceRegistryException;
|
||||
|
||||
public <R extends Resource> R readResource(R resource) throws ResourceNotFoundException, ResourceRegistryException;
|
||||
public <R extends Resource> R readResource(R resource)
|
||||
throws ResourceNotFoundException, ResourceAvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public String readResource(String resourceType, UUID uuid)
|
||||
throws ResourceNotFoundException, ResourceRegistryException;
|
||||
throws ResourceNotFoundException, ResourceAvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public <R extends Resource> R updateResource(R resource)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ResourceRegistryException;
|
||||
|
@ -124,157 +144,150 @@ public interface ResourceRegistryPublisher {
|
|||
/* ----- */
|
||||
|
||||
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> C createConsistsOf(C consistsOf)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, ConsistsOfAlreadyPresentException, ResourceNotFoundException, ResourceRegistryException;
|
||||
|
||||
public String createConsistsOf(String consistsOf)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, ConsistsOfAlreadyPresentException, ResourceNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> C readConsistsOf(C consistsOf)
|
||||
throws NotFoundException, ResourceRegistryException;
|
||||
throws ConsistsOfNotFoundException, ConsistsOfAvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public String readConsistsOf(String consistsOfType, UUID uuid) throws NotFoundException, ResourceRegistryException;
|
||||
public String readConsistsOf(String consistsOfType, UUID uuid)
|
||||
throws ConsistsOfNotFoundException, ConsistsOfAvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> C updateConsistsOf(C consistsOf)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, ConsistsOfNotFoundException, ResourceRegistryException;
|
||||
|
||||
public String updateConsistsOf(String consistsOf)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, ConsistsOfNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> boolean deleteConsistsOf(C consistsOf)
|
||||
throws SchemaViolationException, ResourceRegistryException;
|
||||
throws SchemaViolationException, ConsistsOfNotFoundException, ResourceRegistryException;
|
||||
|
||||
public boolean deleteConsistsOf(String consistsOfType, UUID uuid)
|
||||
throws SchemaViolationException, ResourceRegistryException;
|
||||
throws SchemaViolationException, ConsistsOfNotFoundException, ResourceRegistryException;
|
||||
|
||||
/* ----- */
|
||||
|
||||
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> I createIsRelatedTo(I isRelatedTo)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, IsRelatedToAlreadyPresentException, ResourceNotFoundException, ResourceRegistryException;
|
||||
|
||||
public String createIsRelatedTo(String isRelatedTo)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, IsRelatedToAlreadyPresentException, ResourceNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> I readIsRelatedTo(I isRelatedTo)
|
||||
throws NotFoundException, ResourceRegistryException;
|
||||
throws IsRelatedToNotFoundException, IsRelatedToAvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public String readIsRelatedTo(String isRelatedToType, UUID uuid)
|
||||
throws NotFoundException, ResourceRegistryException;
|
||||
throws IsRelatedToNotFoundException, IsRelatedToAvailableInAnotherContextException, ResourceRegistryException;
|
||||
|
||||
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> I updateIsRelatedTo(I isRelatedTo)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, IsRelatedToNotFoundException, ResourceRegistryException;
|
||||
|
||||
public String updateIsRelatedTo(String isRelatedTo)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, IsRelatedToNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <I extends IsRelatedTo<? extends Resource, ? extends Resource>> boolean deleteIsRelatedTo(I isRelatedTo)
|
||||
throws SchemaViolationException, ResourceRegistryException;
|
||||
throws IsRelatedToNotFoundException, ResourceRegistryException;
|
||||
|
||||
public boolean deleteIsRelatedTo(String isRelatedToType, UUID uuid)
|
||||
throws SchemaViolationException, ResourceRegistryException;
|
||||
throws IsRelatedToNotFoundException, ResourceRegistryException;
|
||||
|
||||
/* ----- */
|
||||
|
||||
public List<ERElement> addToContext(String type, UUID instanceUUID, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> addToContext(ERElement er, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> addToCurrentContext(String type, UUID instanceUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> addToCurrentContext(ERElement er, Boolean dryRun)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> removeFromContext(String type, UUID instanceUUID, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> removeFromContext(ERElement er, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException,
|
||||
ResourceRegistryException;
|
||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> removeFromCurrentContext(String type, UUID instanceUUID, Boolean dryRun) throws SchemaViolationException,
|
||||
ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
public List<ERElement> removeFromCurrentContext(String type, UUID instanceUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> removeFromCurrentContext(ERElement er, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException,
|
||||
ResourceRegistryException;
|
||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public Set<UUID> getElementContexts(String type, UUID instanceUUID)
|
||||
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws NotFoundException, ResourceRegistryException;
|
||||
|
||||
public <ERElem extends ERElement> Set<UUID> getElementContexts(ERElem er)
|
||||
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws NotFoundException, ResourceRegistryException;
|
||||
|
||||
/* ----- */
|
||||
|
||||
public List<ERElement> addResourceToContext(String resourceType, UUID resourceUUID, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException,
|
||||
ResourceRegistryException;
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <R extends Resource> List<ERElement> addResourceToContext(R resource, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException,
|
||||
ResourceRegistryException;
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> addResourceToCurrentContext(String resourceType, UUID resourceUUID, Boolean dryRun) throws SchemaViolationException,
|
||||
ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
public List<ERElement> addResourceToCurrentContext(String resourceType, UUID resourceUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <R extends Resource> List<ERElement> addResourceToCurrentContext(R resource, Boolean dryRun) throws SchemaViolationException,
|
||||
ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
public <R extends Resource> List<ERElement> addResourceToCurrentContext(R resource, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> removeResourceFromContext(String resourceType, UUID resourceUUID, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException,
|
||||
ResourceRegistryException;
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <R extends Resource> List<ERElement> removeResourceFromContext(R resource, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException,
|
||||
ResourceRegistryException;
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> removeResourceFromCurrentContext(String resourceType, UUID resourceUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException,
|
||||
ResourceRegistryException;
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <R extends Resource> List<ERElement> removeResourceFromCurrentContext(R resource, Boolean dryRun) throws SchemaViolationException,
|
||||
ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
public <R extends Resource> List<ERElement> removeResourceFromCurrentContext(R resource, Boolean dryRun)
|
||||
throws SchemaViolationException, ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public Set<UUID> getResourceContexts(String resourceType, UUID resourceUUID)
|
||||
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws ResourceNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <R extends Resource> Set<UUID> getResourceContexts(R resource)
|
||||
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws ResourceNotFoundException, ResourceRegistryException;
|
||||
|
||||
/* ----- */
|
||||
|
||||
public List<ERElement> addFacetToContext(String facetType, UUID facetUUID, UUID contextUUID, Boolean dryRun)
|
||||
throws FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <F extends Facet> List<ERElement> addFacetToContext(F facet, UUID contextUUID, Boolean dryRun)
|
||||
throws FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> addFacetToCurrentContext(String facetType, UUID facetUUID, Boolean dryRun)
|
||||
throws FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <F extends Facet> List<ERElement> addFacetToCurrentContext(F facet, Boolean dryRun)
|
||||
throws FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> removeFacetFromContext(String facetType, UUID facetUUID, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException,
|
||||
ResourceRegistryException;
|
||||
throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <F extends Facet> List<ERElement> removeFacetFromContext(F facet, UUID contextUUID, Boolean dryRun) throws SchemaViolationException,
|
||||
FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
public <F extends Facet> List<ERElement> removeFacetFromContext(F facet, UUID contextUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public List<ERElement> removeFacetFromCurrentContext(String facetType, UUID facetUUID, Boolean dryRun) throws SchemaViolationException,
|
||||
FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
public List<ERElement> removeFacetFromCurrentContext(String facetType, UUID facetUUID, Boolean dryRun)
|
||||
throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <F extends Facet> List<ERElement> removeFacetFromCurrentContext(F facet, Boolean dryRun) throws SchemaViolationException,
|
||||
FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
public <F extends Facet> List<ERElement> removeFacetFromCurrentContext(F facet, Boolean dryRun)
|
||||
throws SchemaViolationException, FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
|
||||
public Set<UUID> getFacetContexts(String facetType, UUID facetUUID)
|
||||
throws FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws FacetNotFoundException, ResourceRegistryException;
|
||||
|
||||
public <F extends Facet> Set<UUID> getFacetContexts(F facet)
|
||||
throws FacetNotFoundException, ContextNotFoundException, ResourceRegistryException;
|
||||
throws FacetNotFoundException, ResourceRegistryException;
|
||||
|
||||
/* ----- */
|
||||
|
||||
|
|
|
@ -27,9 +27,11 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExcep
|
|||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAvailableInAnotherContextException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAlreadyPresentException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfAlreadyPresentException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaViolationException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
|
||||
import org.gcube.informationsystem.resourceregistry.api.rest.InstancePath;
|
||||
|
@ -210,12 +212,12 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <ERElem extends ERElement, R extends Resource> List<R> list(Class<ERElem> clazz, Boolean polymorphic)
|
||||
public <ERElem extends ERElement> List<ERElem> list(Class<ERElem> clazz, Boolean polymorphic)
|
||||
throws ResourceRegistryException {
|
||||
String type = org.gcube.informationsystem.resourceregistry.api.utils.Utility.getTypeName(clazz);
|
||||
String ret = list(type, polymorphic);
|
||||
try {
|
||||
return (List<R>) ElementMapper.unmarshalList(Resource.class, ret);
|
||||
return (List<ERElem>) ElementMapper.unmarshalList(ERElement.class, ret);
|
||||
} catch(Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -249,8 +251,6 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected String create(String type, String json, UUID uuid)
|
||||
throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException {
|
||||
|
@ -279,7 +279,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
}
|
||||
}
|
||||
|
||||
public <ERElem extends ERElement> String internalCreate(ERElem er)
|
||||
protected <ERElem extends ERElement> String internalCreate(ERElem er)
|
||||
throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException {
|
||||
try {
|
||||
String type = org.gcube.informationsystem.resourceregistry.api.utils.Utility
|
||||
|
@ -332,13 +332,6 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <ERElem extends ERElement> boolean exists(Class<ERElem> clazz, UUID uuid)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException {
|
||||
String type = org.gcube.informationsystem.resourceregistry.api.utils.Utility.getTypeName(clazz);
|
||||
return exists(type, uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <ERElem extends ERElement> boolean exists(ERElem er)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException {
|
||||
|
@ -346,6 +339,13 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
UUID uuid = er.getHeader().getUUID();
|
||||
return exists(type, uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <ERElem extends ERElement> boolean exists(Class<ERElem> clazz, UUID uuid)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException {
|
||||
String type = org.gcube.informationsystem.resourceregistry.api.utils.Utility.getTypeName(clazz);
|
||||
return exists(type, uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean exists(String type, UUID uuid)
|
||||
|
@ -381,7 +381,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <ERElem extends ERElement> ERElem read(ERElem er)
|
||||
throws NotFoundException, ResourceRegistryException {
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException {
|
||||
try {
|
||||
String type = org.gcube.informationsystem.resourceregistry.api.utils.Utility
|
||||
.getTypeName(er);
|
||||
|
@ -409,11 +409,10 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String read(String type, UUID uuid) throws NotFoundException, ResourceRegistryException {
|
||||
public String read(String type, UUID uuid)
|
||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException {
|
||||
try {
|
||||
logger.trace("Going to read {} with UUID {}", type, uuid);
|
||||
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPStringRequest.newRequest(address);
|
||||
|
@ -440,6 +439,57 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <ERElem extends ERElement> ERElem update(ERElem er)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||
try {
|
||||
String type = org.gcube.informationsystem.resourceregistry.api.utils.Utility
|
||||
.getTypeName(er);
|
||||
String json = ElementMapper.marshal(er);
|
||||
UUID uuid = er.getHeader().getUUID();
|
||||
String ret = update(type, json, uuid);
|
||||
return (ERElem) ElementMapper.unmarshal(ERElement.class, ret);
|
||||
} catch (ResourceRegistryException e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String update(String json)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||
try {
|
||||
String type = org.gcube.informationsystem.resourceregistry.api.utils.Utility.getClassFromJsonString(json);
|
||||
return update(type, json);
|
||||
} catch (ResourceRegistryException e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String update(String type, String json)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||
try {
|
||||
UUID uuid = Utility.getUUIDFromJSONString(json);
|
||||
return update(type, json, uuid);
|
||||
} catch (ResourceRegistryException e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String update(String type, String json, UUID uuid)
|
||||
throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException {
|
||||
|
@ -468,55 +518,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <ERElem extends ERElement> ERElem update(ERElem er)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||
try {
|
||||
String type = org.gcube.informationsystem.resourceregistry.api.utils.Utility
|
||||
.getTypeName(er);
|
||||
String json = ElementMapper.marshal(er);
|
||||
UUID uuid = er.getHeader().getUUID();
|
||||
String ret = update(type, json, uuid);
|
||||
return (ERElem) ElementMapper.unmarshal(ERElement.class, ret);
|
||||
} catch (ResourceRegistryException e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String update(String type, String json)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||
try {
|
||||
UUID uuid = Utility.getUUIDFromJSONString(json);
|
||||
return update(type, json, uuid);
|
||||
} catch (ResourceRegistryException e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String update(String json) throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||
try {
|
||||
String type = org.gcube.informationsystem.resourceregistry.api.utils.Utility.getClassFromJsonString(json);
|
||||
return update(type, json);
|
||||
} catch (ResourceRegistryException e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// logger.trace("Error Creating {}", facet, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <ERElem extends ERElement> boolean delete(ERElem er)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||
|
@ -563,6 +565,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <F extends Facet> F createFacet(F facet)
|
||||
throws SchemaViolationException, FacetAlreadyPresentException, ResourceRegistryException {
|
||||
|
@ -576,12 +579,14 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
}
|
||||
|
||||
@Override
|
||||
public <F extends Facet> F readFacet(F facet) throws FacetNotFoundException, ResourceRegistryException {
|
||||
public <F extends Facet> F readFacet(F facet)
|
||||
throws FacetNotFoundException, FacetAvailableInAnotherContextException, ResourceRegistryException {
|
||||
return read(facet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String readFacet(String facetType, UUID uuid) throws FacetNotFoundException, ResourceRegistryException {
|
||||
public String readFacet(String facetType, UUID uuid)
|
||||
throws FacetNotFoundException, FacetAvailableInAnotherContextException, ResourceRegistryException {
|
||||
return read(facetType, uuid);
|
||||
}
|
||||
|
||||
|
@ -658,13 +663,13 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
|||
|
||||
@Override
|
||||
public <C extends ConsistsOf<? extends Resource, ? extends Facet>> C createConsistsOf(C consistsOf)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||
throws SchemaViolationException, ConsistsOfAlreadyPresentException, ResourceRegistryException {
|
||||
return create(consistsOf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createConsistsOf(String consistsOf)
|
||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||
throws SchemaViolationException, ConsistsOfAlreadyPresentException, ResourceRegistryException {
|
||||
return create(consistsOf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue