Loading src/main/java/it/inaf/oats/vospace/DeleteNodeService.java +34 −21 Original line number Diff line number Diff line Loading @@ -20,13 +20,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.Isolation; import it.inaf.ia2.aa.data.User; import it.inaf.oats.vospace.exception.InternalFaultException; import it.inaf.oats.vospace.exception.NodeBusyException; import org.springframework.transaction.annotation.Transactional; /** * * @author Nicola Fulvio Calabria <nicola.calabria at inaf.it> */ @Service @EnableTransactionManagement public class DeleteNodeService { Loading @@ -48,6 +49,16 @@ public class DeleteNodeService { throw PermissionDeniedException.forPath(path); } Long nodeId = nodeDao.getNodeId(path).get(); if (nodeDao.isBranchBusy(nodeId)) { throw new NodeBusyException(path); } if (nodeDao.isBranchImmutable(nodeId)) { throw new InternalFaultException("Target branch contains immutable nodes"); } nodeDao.deleteNode(path); } Loading Loading @@ -79,7 +90,9 @@ public class DeleteNodeService { Node mynode = nodeDao.listNode(tmpPath) .orElseThrow(() -> new NodeNotFoundException(tmpPath)); if (mynode.getType().equals("vos:LinkNode") && i < pathComponents.size() - 1) // a LinkNode leaf can be deleted { throw new LinkFoundException(tmpPath); } } Loading Loading
src/main/java/it/inaf/oats/vospace/DeleteNodeService.java +34 −21 Original line number Diff line number Diff line Loading @@ -20,13 +20,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.Isolation; import it.inaf.ia2.aa.data.User; import it.inaf.oats.vospace.exception.InternalFaultException; import it.inaf.oats.vospace.exception.NodeBusyException; import org.springframework.transaction.annotation.Transactional; /** * * @author Nicola Fulvio Calabria <nicola.calabria at inaf.it> */ @Service @EnableTransactionManagement public class DeleteNodeService { Loading @@ -48,6 +49,16 @@ public class DeleteNodeService { throw PermissionDeniedException.forPath(path); } Long nodeId = nodeDao.getNodeId(path).get(); if (nodeDao.isBranchBusy(nodeId)) { throw new NodeBusyException(path); } if (nodeDao.isBranchImmutable(nodeId)) { throw new InternalFaultException("Target branch contains immutable nodes"); } nodeDao.deleteNode(path); } Loading Loading @@ -79,7 +90,9 @@ public class DeleteNodeService { Node mynode = nodeDao.listNode(tmpPath) .orElseThrow(() -> new NodeNotFoundException(tmpPath)); if (mynode.getType().equals("vos:LinkNode") && i < pathComponents.size() - 1) // a LinkNode leaf can be deleted { throw new LinkFoundException(tmpPath); } } Loading