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

java.lang.Object
  extended by org.squashtest.tm.service.internal.deletion.AbstractNodeDeletionHandler<org.squashtest.tm.domain.requirement.RequirementLibraryNode,org.squashtest.tm.domain.requirement.RequirementFolder>
      extended by org.squashtest.tm.service.internal.deletion.RequirementDeletionHandlerImpl
All Implemented Interfaces:
NodeDeletionHandler<org.squashtest.tm.domain.requirement.RequirementLibraryNode,org.squashtest.tm.domain.requirement.RequirementFolder>, RequirementNodeDeletionHandler

@Component(value="squashtest.tm.service.deletion.RequirementNodeDeletionHandler")
public class RequirementDeletionHandlerImpl
extends AbstractNodeDeletionHandler<org.squashtest.tm.domain.requirement.RequirementLibraryNode,org.squashtest.tm.domain.requirement.RequirementFolder>
implements RequirementNodeDeletionHandler


Constructor Summary
RequirementDeletionHandlerImpl()
           
 
Method Summary
protected  OperationReport batchDeleteNodes(List<Long> ids)
          Will delete the nodes identified by the ids parameter.
 OperationReport deleteNodes(List<Long> targetIds)
          NodeDeletionHandler.deleteNodes(List)
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.requirement.RequirementFolder,org.squashtest.tm.domain.requirement.RequirementLibraryNode> getFolderDao()
          The implemention should return which FolderDao to use depending on the end domain object.
 
Methods inherited from class org.squashtest.tm.service.internal.deletion.AbstractNodeDeletionHandler
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
simulateDeletion
 

Constructor Detail

RequirementDeletionHandlerImpl

public RequirementDeletionHandlerImpl()
Method Detail

getFolderDao

protected FolderDao<org.squashtest.tm.domain.requirement.RequirementFolder,org.squashtest.tm.domain.requirement.RequirementLibraryNode> 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.requirement.RequirementLibraryNode,org.squashtest.tm.domain.requirement.RequirementFolder>
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.requirement.RequirementLibraryNode,org.squashtest.tm.domain.requirement.RequirementFolder>
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: 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.requirement.RequirementLibraryNode,org.squashtest.tm.domain.requirement.RequirementFolder>
Parameters:
nodeIds - all the node ids.
Returns:
the sublist of node ids that should NOT be deleted.

deleteNodes

public OperationReport deleteNodes(List<Long> targetIds)
Description copied from class: AbstractNodeDeletionHandler
NodeDeletionHandler.deleteNodes(List)

Specified by:
deleteNodes in interface NodeDeletionHandler<org.squashtest.tm.domain.requirement.RequirementLibraryNode,org.squashtest.tm.domain.requirement.RequirementFolder>
Overrides:
deleteNodes in class AbstractNodeDeletionHandler<org.squashtest.tm.domain.requirement.RequirementLibraryNode,org.squashtest.tm.domain.requirement.RequirementFolder>
Parameters:
targetIds - the list of node ids selected by the user.
Returns:
an OperationReport saying what happened.

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.requirement.RequirementLibraryNode,org.squashtest.tm.domain.requirement.RequirementFolder>
Parameters:
ids - the doomed node ids.
Returns:


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