|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.squashtest.tm.service.internal.deletion.AbstractNodeDeletionHandler<NODE,FOLDER>
NODE - a kind of LibraryNodeFOLDER - the corresponding Folderpublic abstract class AbstractNodeDeletionHandler<NODE extends org.squashtest.tm.domain.library.LibraryNode,FOLDER extends org.squashtest.tm.domain.library.Folder<NODE>>
This class is a abstract and generic implementation of NodeDeletionHandler that implements a few basic rules. Regardless of the end domain object (TestCase, Campaign etc) the common rules are :
diagnoseSuppression(List) and detectLockedNodes(List), which nodes are locked for other reasons. See the documentations of the subclasses
for more informations.
| Constructor Summary | |
|---|---|
AbstractNodeDeletionHandler()
|
|
| Method Summary | |
|---|---|
protected abstract OperationReport |
batchDeleteNodes(List<Long> ids)
Will delete the nodes identified by the ids parameter. |
OperationReport |
deleteNodes(List<Long> targetIds)
NodeDeletionHandler.deleteNodes(List) |
protected abstract List<Long> |
detectLockedNodes(List<Long> nodeIds)
Given a list of node ids, returns a sublist corresponding to the ids of the nodes which cannot be deleted according to the specs. |
protected abstract List<SuppressionPreviewReport> |
diagnoseSuppression(List<Long> nodeIds)
Given their ids, that method should check the nodes and actually report the informations as specified in NodeDeletionHandler.simulateDeletion(List). |
protected List<Long> |
findNodeHierarchy(List<Long> rootNodeIds)
Accepts a list of node ids and returns themselves and their children as a flat list. |
protected List<Long[]> |
findPairedNodeHierarchy(List<Long> rootNodeIds)
Accepts a list of ids and returns themselves and their children as a list of pairs, each pair being an array of long (node ids) such as [ parent.id, child.id ]. |
protected abstract FolderDao<FOLDER,NODE> |
getFolderDao()
The implemention should return which FolderDao to use depending on the end domain object. |
List<SuppressionPreviewReport> |
simulateDeletion(List<Long> targetIds)
NodeDeletionHandler.simulateDeletion(List) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractNodeDeletionHandler()
| Method Detail |
|---|
protected abstract FolderDao<FOLDER,NODE> getFolderDao()
public List<SuppressionPreviewReport> simulateDeletion(List<Long> targetIds)
NodeDeletionHandler.simulateDeletion(List)
simulateDeletion in interface NodeDeletionHandler<NODE extends org.squashtest.tm.domain.library.LibraryNode,FOLDER extends org.squashtest.tm.domain.library.Folder<NODE>>targetIds - the ids of the input node.
public OperationReport deleteNodes(List<Long> targetIds)
NodeDeletionHandler.deleteNodes(List)
deleteNodes in interface NodeDeletionHandler<NODE extends org.squashtest.tm.domain.library.LibraryNode,FOLDER extends org.squashtest.tm.domain.library.Folder<NODE>>targetIds - the list of node ids selected by the user.
protected List<Long[]> findPairedNodeHierarchy(List<Long> rootNodeIds)
Accepts a list of ids and returns themselves and their children as a list of pairs, each pair being an array of long (node ids) such as [ parent.id, child.id ].
see FolderDao.findPairedContentForList(List) for details. The nodes input nodes will be paired with null (no parents), and the leaves will be be paired with null (for children).
rootNodesIds - the ids defining the upper level of the hierarchy.
protected List<Long> findNodeHierarchy(List<Long> rootNodeIds)
Accepts a list of node ids and returns themselves and their children as a flat list.
rootNodeIds - rootNodesIds the ids defining the upper level of the hierarchy.
protected abstract List<Long> detectLockedNodes(List<Long> nodeIds)
Given a list of node ids, returns a sublist corresponding to the ids of the nodes which cannot be deleted according to the specs. The input list includes all the nodes and their children in the directory structure. The implementation is responsible to fetch any other dependencies needed for the completion of its task. The implementation is not required to resolve which folders are locked : this abstract class will handle that on the basis of the returned value.
nodeIds - all the node ids.
protected abstract List<SuppressionPreviewReport> diagnoseSuppression(List<Long> nodeIds)
Given their ids, that method should check the nodes and actually report the informations as specified in NodeDeletionHandler.simulateDeletion(List).
See detectLockedNodes(List) for details regarding the input list.
nodeIds - the complete list of the nodes involved in that report.
protected abstract OperationReport batchDeleteNodes(List<Long> ids)
ids - the doomed node ids.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||