org.squashtest.csp.tm.internal.service.deletion
Class TestCaseNodeDeletionHandlerImpl

java.lang.Object
  extended by org.squashtest.csp.tm.internal.service.deletion.AbstractNodeDeletionHandlerImpl<TestCaseLibraryNode,TestCaseFolder>
      extended by org.squashtest.csp.tm.internal.service.deletion.TestCaseNodeDeletionHandlerImpl
All Implemented Interfaces:
NodeDeletionHandler<TestCaseLibraryNode,TestCaseFolder>, TestCaseNodeDeletionHandler

@Component(value="squashtest.tm.service.deletion.TestCaseNodeDeletionHandler")
public class TestCaseNodeDeletionHandlerImpl
extends AbstractNodeDeletionHandlerImpl<TestCaseLibraryNode,TestCaseFolder>
implements TestCaseNodeDeletionHandler


Constructor Summary
TestCaseNodeDeletionHandlerImpl()
           
 
Method Summary
protected  void batchDeleteNodes(List<Long> ids)
          Will delete the nodes identified by the ids parameter.
 void deleteStep(TestCase owner, TestStep step)
           
protected  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  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<Object[]> getAllCallerCalledPairs(List<Long> calledIds)
          See TestCaseDao.findTestCasesHavingCallerDetails(java.util.Collection) for more information regarding that mysterious Object[]
protected  FolderDao<TestCaseFolder,TestCaseLibraryNode> getFolderDao()
          The implemention should return which FolderDao to use depending on the end domain object.
protected  LockedFileInferenceGraph initLockGraph(List<Long> candidatesId)
           
protected  AffectedEntitiesPreviewReport previewAffectedNodes(List<Long> nodeIds)
           
protected  NotDeletablePreviewReport previewLockedNodes(List<Long> nodeIds)
           
 
Methods inherited from class org.squashtest.csp.tm.internal.service.deletion.AbstractNodeDeletionHandlerImpl
deleteNodes, findNodeHierarchy, findPairedNodeHierarchy, simulateDeletion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.squashtest.csp.tm.internal.service.NodeDeletionHandler
deleteNodes, simulateDeletion
 

Constructor Detail

TestCaseNodeDeletionHandlerImpl

public TestCaseNodeDeletionHandlerImpl()
Method Detail

getFolderDao

protected FolderDao<TestCaseFolder,TestCaseLibraryNode> getFolderDao()
Description copied from class: AbstractNodeDeletionHandlerImpl
The implemention should return which FolderDao to use depending on the end domain object.

Specified by:
getFolderDao in class AbstractNodeDeletionHandlerImpl<TestCaseLibraryNode,TestCaseFolder>
Returns:
an appropriate FolderDao.

diagnoseSuppression

protected List<SuppressionPreviewReport> diagnoseSuppression(List<Long> nodeIds)
Description copied from class: AbstractNodeDeletionHandlerImpl

Given their ids, that method should check the nodes and actually report the informations as specified in NodeDeletionHandler.simulateDeletion(List). See AbstractNodeDeletionHandlerImpl.detectLockedNodes(List) for details regarding the input list.

Specified by:
diagnoseSuppression in class AbstractNodeDeletionHandlerImpl<TestCaseLibraryNode,TestCaseFolder>
Parameters:
nodeIds - the complete list of the nodes involved in that report.
Returns:
a list of reports summarizing in human readable format what will happen.

detectLockedNodes

protected List<Long> detectLockedNodes(List<Long> nodeIds)
Description copied from class: AbstractNodeDeletionHandlerImpl

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.

Specified by:
detectLockedNodes in class AbstractNodeDeletionHandlerImpl<TestCaseLibraryNode,TestCaseFolder>
Parameters:
nodeIds - all the node ids.
Returns:
the sublist of node ids that should NOT be deleted.

batchDeleteNodes

protected void batchDeleteNodes(List<Long> ids)
Description copied from class: AbstractNodeDeletionHandlerImpl
Will delete the nodes identified by the ids parameter. Those nodes have been identified as legal for deletion and the implementation should only care of deleting them and unbinding them from the rest of the domain.

Specified by:
batchDeleteNodes in class AbstractNodeDeletionHandlerImpl<TestCaseLibraryNode,TestCaseFolder>
Parameters:
ids - the doomed node ids.

deleteStep

public void deleteStep(TestCase owner,
                       TestStep step)
Specified by:
deleteStep in interface TestCaseNodeDeletionHandler

previewLockedNodes

protected NotDeletablePreviewReport previewLockedNodes(List<Long> nodeIds)

previewAffectedNodes

protected AffectedEntitiesPreviewReport previewAffectedNodes(List<Long> nodeIds)

getAllCallerCalledPairs

protected List<Object[]> getAllCallerCalledPairs(List<Long> calledIds)
See TestCaseDao.findTestCasesHavingCallerDetails(java.util.Collection) for more information regarding that mysterious Object[]


initLockGraph

protected LockedFileInferenceGraph initLockGraph(List<Long> candidatesId)


Copyright © 2010-2012 Squashtest TM, Squashtest.org. All Rights Reserved.