Merged changes made in branch caused by is-model and gcube-model repackaging
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@171802 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
abbe452462
commit
0195a58bd6
4
pom.xml
4
pom.xml
|
@ -107,8 +107,8 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Test Dependencies -->
|
<!-- Test Dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.information-system</groupId>
|
<groupId>org.gcube.resource-management</groupId>
|
||||||
<artifactId>gcube-resources</artifactId>
|
<artifactId>gcube-model</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -6,11 +6,11 @@ import java.util.UUID;
|
||||||
import org.codehaus.jettison.json.JSONArray;
|
import org.codehaus.jettison.json.JSONArray;
|
||||||
import org.codehaus.jettison.json.JSONException;
|
import org.codehaus.jettison.json.JSONException;
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.reference.embedded.Header;
|
||||||
import org.gcube.informationsystem.model.entity.Context;
|
import org.gcube.informationsystem.model.reference.entity.Context;
|
||||||
import org.gcube.informationsystem.model.relation.IsParentOf;
|
import org.gcube.informationsystem.model.reference.relation.IsParentOf;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
|
@ -126,7 +126,7 @@ public class ContextManagement extends EntityManagement<Context> {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// TODO Rewrite using Gremlin
|
// TODO Rewrite using Gremlin
|
||||||
String select = "SELECT FROM " + org.gcube.informationsystem.model.entity.Context.NAME + " WHERE "
|
String select = "SELECT FROM " + org.gcube.informationsystem.model.reference.entity.Context.NAME + " WHERE "
|
||||||
+ Context.NAME_PROPERTY + " = \"" + getName() + "\"" + " AND in(\"" + IsParentOf.NAME
|
+ Context.NAME_PROPERTY + " = \"" + getName() + "\"" + " AND in(\"" + IsParentOf.NAME
|
||||||
+ "\").size() = 0";
|
+ "\").size() = 0";
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ public class ContextManagement extends EntityManagement<Context> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parentContextJsonNode != null && !(parentContextJsonNode instanceof NullNode)) {
|
if(parentContextJsonNode != null && !(parentContextJsonNode instanceof NullNode)) {
|
||||||
UUID parentUUID = org.gcube.informationsystem.impl.utils.Utility.getUUIDFromJsonNode(parentContextJsonNode);
|
UUID parentUUID = org.gcube.informationsystem.model.impl.utils.Utility.getUUIDFromJsonNode(parentContextJsonNode);
|
||||||
if(actualParentContextManagement != null) {
|
if(actualParentContextManagement != null) {
|
||||||
if(parentUUID.compareTo(actualParentContextManagement.uuid) != 0) {
|
if(parentUUID.compareTo(actualParentContextManagement.uuid) != 0) {
|
||||||
parentChanged = true;
|
parentChanged = true;
|
||||||
|
|
|
@ -11,8 +11,8 @@ import org.gcube.common.authorization.library.AuthorizationEntry;
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
import org.gcube.informationsystem.model.entity.Context;
|
import org.gcube.informationsystem.model.reference.entity.Context;
|
||||||
import org.gcube.informationsystem.model.relation.IsParentOf;
|
import org.gcube.informationsystem.model.reference.relation.IsParentOf;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
||||||
|
|
|
@ -3,13 +3,13 @@ package org.gcube.informationsystem.resourceregistry.context;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
import org.gcube.informationsystem.impl.embedded.PropagationConstraintImpl;
|
import org.gcube.informationsystem.model.impl.embedded.PropagationConstraintImpl;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.AddConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.AddConstraint;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.RemoveConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.RemoveConstraint;
|
||||||
import org.gcube.informationsystem.model.relation.IsParentOf;
|
import org.gcube.informationsystem.model.reference.relation.IsParentOf;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
|
||||||
|
|
|
@ -13,7 +13,7 @@ import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.entity.Context;
|
import org.gcube.informationsystem.model.reference.entity.Context;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
||||||
|
|
|
@ -6,9 +6,9 @@ import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.utils.discovery.ISMDiscovery;
|
import org.gcube.informationsystem.model.impl.utils.discovery.ISMDiscovery;
|
||||||
import org.gcube.informationsystem.impl.utils.discovery.SchemaAction;
|
import org.gcube.informationsystem.model.impl.utils.discovery.SchemaAction;
|
||||||
import org.gcube.informationsystem.model.ISConstants;
|
import org.gcube.informationsystem.model.reference.ISConstants;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.security.AdminSecurityContext;
|
import org.gcube.informationsystem.resourceregistry.context.security.AdminSecurityContext;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.security.ContextSecurityContext;
|
import org.gcube.informationsystem.resourceregistry.context.security.ContextSecurityContext;
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.dbinitialization;
|
package org.gcube.informationsystem.resourceregistry.dbinitialization;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.utils.discovery.SchemaAction;
|
import org.gcube.informationsystem.model.impl.utils.discovery.SchemaAction;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
import org.gcube.informationsystem.model.reference.embedded.Embedded;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.reference.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
import org.gcube.informationsystem.model.reference.relation.IsRelatedTo;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaAlreadyPresentException;
|
||||||
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement;
|
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
|
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
|
||||||
import org.gcube.informationsystem.types.TypeBinder;
|
import org.gcube.informationsystem.types.TypeBinder;
|
||||||
|
@ -42,6 +43,8 @@ public class SchemaActionImpl implements SchemaAction {
|
||||||
} else {
|
} else {
|
||||||
schemaManagement.create(json, AccessType.RELATION);
|
schemaManagement.create(json, AccessType.RELATION);
|
||||||
}
|
}
|
||||||
|
} catch (SchemaAlreadyPresentException sape) {
|
||||||
|
logger.warn("{} already exists. It will be ignored", TypeBinder.getType(r));
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
logger.error("Error creating schema for {} type {} : {}", Relation.NAME, r.getSimpleName(),
|
logger.error("Error creating schema for {} type {} : {}", Relation.NAME, r.getSimpleName(),
|
||||||
ex.getMessage());
|
ex.getMessage());
|
||||||
|
@ -62,6 +65,8 @@ public class SchemaActionImpl implements SchemaAction {
|
||||||
} else {
|
} else {
|
||||||
schemaManagement.create(json, AccessType.ENTITY);
|
schemaManagement.create(json, AccessType.ENTITY);
|
||||||
}
|
}
|
||||||
|
} catch (SchemaAlreadyPresentException sape) {
|
||||||
|
logger.warn("{} already exists. It will be ignored", TypeBinder.getType(e));
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
logger.error("Error creating schema for {} type {} : {}", Entity.NAME, e.getSimpleName(), ex.getMessage());
|
logger.error("Error creating schema for {} type {} : {}", Entity.NAME, e.getSimpleName(), ex.getMessage());
|
||||||
throw ex;
|
throw ex;
|
||||||
|
@ -75,7 +80,9 @@ public class SchemaActionImpl implements SchemaAction {
|
||||||
String json = TypeBinder.serializeType(e);
|
String json = TypeBinder.serializeType(e);
|
||||||
logger.trace(json);
|
logger.trace(json);
|
||||||
schemaManagement.create(json, AccessType.EMBEDDED);
|
schemaManagement.create(json, AccessType.EMBEDDED);
|
||||||
} catch(Exception ex) {
|
} catch (SchemaAlreadyPresentException sape) {
|
||||||
|
logger.warn("{} already exists. It will be ignored", TypeBinder.getType(e));
|
||||||
|
} catch(Exception ex) {
|
||||||
logger.error("Error creating schema for {} type {} : {}", Embedded.NAME, e.getSimpleName(),
|
logger.error("Error creating schema for {} type {} : {}", Embedded.NAME, e.getSimpleName(),
|
||||||
ex.getMessage());
|
ex.getMessage());
|
||||||
throw ex;
|
throw ex;
|
||||||
|
|
|
@ -16,11 +16,11 @@ import javax.activation.UnsupportedDataTypeException;
|
||||||
|
|
||||||
import org.codehaus.jettison.json.JSONArray;
|
import org.codehaus.jettison.json.JSONArray;
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.ER;
|
import org.gcube.informationsystem.model.reference.ER;
|
||||||
import org.gcube.informationsystem.model.ISManageable;
|
import org.gcube.informationsystem.model.reference.ISManageable;
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.reference.embedded.Header;
|
||||||
import org.gcube.informationsystem.model.entity.Context;
|
import org.gcube.informationsystem.model.reference.entity.Context;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
|
@ -189,7 +189,7 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
|
||||||
protected void checkJSON() throws ResourceRegistryException {
|
protected void checkJSON() throws ResourceRegistryException {
|
||||||
if(uuid == null) {
|
if(uuid == null) {
|
||||||
try {
|
try {
|
||||||
uuid = org.gcube.informationsystem.impl.utils.Utility.getUUIDFromJsonNode(jsonNode);
|
uuid = org.gcube.informationsystem.model.impl.utils.Utility.getUUIDFromJsonNode(jsonNode);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2,14 +2,14 @@ package org.gcube.informationsystem.resourceregistry.er;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
import org.gcube.informationsystem.model.reference.embedded.Embedded;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.reference.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
import org.gcube.informationsystem.model.reference.relation.IsRelatedTo;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.security.SecurityContext;
|
import org.gcube.informationsystem.resourceregistry.context.security.SecurityContext;
|
||||||
|
|
|
@ -3,9 +3,9 @@ package org.gcube.informationsystem.resourceregistry.er;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.ISManageable;
|
import org.gcube.informationsystem.model.reference.ISManageable;
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.reference.embedded.Header;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
|
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
|
||||||
|
|
|
@ -8,13 +8,13 @@ import java.util.UUID;
|
||||||
|
|
||||||
import org.codehaus.jettison.json.JSONArray;
|
import org.codehaus.jettison.json.JSONArray;
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.reference.embedded.Header;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.reference.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.er.entity;
|
package org.gcube.informationsystem.resourceregistry.er.entity;
|
||||||
|
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
|
||||||
|
|
|
@ -3,10 +3,10 @@ package org.gcube.informationsystem.resourceregistry.er.entity;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
import org.gcube.informationsystem.model.reference.relation.IsRelatedTo;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAlreadyPresentException;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.er.relation;
|
package org.gcube.informationsystem.resourceregistry.er.relation;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.embedded.PropagationConstraintImpl;
|
import org.gcube.informationsystem.model.impl.embedded.PropagationConstraintImpl;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.AddConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.AddConstraint;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.RemoveConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.RemoveConstraint;
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfAlreadyPresentException;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.er.relation;
|
package org.gcube.informationsystem.resourceregistry.er.relation;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.embedded.PropagationConstraintImpl;
|
import org.gcube.informationsystem.model.impl.embedded.PropagationConstraintImpl;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.AddConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.AddConstraint;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.RemoveConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.RemoveConstraint;
|
||||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
import org.gcube.informationsystem.model.reference.relation.IsRelatedTo;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.isrelatedto.IsRelatedToAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.isrelatedto.IsRelatedToAlreadyPresentException;
|
||||||
|
|
|
@ -8,15 +8,15 @@ import java.util.UUID;
|
||||||
|
|
||||||
import org.codehaus.jettison.json.JSONArray;
|
import org.codehaus.jettison.json.JSONArray;
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.AddConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.AddConstraint;
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.RemoveConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.RemoveConstraint;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.reference.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
|
||||||
|
@ -265,7 +265,7 @@ public abstract class RelationManagement<R extends Relation, S extends EntityMan
|
||||||
throw new ResourceRegistryException("Error while creating relation. No source definition found");
|
throw new ResourceRegistryException("Error while creating relation. No source definition found");
|
||||||
}
|
}
|
||||||
|
|
||||||
UUID sourceUUID = org.gcube.informationsystem.impl.utils.Utility
|
UUID sourceUUID = org.gcube.informationsystem.model.impl.utils.Utility
|
||||||
.getUUIDFromJsonNode(jsonNode.get(Relation.SOURCE_PROPERTY));
|
.getUUIDFromJsonNode(jsonNode.get(Relation.SOURCE_PROPERTY));
|
||||||
|
|
||||||
sourceEntityManagement = newSourceEntityManagement();
|
sourceEntityManagement = newSourceEntityManagement();
|
||||||
|
|
|
@ -23,7 +23,7 @@ import javax.ws.rs.core.Response.Status;
|
||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.gcube.common.authorization.library.provider.CalledMethodProvider;
|
import org.gcube.common.authorization.library.provider.CalledMethodProvider;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
|
import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
|
@ -104,7 +104,7 @@ public class Access {
|
||||||
@Path(AccessPath.CONTEXTS_PATH_PART)
|
@Path(AccessPath.CONTEXTS_PATH_PART)
|
||||||
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
|
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
|
||||||
public String getAllContexts() throws ResourceRegistryException {
|
public String getAllContexts() throws ResourceRegistryException {
|
||||||
logger.info("Requested to read all {}s", org.gcube.informationsystem.model.entity.Context.NAME);
|
logger.info("Requested to read all {}s", org.gcube.informationsystem.model.reference.entity.Context.NAME);
|
||||||
setCalledMethodLocal(HTTPMETHOD.GET, AccessPath.CONTEXTS_PATH_PART);
|
setCalledMethodLocal(HTTPMETHOD.GET, AccessPath.CONTEXTS_PATH_PART);
|
||||||
ContextManagement contextManagement = new ContextManagement();
|
ContextManagement contextManagement = new ContextManagement();
|
||||||
return contextManagement.all(false);
|
return contextManagement.all(false);
|
||||||
|
@ -123,7 +123,7 @@ public class Access {
|
||||||
if(uuid.compareTo(AccessPath.CURRENT_CONTEXT)==0){
|
if(uuid.compareTo(AccessPath.CURRENT_CONTEXT)==0){
|
||||||
uuid = ContextUtility.getCurrentSecurityContext().getUUID().toString();
|
uuid = ContextUtility.getCurrentSecurityContext().getUUID().toString();
|
||||||
}
|
}
|
||||||
logger.info("Requested to read {} with id {} ", org.gcube.informationsystem.model.entity.Context.NAME, uuid);
|
logger.info("Requested to read {} with id {} ", org.gcube.informationsystem.model.reference.entity.Context.NAME, uuid);
|
||||||
|
|
||||||
List<String> pathValues = new ArrayList<>();
|
List<String> pathValues = new ArrayList<>();
|
||||||
pathValues.add(AccessPath.CONTEXTS_PATH_PART);
|
pathValues.add(AccessPath.CONTEXTS_PATH_PART);
|
||||||
|
|
|
@ -13,7 +13,7 @@ import javax.ws.rs.PathParam;
|
||||||
import javax.ws.rs.Produces;
|
import javax.ws.rs.Produces;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.entity.Context;
|
import org.gcube.informationsystem.model.reference.entity.Context;
|
||||||
import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
|
import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
||||||
|
|
|
@ -18,7 +18,7 @@ import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.Response.Status;
|
import javax.ws.rs.core.Response.Status;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
|
import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import javax.ws.rs.PUT;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
import javax.ws.rs.PathParam;
|
import javax.ws.rs.PathParam;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.entity.Context;
|
import org.gcube.informationsystem.model.reference.entity.Context;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
|
||||||
|
|
|
@ -2,10 +2,10 @@ package org.gcube.informationsystem.resourceregistry.schema;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
import org.gcube.informationsystem.model.reference.embedded.Embedded;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.reference.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.schema;
|
package org.gcube.informationsystem.resourceregistry.schema;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,11 @@ import java.util.Set;
|
||||||
|
|
||||||
import javax.activation.UnsupportedDataTypeException;
|
import javax.activation.UnsupportedDataTypeException;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.AccessType;
|
import org.gcube.informationsystem.model.reference.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
import org.gcube.informationsystem.model.reference.embedded.Embedded;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.reference.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaAlreadyPresentException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaCreationException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaCreationException;
|
||||||
|
|
|
@ -3,14 +3,14 @@ package org.gcube.informationsystem.resourceregistry.utils;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.reference.embedded.Header;
|
||||||
|
|
||||||
import com.orientechnologies.orient.core.record.impl.ODocument;
|
import com.orientechnologies.orient.core.record.impl.ODocument;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public class HeaderOrient extends ODocument implements org.gcube.informationsystem.model.embedded.Header {
|
public class HeaderOrient extends ODocument implements org.gcube.informationsystem.model.reference.embedded.Header {
|
||||||
|
|
||||||
public HeaderOrient() {
|
public HeaderOrient() {
|
||||||
super(Header.NAME);
|
super(Header.NAME);
|
||||||
|
|
|
@ -9,9 +9,9 @@ import java.util.UUID;
|
||||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||||
import org.gcube.common.authorization.library.provider.ClientInfo;
|
import org.gcube.common.authorization.library.provider.ClientInfo;
|
||||||
import org.gcube.common.authorization.library.utils.Caller;
|
import org.gcube.common.authorization.library.utils.Caller;
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.model.ER;
|
import org.gcube.informationsystem.model.reference.ER;
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.reference.embedded.Header;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -31,7 +31,7 @@ public class HeaderUtility {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(HeaderUtility.class);
|
private static final Logger logger = LoggerFactory.getLogger(HeaderUtility.class);
|
||||||
|
|
||||||
public static String getUser() {
|
public static String getUser() {
|
||||||
String user = org.gcube.informationsystem.model.embedded.Header.UNKNOWN_USER;
|
String user = org.gcube.informationsystem.model.reference.embedded.Header.UNKNOWN_USER;
|
||||||
try {
|
try {
|
||||||
Caller caller = AuthorizationProvider.instance.get();
|
Caller caller = AuthorizationProvider.instance.get();
|
||||||
if(caller != null) {
|
if(caller != null) {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.utils;
|
package org.gcube.informationsystem.resourceregistry.utils;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint;
|
||||||
|
|
||||||
import com.orientechnologies.orient.core.record.impl.ODocument;
|
import com.orientechnologies.orient.core.record.impl.ODocument;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public class PropagationConstraintOrient extends ODocument implements org.gcube.informationsystem.model.embedded.PropagationConstraint {
|
public class PropagationConstraintOrient extends ODocument implements org.gcube.informationsystem.model.reference.embedded.PropagationConstraint {
|
||||||
|
|
||||||
public PropagationConstraintOrient() {
|
public PropagationConstraintOrient() {
|
||||||
super(PropagationConstraint.NAME);
|
super(PropagationConstraint.NAME);
|
||||||
|
|
|
@ -7,11 +7,11 @@ import java.util.UUID;
|
||||||
|
|
||||||
import org.codehaus.jettison.json.JSONException;
|
import org.codehaus.jettison.json.JSONException;
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
import org.gcube.informationsystem.model.reference.embedded.Embedded;
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.reference.embedded.Header;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.reference.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
||||||
|
|
|
@ -4,11 +4,11 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.embedded.HeaderImpl;
|
import org.gcube.informationsystem.model.impl.embedded.HeaderImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.ContextImpl;
|
import org.gcube.informationsystem.model.impl.entity.ContextImpl;
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.model.entity.Context;
|
import org.gcube.informationsystem.model.reference.entity.Context;
|
||||||
import org.gcube.informationsystem.model.relation.IsParentOf;
|
import org.gcube.informationsystem.model.reference.relation.IsParentOf;
|
||||||
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextAlreadyPresentException;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.er;
|
package org.gcube.informationsystem.resourceregistry.er;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.ER;
|
import org.gcube.informationsystem.model.reference.ER;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
|
|
||||||
public abstract class AbstractERManagementTest<Er extends ER> {
|
public abstract class AbstractERManagementTest<Er extends ER> {
|
||||||
|
|
|
@ -16,47 +16,20 @@ import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||||
import org.gcube.informationsystem.impl.embedded.HeaderImpl;
|
import org.gcube.informationsystem.model.impl.embedded.HeaderImpl;
|
||||||
import org.gcube.informationsystem.impl.embedded.PropagationConstraintImpl;
|
import org.gcube.informationsystem.model.impl.embedded.PropagationConstraintImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.AccessPointFacetImpl;
|
import org.gcube.informationsystem.model.impl.relation.ConsistsOfImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.CPUFacetImpl;
|
import org.gcube.informationsystem.model.impl.relation.IsIdentifiedByImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.EventFacetImpl;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.LicenseFacetImpl;
|
import org.gcube.informationsystem.model.impl.utils.Utility;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.NetworkingFacetImpl;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.ServiceStateFacetImpl;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.RemoveConstraint;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.SimpleFacetImpl;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.SoftwareFacetImpl;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.StateFacetImpl;
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.impl.entity.resource.EServiceImpl;
|
import org.gcube.informationsystem.model.reference.relation.IsIdentifiedBy;
|
||||||
import org.gcube.informationsystem.impl.entity.resource.HostingNodeImpl;
|
import org.gcube.informationsystem.model.reference.relation.IsRelatedTo;
|
||||||
import org.gcube.informationsystem.impl.relation.ConsistsOfImpl;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.impl.relation.IsIdentifiedByImpl;
|
|
||||||
import org.gcube.informationsystem.impl.relation.isrelatedto.HostsImpl;
|
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
|
||||||
import org.gcube.informationsystem.impl.utils.Utility;
|
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint;
|
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.RemoveConstraint;
|
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.AccessPointFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.CPUFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.ContactFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.EventFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.LicenseFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.NetworkingFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.ServiceStateFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.SimpleFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.SoftwareFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.StateFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.Configuration;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.EService;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.HostingNode;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.Service;
|
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
|
||||||
import org.gcube.informationsystem.model.relation.IsIdentifiedBy;
|
|
||||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
|
||||||
import org.gcube.informationsystem.model.relation.isrelatedto.Hosts;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException;
|
||||||
|
@ -65,6 +38,33 @@ import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
|
import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.relation.ConsistsOfManagement;
|
import org.gcube.informationsystem.resourceregistry.er.relation.ConsistsOfManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.relation.IsRelatedToManagement;
|
import org.gcube.informationsystem.resourceregistry.er.relation.IsRelatedToManagement;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.AccessPointFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.CPUFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.EventFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.LicenseFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.NetworkingFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.ServiceStateFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.SimpleFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.SoftwareFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.StateFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.resource.EServiceImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.resource.HostingNodeImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.relation.isrelatedto.ActivatesImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.AccessPointFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.CPUFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.ContactFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.EventFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.LicenseFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.NetworkingFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.ServiceStateFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.SimpleFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.SoftwareFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.StateFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.Configuration;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.EService;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.HostingNode;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.Service;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.relation.isrelatedto.Activates;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -348,9 +348,9 @@ public class ERManagementTest extends ScopedTest {
|
||||||
PropagationConstraint propagationConstraint = new PropagationConstraintImpl();
|
PropagationConstraint propagationConstraint = new PropagationConstraintImpl();
|
||||||
propagationConstraint.setRemoveConstraint(RemoveConstraint.cascade);
|
propagationConstraint.setRemoveConstraint(RemoveConstraint.cascade);
|
||||||
|
|
||||||
Hosts<HostingNode, EService> hosts = new HostsImpl<HostingNode, EService>(
|
Activates<HostingNode, EService> activates = new ActivatesImpl<HostingNode, EService>(
|
||||||
hostingNode, eService, propagationConstraint);
|
hostingNode, eService, propagationConstraint);
|
||||||
hostingNode.attachResource(hosts);
|
hostingNode.attachResource(activates);
|
||||||
|
|
||||||
resourceManagement = new ResourceManagement();
|
resourceManagement = new ResourceManagement();
|
||||||
resourceManagement.setElementType(HostingNode.NAME);
|
resourceManagement.setElementType(HostingNode.NAME);
|
||||||
|
|
|
@ -22,41 +22,41 @@ import java.util.UUID;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.embedded.HeaderImpl;
|
import org.gcube.informationsystem.model.impl.embedded.HeaderImpl;
|
||||||
import org.gcube.informationsystem.impl.embedded.PropagationConstraintImpl;
|
import org.gcube.informationsystem.model.impl.embedded.PropagationConstraintImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.CPUFacetImpl;
|
import org.gcube.informationsystem.model.impl.relation.ConsistsOfImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.ContainerStateFacetImpl;
|
import org.gcube.informationsystem.model.impl.relation.IsIdentifiedByImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.MemoryFacetImpl;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.NetworkingFacetImpl;
|
import org.gcube.informationsystem.model.reference.embedded.Header;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.SimplePropertyFacetImpl;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.SoftwareFacetImpl;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.RemoveConstraint;
|
||||||
import org.gcube.informationsystem.impl.entity.resource.HostingNodeImpl;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.impl.relation.ConsistsOfImpl;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.impl.relation.IsIdentifiedByImpl;
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.impl.relation.consistsof.HasPersistentMemoryImpl;
|
import org.gcube.informationsystem.model.reference.relation.IsIdentifiedBy;
|
||||||
import org.gcube.informationsystem.impl.relation.consistsof.HasVolatileMemoryImpl;
|
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint;
|
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.RemoveConstraint;
|
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.CPUFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.ContainerStateFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.MemoryFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.MemoryFacet.MemoryUnit;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.NetworkingFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.SimplePropertyFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.SoftwareFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.EService;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.HostingNode;
|
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
|
||||||
import org.gcube.informationsystem.model.relation.IsIdentifiedBy;
|
|
||||||
import org.gcube.informationsystem.model.relation.consistsof.HasPersistentMemory;
|
|
||||||
import org.gcube.informationsystem.model.relation.consistsof.HasVolatileMemory;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
|
import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.CPUFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.ContainerStateFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.MemoryFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.NetworkingFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.SimplePropertyFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.SoftwareFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.resource.HostingNodeImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.relation.consistsof.HasPersistentMemoryImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.relation.consistsof.HasVolatileMemoryImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.CPUFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.ContainerStateFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.MemoryFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.NetworkingFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.SimplePropertyFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.SoftwareFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.MemoryFacet.MemoryUnit;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.EService;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.HostingNode;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.relation.consistsof.HasPersistentMemory;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.relation.consistsof.HasVolatileMemory;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
|
@ -2,11 +2,9 @@ package org.gcube.informationsystem.resourceregistry.er.entity;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.entity.facet.SoftwareFacetImpl;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
import org.gcube.informationsystem.model.reference.ER;
|
||||||
import org.gcube.informationsystem.model.ER;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.SoftwareFacet;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
|
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.FacetAvailableInAnotherContextException;
|
||||||
|
@ -15,6 +13,8 @@ import org.gcube.informationsystem.resourceregistry.api.utils.Utility;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
import org.gcube.informationsystem.resourceregistry.context.ContextUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.ERManagementTest;
|
import org.gcube.informationsystem.resourceregistry.er.ERManagementTest;
|
||||||
import org.gcube.informationsystem.resourceregistry.utils.HeaderUtility;
|
import org.gcube.informationsystem.resourceregistry.utils.HeaderUtility;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.SoftwareFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.SoftwareFacet;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
|
@ -4,19 +4,19 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.entity.resource.EServiceImpl;
|
import org.gcube.informationsystem.model.impl.relation.IsIdentifiedByImpl;
|
||||||
import org.gcube.informationsystem.impl.relation.IsIdentifiedByImpl;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.model.entity.facet.SoftwareFacet;
|
import org.gcube.informationsystem.model.reference.relation.IsIdentifiedBy;
|
||||||
import org.gcube.informationsystem.model.entity.resource.EService;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.Service;
|
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
|
||||||
import org.gcube.informationsystem.model.relation.IsIdentifiedBy;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.ERManagement;
|
import org.gcube.informationsystem.resourceregistry.er.ERManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.ERManagementUtility;
|
import org.gcube.informationsystem.resourceregistry.er.ERManagementUtility;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.resource.EServiceImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.SoftwareFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.EService;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.Service;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
|
@ -8,41 +8,14 @@ import java.net.URL;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.embedded.PropagationConstraintImpl;
|
import org.gcube.informationsystem.model.impl.embedded.PropagationConstraintImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.AccessPointFacetImpl;
|
import org.gcube.informationsystem.model.impl.relation.IsIdentifiedByImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.CPUFacetImpl;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.EventFacetImpl;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.LicenseFacetImpl;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.AddConstraint;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.MemoryFacetImpl;
|
import org.gcube.informationsystem.model.reference.embedded.PropagationConstraint.RemoveConstraint;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.NetworkingFacetImpl;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.ServiceStateFacetImpl;
|
import org.gcube.informationsystem.model.reference.relation.IsIdentifiedBy;
|
||||||
import org.gcube.informationsystem.impl.entity.facet.SoftwareFacetImpl;
|
|
||||||
import org.gcube.informationsystem.impl.entity.resource.EServiceImpl;
|
|
||||||
import org.gcube.informationsystem.impl.entity.resource.HostingNodeImpl;
|
|
||||||
import org.gcube.informationsystem.impl.relation.IsIdentifiedByImpl;
|
|
||||||
import org.gcube.informationsystem.impl.relation.consistsof.HasPersistentMemoryImpl;
|
|
||||||
import org.gcube.informationsystem.impl.relation.consistsof.HasVolatileMemoryImpl;
|
|
||||||
import org.gcube.informationsystem.impl.relation.isrelatedto.HostsImpl;
|
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint;
|
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.AddConstraint;
|
|
||||||
import org.gcube.informationsystem.model.embedded.PropagationConstraint.RemoveConstraint;
|
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.AccessPointFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.CPUFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.EventFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.LicenseFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.MemoryFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.MemoryFacet.MemoryUnit;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.NetworkingFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.ServiceStateFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.SoftwareFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.EService;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.HostingNode;
|
|
||||||
import org.gcube.informationsystem.model.relation.IsIdentifiedBy;
|
|
||||||
import org.gcube.informationsystem.model.relation.consistsof.HasPersistentMemory;
|
|
||||||
import org.gcube.informationsystem.model.relation.consistsof.HasVolatileMemory;
|
|
||||||
import org.gcube.informationsystem.model.relation.isrelatedto.Hosts;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
||||||
|
@ -55,6 +28,33 @@ import org.gcube.informationsystem.resourceregistry.er.SmartgearResourcesTest;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
|
import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
|
import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.relation.IsRelatedToManagement;
|
import org.gcube.informationsystem.resourceregistry.er.relation.IsRelatedToManagement;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.AccessPointFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.CPUFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.EventFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.LicenseFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.MemoryFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.NetworkingFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.ServiceStateFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.SoftwareFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.resource.EServiceImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.resource.HostingNodeImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.relation.consistsof.HasPersistentMemoryImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.relation.consistsof.HasVolatileMemoryImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.relation.isrelatedto.ActivatesImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.AccessPointFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.CPUFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.EventFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.LicenseFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.MemoryFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.NetworkingFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.ServiceStateFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.SoftwareFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.MemoryFacet.MemoryUnit;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.EService;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.HostingNode;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.relation.consistsof.HasPersistentMemory;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.relation.consistsof.HasVolatileMemory;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.relation.isrelatedto.Activates;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -240,9 +240,9 @@ public class BasicTest extends ScopedTest {
|
||||||
hostingNode, disk, null);
|
hostingNode, disk, null);
|
||||||
hostingNode.addFacet(hasPersistentMemory);
|
hostingNode.addFacet(hasPersistentMemory);
|
||||||
|
|
||||||
Hosts<HostingNode, EService> hosts = new HostsImpl<HostingNode, EService>(
|
Activates<HostingNode, EService> activates = new ActivatesImpl<HostingNode, EService>(
|
||||||
hostingNode, eService, null);
|
hostingNode, eService, null);
|
||||||
hostingNode.attachResource(hosts);
|
hostingNode.attachResource(activates);
|
||||||
|
|
||||||
resourceManagement = new ResourceManagement();
|
resourceManagement = new ResourceManagement();
|
||||||
resourceManagement.setElementType(HostingNode.NAME);
|
resourceManagement.setElementType(HostingNode.NAME);
|
||||||
|
@ -354,7 +354,7 @@ public class BasicTest extends ScopedTest {
|
||||||
UUID eServiceUUID = eService.getHeader().getUUID();
|
UUID eServiceUUID = eService.getHeader().getUUID();
|
||||||
|
|
||||||
|
|
||||||
/* Creating Hosts Relation */
|
/* Creating Activates Relation */
|
||||||
|
|
||||||
PropagationConstraint propagationConstraint = new PropagationConstraintImpl();
|
PropagationConstraint propagationConstraint = new PropagationConstraintImpl();
|
||||||
propagationConstraint
|
propagationConstraint
|
||||||
|
@ -363,19 +363,19 @@ public class BasicTest extends ScopedTest {
|
||||||
.setAddConstraint(AddConstraint.propagate);
|
.setAddConstraint(AddConstraint.propagate);
|
||||||
|
|
||||||
|
|
||||||
Hosts<HostingNode, EService> hosts = new HostsImpl<>(hostingNode, eService,
|
Activates<HostingNode, EService> activates = new ActivatesImpl<>(hostingNode, eService,
|
||||||
propagationConstraint);
|
propagationConstraint);
|
||||||
|
|
||||||
IsRelatedToManagement isRelatedToManagement = new IsRelatedToManagement();
|
IsRelatedToManagement isRelatedToManagement = new IsRelatedToManagement();
|
||||||
isRelatedToManagement.setElementType(Hosts.NAME);
|
isRelatedToManagement.setElementType(Activates.NAME);
|
||||||
String hostsJson = ISMapper.marshal(hosts);
|
String activatesJson = ISMapper.marshal(activates);
|
||||||
isRelatedToManagement.setJSON(hostsJson);
|
isRelatedToManagement.setJSON(activatesJson);
|
||||||
String createdHostsJson = isRelatedToManagement.create();
|
String createdActivatesJson = isRelatedToManagement.create();
|
||||||
logger.debug("Created : {}", createdHostsJson);
|
logger.debug("Created : {}", createdActivatesJson);
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Hosts<HostingNode, EService> createdHosts = ISMapper.unmarshal(Hosts.class, createdHostsJson);
|
Activates<HostingNode, EService> createdActivates = ISMapper.unmarshal(Activates.class, createdActivatesJson);
|
||||||
UUID hostsUUID = createdHosts.getHeader().getUUID();
|
UUID activatesUUID = createdActivates.getHeader().getUUID();
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
@ -399,7 +399,7 @@ public class BasicTest extends ScopedTest {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isRelatedToManagement = new IsRelatedToManagement();
|
isRelatedToManagement = new IsRelatedToManagement();
|
||||||
isRelatedToManagement.setUUID(hostsUUID);
|
isRelatedToManagement.setUUID(activatesUUID);
|
||||||
isRelatedToManagement.addToContext(ContextUtility.getCurrentSecurityContext().getUUID());
|
isRelatedToManagement.addToContext(ContextUtility.getCurrentSecurityContext().getUUID());
|
||||||
|
|
||||||
/* The addTocontext on the relation adds the source and target too.
|
/* The addTocontext on the relation adds the source and target too.
|
||||||
|
@ -424,7 +424,7 @@ public class BasicTest extends ScopedTest {
|
||||||
Assert.assertTrue(removed);
|
Assert.assertTrue(removed);
|
||||||
|
|
||||||
/* The cascading MUST remove the relation and the target so that
|
/* The cascading MUST remove the relation and the target so that
|
||||||
* I MUST not be able to read Hosts relation and EService
|
* I MUST not be able to read Activates relation and EService
|
||||||
*/
|
*/
|
||||||
|
|
||||||
resourceManagement = new ResourceManagement();
|
resourceManagement = new ResourceManagement();
|
||||||
|
@ -439,10 +439,10 @@ public class BasicTest extends ScopedTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
isRelatedToManagement = new IsRelatedToManagement();
|
isRelatedToManagement = new IsRelatedToManagement();
|
||||||
isRelatedToManagement.setUUID(hostsUUID);
|
isRelatedToManagement.setUUID(activatesUUID);
|
||||||
try {
|
try {
|
||||||
isRelatedToManagement.read();
|
isRelatedToManagement.read();
|
||||||
String error = String.format("{} with UUID {} should not be visible.", Hosts.NAME, hostsUUID);
|
String error = String.format("{} with UUID {} should not be visible.", Activates.NAME, activatesUUID);
|
||||||
logger.trace(error);
|
logger.trace(error);
|
||||||
throw new Exception(error);
|
throw new Exception(error);
|
||||||
}catch (RelationAvailableInAnotherContextException e) {
|
}catch (RelationAvailableInAnotherContextException e) {
|
||||||
|
|
|
@ -2,19 +2,19 @@ package org.gcube.informationsystem.resourceregistry.er.multicontext;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.entity.facet.SoftwareFacetImpl;
|
import org.gcube.informationsystem.model.impl.relation.IsIdentifiedByImpl;
|
||||||
import org.gcube.informationsystem.impl.entity.resource.EServiceImpl;
|
import org.gcube.informationsystem.model.impl.utils.ISMapper;
|
||||||
import org.gcube.informationsystem.impl.relation.IsIdentifiedByImpl;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
import org.gcube.informationsystem.model.reference.relation.IsIdentifiedBy;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
|
||||||
import org.gcube.informationsystem.model.entity.facet.SoftwareFacet;
|
|
||||||
import org.gcube.informationsystem.model.entity.resource.EService;
|
|
||||||
import org.gcube.informationsystem.model.relation.IsIdentifiedBy;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
import org.gcube.informationsystem.resourceregistry.ScopedTest;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAlreadyPresentException;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
|
import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
|
import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.facet.SoftwareFacetImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.impl.entity.resource.EServiceImpl;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.SoftwareFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.EService;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
|
@ -5,20 +5,20 @@ package org.gcube.informationsystem.resourceregistry.schema;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.ISManageable;
|
import org.gcube.informationsystem.model.reference.ISManageable;
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
import org.gcube.informationsystem.model.reference.embedded.Embedded;
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.reference.embedded.Header;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.reference.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
import org.gcube.informationsystem.model.reference.entity.Facet;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.reference.entity.Resource;
|
||||||
import org.gcube.informationsystem.model.entity.facet.ContactFacet;
|
import org.gcube.informationsystem.model.reference.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.model.entity.resource.Actor;
|
import org.gcube.informationsystem.model.reference.relation.IsRelatedTo;
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
import org.gcube.informationsystem.model.reference.relation.Relation;
|
||||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
|
||||||
import org.gcube.informationsystem.model.relation.isrelatedto.Hosts;
|
|
||||||
import org.gcube.informationsystem.types.TypeBinder;
|
import org.gcube.informationsystem.types.TypeBinder;
|
||||||
import org.gcube.informationsystem.types.TypeBinder.TypeDefinition;
|
import org.gcube.informationsystem.types.TypeBinder.TypeDefinition;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.facet.ContactFacet;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.entity.resource.Actor;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.relation.isrelatedto.Hosts;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
Loading…
Reference in New Issue