Denying the possibility to create a stand alone Facet
This commit is contained in:
parent
647e772827
commit
df5e44e520
|
@ -3,6 +3,7 @@ package org.gcube.informationsystem.resourceregistry.instances.model.entities;
|
|||
import org.gcube.com.fasterxml.jackson.databind.JsonNode;
|
||||
import org.gcube.informationsystem.base.reference.AccessType;
|
||||
import org.gcube.informationsystem.model.reference.entities.Facet;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException;
|
||||
|
@ -122,4 +123,16 @@ public class FacetManagement extends EntityManagement<Facet, FacetType> {
|
|||
checkResource();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String create() throws AlreadyPresentException, ResourceRegistryException {
|
||||
throw new ResourceRegistryException("You cannot create an horphan Facet");
|
||||
}
|
||||
|
||||
public OVertex internalCreate() throws AlreadyPresentException, ResourceRegistryException {
|
||||
if(entryPoint && operation == Operation.CREATE) {
|
||||
throw new ResourceRegistryException("You cannot create an horphan Facet");
|
||||
}
|
||||
return super.internalCreate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue