org.squashtest.tm.service.internal.deletion
Class CampaignDeletionHandlerImpl

java.lang.Object
  extended by org.squashtest.tm.service.internal.deletion.AbstractNodeDeletionHandler<org.squashtest.tm.domain.campaign.CampaignLibraryNode,org.squashtest.tm.domain.campaign.CampaignFolder>
      extended by org.squashtest.tm.service.internal.deletion.CampaignDeletionHandlerImpl
All Implemented Interfaces:
CampaignNodeDeletionHandler, NodeDeletionHandler<org.squashtest.tm.domain.campaign.CampaignLibraryNode,org.squashtest.tm.domain.campaign.CampaignFolder>

@Component(value="squashtest.tm.service.deletion.CampaignNodeDeletionHandler")
public class CampaignDeletionHandlerImpl
extends AbstractNodeDeletionHandler<org.squashtest.tm.domain.campaign.CampaignLibraryNode,org.squashtest.tm.domain.campaign.CampaignFolder>
implements CampaignNodeDeletionHandler


Constructor Summary
CampaignDeletionHandlerImpl()
           
 
Method Summary
protected  OperationReport batchDeleteNodes(List<Long> ids)
          Will delete the nodes identified by the ids parameter.
 void deleteExecSteps(org.squashtest.tm.domain.execution.Execution execution)
           
 void deleteExecution(org.squashtest.tm.domain.execution.Execution execution)
          That method should delete the execution.
 void deleteExecutions(List<org.squashtest.tm.domain.execution.Execution> executions)
          uses CampaignNodeDeletionHandler.deleteExecution(Execution)
 OperationReport deleteIterations(List<Long> targetIds)
          That method should delete the iterations.
 void deleteIterationTestPlanItem(org.squashtest.tm.domain.campaign.IterationTestPlanItem item)
          That method should delete the test plan item.
 OperationReport deleteSuites(List<Long> testSuites)
          That method should delete test suites, and remove its references in iteration and iteration test plan item
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  FolderDao<org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode> getFolderDao()
          The implemention should return which FolderDao to use depending on the end domain object.
 List<SuppressionPreviewReport> simulateExecutionDeletion(Long execId)
          That method should investigate the consequences of the deletion of the given executions, and return a report about what will happen.
 List<SuppressionPreviewReport> simulateIterationDeletion(List<Long> targetIds)
          That method should investigate the consequences of the deletion of the given iterations, and return a report about what will happen.
 List<SuppressionPreviewReport> simulateSuiteDeletion(List<Long> targetIds)
          That method should investigate the consequences of the deletion of the given test suites, and return a report about what will happen.
 
Methods inherited from class org.squashtest.tm.service.internal.deletion.AbstractNodeDeletionHandler
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.tm.service.internal.library.NodeDeletionHandler
deleteNodes, simulateDeletion
 

Constructor Detail

CampaignDeletionHandlerImpl

public CampaignDeletionHandlerImpl()
Method Detail

getFolderDao

protected FolderDao<org.squashtest.tm.domain.campaign.CampaignFolder,org.squashtest.tm.domain.campaign.CampaignLibraryNode> getFolderDao()
Description copied from class: AbstractNodeDeletionHandler
The implemention should return which FolderDao to use depending on the end domain object.

Specified by:
getFolderDao in class AbstractNodeDeletionHandler<org.squashtest.tm.domain.campaign.CampaignLibraryNode,org.squashtest.tm.domain.campaign.CampaignFolder>
Returns:
an appropriate FolderDao.

diagnoseSuppression

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

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

Specified by:
diagnoseSuppression in class AbstractNodeDeletionHandler<org.squashtest.tm.domain.campaign.CampaignLibraryNode,org.squashtest.tm.domain.campaign.CampaignFolder>
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.

simulateIterationDeletion

public List<SuppressionPreviewReport> simulateIterationDeletion(List<Long> targetIds)
Description copied from interface: CampaignNodeDeletionHandler
That method should investigate the consequences of the deletion of the given iterations, and return a report about what will happen.

Specified by:
simulateIterationDeletion in interface CampaignNodeDeletionHandler
Returns:

simulateExecutionDeletion

public List<SuppressionPreviewReport> simulateExecutionDeletion(Long execId)
Description copied from interface: CampaignNodeDeletionHandler
That method should investigate the consequences of the deletion of the given executions, and return a report about what will happen.

Specified by:
simulateExecutionDeletion in interface CampaignNodeDeletionHandler
Returns:

simulateSuiteDeletion

public List<SuppressionPreviewReport> simulateSuiteDeletion(List<Long> targetIds)
Description copied from interface: CampaignNodeDeletionHandler
That method should investigate the consequences of the deletion of the given test suites, and return a report about what will happen.

Specified by:
simulateSuiteDeletion in interface CampaignNodeDeletionHandler
Returns:

detectLockedNodes

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

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 AbstractNodeDeletionHandler<org.squashtest.tm.domain.campaign.CampaignLibraryNode,org.squashtest.tm.domain.campaign.CampaignFolder>
Parameters:
nodeIds - all the node ids.
Returns:
the sublist of node ids that should NOT be deleted.

batchDeleteNodes

protected OperationReport batchDeleteNodes(List<Long> ids)
Description copied from class: AbstractNodeDeletionHandler
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 AbstractNodeDeletionHandler<org.squashtest.tm.domain.campaign.CampaignLibraryNode,org.squashtest.tm.domain.campaign.CampaignFolder>
Parameters:
ids - the doomed node ids.
Returns:

deleteIterations

public OperationReport deleteIterations(List<Long> targetIds)
Description copied from interface: CampaignNodeDeletionHandler
That method should delete the iterations. It still takes care of non deletable iterations so the implementation should filter out the ids that can't be deleted.

Specified by:
deleteIterations in interface CampaignNodeDeletionHandler
Returns:

deleteSuites

public OperationReport deleteSuites(List<Long> testSuites)
Description copied from interface: CampaignNodeDeletionHandler
That method should delete test suites, and remove its references in iteration and iteration test plan item

Specified by:
deleteSuites in interface CampaignNodeDeletionHandler
Returns:

deleteExecution

public void deleteExecution(org.squashtest.tm.domain.execution.Execution execution)
Description copied from interface: CampaignNodeDeletionHandler
That method should delete the execution. It still takes care of non deletable executions so the implementation should abort if the execution can't be deleted.

Specified by:
deleteExecution in interface CampaignNodeDeletionHandler

deleteIterationTestPlanItem

public void deleteIterationTestPlanItem(org.squashtest.tm.domain.campaign.IterationTestPlanItem item)
Description copied from interface: CampaignNodeDeletionHandler
That method should delete the test plan item. It will remove the executions along with the test plan item.

Specified by:
deleteIterationTestPlanItem in interface CampaignNodeDeletionHandler
Parameters:
item - : the IterationTestPlanItem to delete

deleteExecutions

public void deleteExecutions(List<org.squashtest.tm.domain.execution.Execution> executions)
Description copied from interface: CampaignNodeDeletionHandler
uses CampaignNodeDeletionHandler.deleteExecution(Execution)

Specified by:
deleteExecutions in interface CampaignNodeDeletionHandler

deleteExecSteps

public void deleteExecSteps(org.squashtest.tm.domain.execution.Execution execution)


Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.