org.squashtest.csp.tm.internal.service
Class GenericNodeManagementService<MANAGED extends LibraryNode,NODE extends LibraryNode,FOLDER extends Folder<NODE>>

java.lang.Object
  extended by org.squashtest.csp.tm.internal.service.GenericNodeManagementService<MANAGED,NODE,FOLDER>
Type Parameters:
FOLDER - Type of folder which can contain managed type
NODE - Type of common node supertype of FOLDER and MANAGED
MANAGED - Type of nodes manged by this class
All Implemented Interfaces:
NodeManagementService<MANAGED,NODE,FOLDER>

@Transactional
public class GenericNodeManagementService<MANAGED extends LibraryNode,NODE extends LibraryNode,FOLDER extends Folder<NODE>>
extends Object
implements NodeManagementService<MANAGED,NODE,FOLDER>

Generic management service for library nodes. It is responsible for common operations such as rename / move / copy and so on.

Author:
Gregory Fouquet

Constructor Summary
GenericNodeManagementService()
           
 
Method Summary
 MANAGED findNode(long nodeId)
          Finds a node by its ID.
 void removeNode(long nodeId)
          Removes a node from repository by its ID.
 void renameNode(long nodeId, String newName)
          Renames a node by its ID after checking that there is no name clash in the node's container.
 void setFolderDao(FolderDao<FOLDER,NODE> folderDao)
           
 void setLibraryDao(LibraryDao<Library<NODE>,NODE> libraryDao)
           
 void setNodeDao(EntityDao<MANAGED> nodeDao)
           
 void setPermissionService(org.squashtest.csp.core.service.security.PermissionEvaluationService permissionService)
           
 void updateNodeDescription(long nodeId, String newDescription)
          This method updates a node description
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericNodeManagementService

public GenericNodeManagementService()
Method Detail

setPermissionService

@ServiceReference
public void setPermissionService(org.squashtest.csp.core.service.security.PermissionEvaluationService permissionService)

findNode

@Transactional(readOnly=true)
@PostAuthorize(value="hasPermission(returnObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public MANAGED findNode(long nodeId)
Description copied from interface: NodeManagementService
Finds a node by its ID.

Specified by:
findNode in interface NodeManagementService<MANAGED extends LibraryNode,NODE extends LibraryNode,FOLDER extends Folder<NODE>>
Returns:

setFolderDao

public void setFolderDao(FolderDao<FOLDER,NODE> folderDao)

removeNode

public void removeNode(long nodeId)
Description copied from interface: NodeManagementService
Removes a node from repository by its ID.

Specified by:
removeNode in interface NodeManagementService<MANAGED extends LibraryNode,NODE extends LibraryNode,FOLDER extends Folder<NODE>>

renameNode

public final void renameNode(long nodeId,
                             String newName)
                      throws DuplicateNameException
Description copied from interface: NodeManagementService
Renames a node by its ID after checking that there is no name clash in the node's container.

Specified by:
renameNode in interface NodeManagementService<MANAGED extends LibraryNode,NODE extends LibraryNode,FOLDER extends Folder<NODE>>
Throws:
DuplicateNameException - if the node's container already contains a node with the new name.

updateNodeDescription

public final void updateNodeDescription(long nodeId,
                                        String newDescription)
Description copied from interface: NodeManagementService
This method updates a node description

Specified by:
updateNodeDescription in interface NodeManagementService<MANAGED extends LibraryNode,NODE extends LibraryNode,FOLDER extends Folder<NODE>>
Parameters:
nodeId - the node id
newDescription - the new description (String)

setLibraryDao

public void setLibraryDao(LibraryDao<Library<NODE>,NODE> libraryDao)

setNodeDao

public void setNodeDao(EntityDao<MANAGED> nodeDao)


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