88 lines
1.9 KiB
Java
88 lines
1.9 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.informationsystem.impl.entity;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import org.gcube.informationsystem.model.entity.Facet;
|
|
import org.gcube.informationsystem.model.entity.Resource;
|
|
import org.gcube.informationsystem.model.relation.RelationProperty;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
|
*
|
|
*/
|
|
public abstract class ResourceImpl extends EntityImpl implements Resource {
|
|
|
|
protected Map<Facet, RelationProperty> addedFacets;
|
|
protected Map<Facet, RelationProperty> attachedFacets;
|
|
protected List<Facet> detachedFacets;
|
|
|
|
|
|
protected Map<Resource, RelationProperty> attachedResourceProfiles;
|
|
protected List<Resource> detachedResourceProfiles;
|
|
|
|
/**
|
|
* @param name
|
|
* @param description
|
|
* @param version
|
|
*/
|
|
protected ResourceImpl(String name, String description, String version) {
|
|
super(name, description, version);
|
|
addedFacets = new HashMap<Facet, RelationProperty>();
|
|
attachedFacets = new HashMap<Facet, RelationProperty>();
|
|
detachedFacets = new ArrayList<>();
|
|
|
|
|
|
|
|
}
|
|
|
|
@Override
|
|
public void addFacet(Facet facet) {
|
|
addedFacets.put(facet, null);
|
|
|
|
}
|
|
|
|
@Override
|
|
public void addFacet(Facet facet, RelationProperty relationProperty) {
|
|
addedFacets.put(facet, relationProperty);
|
|
}
|
|
|
|
@Override
|
|
public void attachFacet(Facet facet) {
|
|
attachedFacets.put(facet, null);
|
|
}
|
|
|
|
@Override
|
|
public void attachFacet(Facet facet, RelationProperty relationProperty) {
|
|
attachedFacets.put(facet, relationProperty);
|
|
}
|
|
|
|
@Override
|
|
public void detachFacet(Facet facet) {
|
|
detachedFacets.add(facet);
|
|
attachedFacets.remove(facet);
|
|
}
|
|
|
|
@Override
|
|
public void attachResource(Resource resource) {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void attachResource(Resource resource,
|
|
RelationProperty relationProperty) {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void detachResource(Resource resource) {
|
|
|
|
}
|
|
|
|
}
|