Fixing exporter

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/is-exporter-se-plugin@177009 82a268e6-3cf1-43bd-a215-b396298e98cf
model-reorganization
Luca Frosini 5 years ago
parent c5356e53ef
commit 5e00714c1b

@ -48,8 +48,10 @@ public class ISExporterPlugin extends Plugin<ISExporterPluginDeclaration> {
logger.debug("Failure Report are filtered (e.g. Failing UUID are not shown to avoid to produce to much uneeded reports)");
/*
GenericResourceExporter genericResourceExporter = new GenericResourceExporter(filteredReport);
genericResourceExporter.export();
*/
ServiceEndpointExporter serviceEndpointExporter = new ServiceEndpointExporter(filteredReport);
serviceEndpointExporter.export();

@ -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);

@ -13,8 +13,8 @@ import org.gcube.informationsystem.model.reference.entities.Resource;
import org.gcube.informationsystem.model.reference.properties.Header;
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
import org.gcube.informationsystem.model.reference.relations.IsIdentifiedBy;
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.AvailableInAnotherContextException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
import org.gcube.resourcemanagement.model.impl.entities.facets.SimpleFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.resources.ConfigurationImpl;
@ -44,11 +44,10 @@ public class GenericResourceExporter extends GCoreResourceMapper<GenericResource
SimpleFacet simpleFacet = null;
try {
resourceRegistryClient.exists(rClass, uuid);
readFromIS = true;
}catch (ResourceNotFoundException e) {
readFromIS = resourceRegistryClient.exists(rClass, uuid);
}catch (NotFoundException e) {
readFromIS = false;
} catch (ResourceAvailableInAnotherContextException e) {
} catch (AvailableInAnotherContextException e) {
resourceRegistryPublisher.addResourceToCurrentContext(Configuration.NAME, uuid);
Thread.sleep(100);
readFromIS = true;

@ -21,8 +21,8 @@ import org.gcube.informationsystem.model.reference.properties.Encrypted;
import org.gcube.informationsystem.model.reference.properties.Header;
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
import org.gcube.informationsystem.model.reference.relations.IsIdentifiedBy;
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.AvailableInAnotherContextException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
import org.gcube.informationsystem.utils.ISMapper;
import org.gcube.resourcemanagement.model.impl.entities.facets.AccessPointFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.facets.NetworkingFacetImpl;
@ -80,11 +80,10 @@ public class ServiceEndpointExporter extends GCoreResourceMapper<ServiceEndpoint
NetworkingFacet networkingFacet = null;
try {
resourceRegistryClient.exists(rClass, uuid);
readFromIS = true;
}catch (ResourceNotFoundException e) {
readFromIS = resourceRegistryClient.exists(rClass, uuid);
}catch (NotFoundException e) {
readFromIS = false;
}catch (ResourceAvailableInAnotherContextException e) {
}catch (AvailableInAnotherContextException e) {
resourceRegistryPublisher.addResourceToCurrentContext(EService.NAME, uuid);
Thread.sleep(100);
readFromIS = true;

@ -16,6 +16,7 @@ public class ISExporterPluginTest {
@Test
public void testLaunch() throws ObjectNotFound, Exception{
/*
String[] tokens = {
ScopedTest.GCUBE,
ScopedTest.GCUBE_DEVSEC,
@ -23,6 +24,11 @@ public class ISExporterPluginTest {
ScopedTest.GCUBE_DEVNEXT,
ScopedTest.GCUBE_DEVNEXT_NEXTNEXT
};
*/
String[] tokens = {
ScopedTest.GCUBE_DEVSEC
};
for(String token : tokens){
logger.info("\n\n\n-------------------------------------------------------------------------");

Loading…
Cancel
Save