|
|
|
@ -22,9 +22,9 @@ import org.gcube.informationsystem.exporter.mapper.exception.UpdateException;
|
|
|
|
|
import org.gcube.informationsystem.model.reference.ISConstants;
|
|
|
|
|
import org.gcube.informationsystem.model.reference.entities.Facet;
|
|
|
|
|
import org.gcube.informationsystem.model.reference.entities.Resource;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
|
|
|
|
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.client.ResourceRegistryClient;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientFactory;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.publisher.ResourceRegistryPublisher;
|
|
|
|
@ -130,11 +130,10 @@ public abstract class GCoreResourceMapper<GR extends org.gcube.common.resources.
|
|
|
|
|
boolean update = false;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
resourceRegistryClient.exists(rClass, uuid);
|
|
|
|
|
update = true;
|
|
|
|
|
} catch (ResourceNotFoundException e) {
|
|
|
|
|
update = resourceRegistryClient.exists(rClass, uuid);
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
update = false;
|
|
|
|
|
} catch (ResourceAvailableInAnotherContextException e) {
|
|
|
|
|
} catch (AvailableInAnotherContextException e) {
|
|
|
|
|
// This code should never be reached because this should be fixed in
|
|
|
|
|
// map function
|
|
|
|
|
resourceRegistryPublisher.addResourceToCurrentContext(r);
|
|
|
|
|