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

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

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


Constructor Summary
CampaignDeletionHandlerImpl()
           
 
Method Summary
protected  void batchDeleteNodes(List<Long> ids)
          Will delete the nodes identified by the ids parameter.
 void deleteExecSteps(Execution execution)
           
 void deleteExecution(Execution execution)
          that method should delete the execution.
 void deleteExecutions(List<Execution> executions)
           
 List<Long> deleteIterations(List<Long> targetIds)
          that method should delete the iterations.
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<CampaignFolder,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.
 
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

CampaignDeletionHandlerImpl

public CampaignDeletionHandlerImpl()
Method Detail

getFolderDao

protected FolderDao<CampaignFolder,CampaignLibraryNode> 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<CampaignLibraryNode,CampaignFolder>
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<CampaignLibraryNode,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:

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<CampaignLibraryNode,CampaignFolder>
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<CampaignLibraryNode,CampaignFolder>
Parameters:
ids - the doomed node ids.

deleteIterations

public List<Long> 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:
the list of the ids of the iterations actually deleted.

deleteExecution

public void deleteExecution(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

deleteExecutions

public void deleteExecutions(List<Execution> executions)

deleteExecSteps

public void deleteExecSteps(Execution execution)


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