2016-12-19 14:59:27 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2016-12-27 11:27:01 +01:00
|
|
|
package org.gcube.informationsystem.resourceregistry.er.relation;
|
2016-12-19 14:59:27 +01:00
|
|
|
|
2017-03-29 16:53:37 +02:00
|
|
|
import org.gcube.informationsystem.model.AccessType;
|
2016-12-19 14:59:27 +01:00
|
|
|
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
2017-11-17 12:31:22 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
2017-11-17 11:42:37 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.er.ERNotFoundException;
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfAlreadyPresentException;
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfAvailableInAnotherContextException;
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.relation.consistsOf.ConsistsOfNotFoundException;
|
2017-11-28 17:34:43 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.context.SecurityContext;
|
2017-11-17 11:42:37 +01:00
|
|
|
import org.gcube.informationsystem.resourceregistry.er.entity.FacetManagement;
|
|
|
|
import org.gcube.informationsystem.resourceregistry.er.entity.ResourceManagement;
|
2016-12-19 14:59:27 +01:00
|
|
|
|
|
|
|
import com.tinkerpop.blueprints.impls.orient.OrientGraph;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
|
|
*/
|
|
|
|
@SuppressWarnings("rawtypes")
|
2017-11-17 11:42:37 +01:00
|
|
|
public class ConsistsOfManagement extends RelationManagement<ConsistsOf, ResourceManagement, FacetManagement> {
|
2016-12-19 14:59:27 +01:00
|
|
|
|
|
|
|
public ConsistsOfManagement() {
|
2017-03-29 16:53:37 +02:00
|
|
|
super(AccessType.CONSISTS_OF);
|
2016-12-19 14:59:27 +01:00
|
|
|
}
|
|
|
|
|
2017-11-28 17:34:43 +01:00
|
|
|
public ConsistsOfManagement(SecurityContext workingContext, OrientGraph orientGraph) {
|
|
|
|
super(AccessType.CONSISTS_OF, workingContext, orientGraph);
|
2016-12-19 14:59:27 +01:00
|
|
|
}
|
2017-11-17 11:42:37 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected ConsistsOfNotFoundException getSpecificElementNotFoundException(ERNotFoundException e) {
|
|
|
|
return new ConsistsOfNotFoundException(e.getMessage(), e.getCause());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected ConsistsOfAvailableInAnotherContextException getSpecificERAvailableInAnotherContextException(
|
|
|
|
String message) {
|
|
|
|
return new ConsistsOfAvailableInAnotherContextException(message);
|
|
|
|
}
|
2016-12-19 14:59:27 +01:00
|
|
|
|
2017-11-17 11:42:37 +01:00
|
|
|
@Override
|
|
|
|
protected ConsistsOfAlreadyPresentException getSpecificERAlreadyPresentException(String message) {
|
|
|
|
return new ConsistsOfAlreadyPresentException(message);
|
|
|
|
}
|
2017-11-17 12:31:22 +01:00
|
|
|
|
|
|
|
@Override
|
2017-11-17 15:59:25 +01:00
|
|
|
protected ResourceManagement newSourceEntityManagement() throws ResourceRegistryException {
|
2017-11-28 17:34:43 +01:00
|
|
|
return new ResourceManagement(getWorkingContext(), orientGraph);
|
2017-11-17 12:31:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-11-17 15:59:25 +01:00
|
|
|
protected FacetManagement newTargetEntityManagement() throws ResourceRegistryException {
|
2017-11-28 17:34:43 +01:00
|
|
|
return new FacetManagement(getWorkingContext(), orientGraph);
|
2017-11-17 12:31:22 +01:00
|
|
|
}
|
2017-11-17 11:42:37 +01:00
|
|
|
|
2016-12-19 14:59:27 +01:00
|
|
|
}
|