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

java.lang.Object
  extended by org.squashtest.tm.service.internal.library.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 org.squashtest.tm.domain.library.LibraryNode,NODE extends org.squashtest.tm.domain.library.LibraryNode,FOLDER extends org.squashtest.tm.domain.library.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<org.squashtest.tm.domain.library.Library<NODE>,NODE> libraryDao)
           
 void setNodeDao(EntityDao<MANAGED> nodeDao)
           
 void setPermissionService(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

public void setPermissionService(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 org.squashtest.tm.domain.library.LibraryNode,NODE extends org.squashtest.tm.domain.library.LibraryNode,FOLDER extends org.squashtest.tm.domain.library.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 org.squashtest.tm.domain.library.LibraryNode,NODE extends org.squashtest.tm.domain.library.LibraryNode,FOLDER extends org.squashtest.tm.domain.library.Folder<NODE>>

renameNode

public final void renameNode(long nodeId,
                             String newName)
                      throws org.squashtest.tm.exception.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 org.squashtest.tm.domain.library.LibraryNode,NODE extends org.squashtest.tm.domain.library.LibraryNode,FOLDER extends org.squashtest.tm.domain.library.Folder<NODE>>
Throws:
org.squashtest.tm.exception.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 org.squashtest.tm.domain.library.LibraryNode,NODE extends org.squashtest.tm.domain.library.LibraryNode,FOLDER extends org.squashtest.tm.domain.library.Folder<NODE>>
Parameters:
nodeId - the node id
newDescription - the new description (String)

setLibraryDao

public void setLibraryDao(LibraryDao<org.squashtest.tm.domain.library.Library<NODE>,NODE> libraryDao)

setNodeDao

public void setNodeDao(EntityDao<MANAGED> nodeDao)


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