From d13ec28dcbdf0458dc1855ec946f47e51f5a4657 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 25 May 2016 07:40:05 +0000 Subject: [PATCH] Creating IS model refs #4023 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/information-system-model@128811 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../impl/entity/ResourceImpl.java | 26 +++++++------------ .../model/entity/Resource.java | 13 +++------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/impl/entity/ResourceImpl.java b/src/main/java/org/gcube/informationsystem/impl/entity/ResourceImpl.java index d4b6f9e..b145ffb 100644 --- a/src/main/java/org/gcube/informationsystem/impl/entity/ResourceImpl.java +++ b/src/main/java/org/gcube/informationsystem/impl/entity/ResourceImpl.java @@ -19,7 +19,7 @@ import org.gcube.informationsystem.model.relation.RelationProperty; public abstract class ResourceImpl extends EntityImpl implements Resource { protected Map addedFacets; - protected Map attachedFacets; + protected Map attachedFacets; protected List detachedFacets; @@ -34,7 +34,7 @@ public abstract class ResourceImpl extends EntityImpl implements Resource { protected ResourceImpl(String name, String description, String version) { super(name, description, version); addedFacets = new HashMap(); - attachedFacets = new HashMap(); + attachedFacets = new HashMap(); detachedFacets = new ArrayList<>(); @@ -53,35 +53,27 @@ public abstract class ResourceImpl extends EntityImpl implements Resource { } @Override - public void attachFacet(Facet facet) { - attachedFacets.put(facet, null); + public void attachFacet(String uuid) { + attachedFacets.put(uuid, null); } @Override - public void attachFacet(Facet facet, RelationProperty relationProperty) { - attachedFacets.put(facet, relationProperty); + public void attachFacet(String uuid, RelationProperty relationProperty) { + attachedFacets.put(uuid, relationProperty); } - @Override - public void detachFacet(Facet facet) { - detachedFacets.add(facet); - attachedFacets.remove(facet); - } + @Override - public void attachResource(Resource resource) { + public void attachResource(String uuid) { } @Override - public void attachResource(Resource resource, + public void attachResource(String uuid, RelationProperty relationProperty) { } - @Override - public void detachResource(Resource resource) { - - } } diff --git a/src/main/java/org/gcube/informationsystem/model/entity/Resource.java b/src/main/java/org/gcube/informationsystem/model/entity/Resource.java index be7b014..e3e1514 100644 --- a/src/main/java/org/gcube/informationsystem/model/entity/Resource.java +++ b/src/main/java/org/gcube/informationsystem/model/entity/Resource.java @@ -18,19 +18,14 @@ public interface Resource extends Entity { public void addFacet(Facet facet, RelationProperty relationProperty); - public void attachFacet(Facet facet); + public void attachFacet(String uuid); - public void attachFacet(Facet facet, RelationProperty relationProperty); - - public void detachFacet(Facet facet); + public void attachFacet(String uuid, RelationProperty relationProperty); + public void attachResource(String uuid); - public void attachResource(Resource resource); - - public void attachResource(Resource resource, RelationProperty relationProperty); - - public void detachResource(Resource resource); + public void attachResource(String uuid, RelationProperty relationProperty); }