org.squashtest.csp.tm.internal.service
Class BugTrackerLocalServiceImpl

java.lang.Object
  extended by org.squashtest.csp.tm.internal.service.BugTrackerLocalServiceImpl
All Implemented Interfaces:
BugTrackerLocalService

@Service(value="squashtest.tm.service.BugTrackerLocalService")
@Transactional
public class BugTrackerLocalServiceImpl
extends Object
implements BugTrackerLocalService


Constructor Summary
BugTrackerLocalServiceImpl()
           
 
Method Summary
 BugTrackerStatus checkBugTrackerStatus()
          tests if the bugtracker is ready for use
 org.squashtest.csp.core.bugtracker.domain.BTIssue createIssue(Bugged entity, org.squashtest.csp.core.bugtracker.domain.BTIssue issue)
          adds a new Issue to the entity.
<X extends Bugged>
X
findBuggedEntity(Long entityId, Class<X> entityClass)
          returns an instance of an entity that implements Bugged, provided its id and actual class.
 FilteredCollectionHolder<List<IssueOwnership<org.squashtest.csp.core.bugtracker.domain.BTIssue>>> findBugTrackerIssues(Bugged buggedEntity, CollectionSorting sorter)
          Given a Bugged Entity, returns a list of BTIssue (not Issue).
 org.squashtest.csp.core.bugtracker.domain.BTProject findRemoteProject(String name)
          returns an instance of the remote project.
 FilteredCollectionHolder<List<IssueOwnership<Issue>>> findSquashIssues(Bugged buggedEntity, CollectionSorting sorter)
          Given a Bugged Entity, returns a list of Issue (not BTIssue).
 org.squashtest.csp.core.bugtracker.spi.BugTrackerInterfaceDescriptor getInterfaceDescriptor()
          An InterfaceDescriptor contains informations relevant to the generation of a view/GUI.
 List<org.squashtest.csp.core.bugtracker.domain.BTIssue> getIssues(List<String> issueKeyList)
          returns a list of BTIssu corresponding to the given string keys
 URL getIssueUrl(String btIssueId)
          Gets the url of a remote Issue given its Id
 List<org.squashtest.csp.core.bugtracker.domain.Priority> getRemotePriorities()
          returns the list of priorities .
 void setCredentials(String username, String password)
          sets the credentials of an user for authentication bugtracker-side.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BugTrackerLocalServiceImpl

public BugTrackerLocalServiceImpl()
Method Detail

findBuggedEntity

@PostAuthorize(value="hasPermission(returnObject,\'READ\') or hasRole(\'ROLE_ADMIN\')")
public <X extends Bugged> X findBuggedEntity(Long entityId,
                                                           Class<X> entityClass)
Description copied from interface: BugTrackerLocalService
returns an instance of an entity that implements Bugged, provided its id and actual class.

Specified by:
findBuggedEntity in interface BugTrackerLocalService
Type Parameters:
X - : a .class of an implementor of bugged.
Parameters:
entityId - : the id of that entity.
entityClass - : the actual class of that entity.
Returns:
: the entity if found, null if not found.

getInterfaceDescriptor

public org.squashtest.csp.core.bugtracker.spi.BugTrackerInterfaceDescriptor getInterfaceDescriptor()
Description copied from interface: BugTrackerLocalService
An InterfaceDescriptor contains informations relevant to the generation of a view/GUI. See the class for more details.

Specified by:
getInterfaceDescriptor in interface BugTrackerLocalService
Returns:
an InterfaceDescriptor.

checkBugTrackerStatus

public BugTrackerStatus checkBugTrackerStatus()
Description copied from interface: BugTrackerLocalService
tests if the bugtracker is ready for use

Specified by:
checkBugTrackerStatus in interface BugTrackerLocalService
Returns:
the status of the bugtracker

createIssue

@PreAuthorize(value="hasPermission(#entity, \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.csp.core.bugtracker.domain.BTIssue createIssue(Bugged entity,
                                                                                  org.squashtest.csp.core.bugtracker.domain.BTIssue issue)
Description copied from interface: BugTrackerLocalService
adds a new Issue to the entity. The entity must implement Bugged.

Specified by:
createIssue in interface BugTrackerLocalService
issue - : the issue to add
Returns:
the BTIssue corresponding to the bug remotely created

getIssues

public List<org.squashtest.csp.core.bugtracker.domain.BTIssue> getIssues(List<String> issueKeyList)
Description copied from interface: BugTrackerLocalService
returns a list of BTIssu corresponding to the given string keys

Specified by:
getIssues in interface BugTrackerLocalService
Parameters:
issueKeyList - the issue key list
Returns:
a BTIssue list

findSquashIssues

@PreAuthorize(value="hasPermission(#buggedEntity, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public FilteredCollectionHolder<List<IssueOwnership<Issue>>> findSquashIssues(Bugged buggedEntity,
                                                                                           CollectionSorting sorter)
Description copied from interface: BugTrackerLocalService
Given a Bugged Entity, returns a list of Issue (not BTIssue). That method will return the list of - its own issues, - the issues of other Bugged entities it may be related to. To keep track of which entity owns which issue, the data are wrapped in a IssueOwnership (that just pair the informations together).

Specified by:
findSquashIssues in interface BugTrackerLocalService
Parameters:
buggedEntity - of which we need to get the issues,
sorter - that tells us how we should sort and filter the data
Returns:
a FilteredCollectionHolder containing a non-null but possibly empty list of IssueOwnership, sorted and filtered according to the CollectionSorting.

findBugTrackerIssues

@PreAuthorize(value="hasPermission(#buggedEntity, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public FilteredCollectionHolder<List<IssueOwnership<org.squashtest.csp.core.bugtracker.domain.BTIssue>>> findBugTrackerIssues(Bugged buggedEntity,
                                                                                                                                           CollectionSorting sorter)
Description copied from interface: BugTrackerLocalService
Given a Bugged Entity, returns a list of BTIssue (not Issue). That method will return the list of - its own issues, - the issues of other Bugged entities it may be related to. To keep track of which entity owns which issue, the data are wrapped in a IssueOwnership (that just pair the informations together).

Specified by:
findBugTrackerIssues in interface BugTrackerLocalService
Parameters:
buggedEntity - of which we need to get the issues,
sorter - that tells us how we should sort and filter the data
Returns:
a FilteredCollectionHolder containing a non-null but possibly empty list of IssueOwnership, sorted and filtered according to the CollectionSorting.

findRemoteProject

public org.squashtest.csp.core.bugtracker.domain.BTProject findRemoteProject(String name)
Description copied from interface: BugTrackerLocalService
returns an instance of the remote project.

Specified by:
findRemoteProject in interface BugTrackerLocalService
Parameters:
name - : the name of the project.
Returns:
the project filled with users and versions if found.

getRemotePriorities

public List<org.squashtest.csp.core.bugtracker.domain.Priority> getRemotePriorities()
Description copied from interface: BugTrackerLocalService
returns the list of priorities .

Specified by:
getRemotePriorities in interface BugTrackerLocalService
Returns:
the list of priorities. An empty list is returned if none are found.

setCredentials

public void setCredentials(String username,
                           String password)
Description copied from interface: BugTrackerLocalService
sets the credentials of an user for authentication bugtracker-side.

Specified by:
setCredentials in interface BugTrackerLocalService

getIssueUrl

public URL getIssueUrl(String btIssueId)
Description copied from interface: BugTrackerLocalService
Gets the url of a remote Issue given its Id

Specified by:
getIssueUrl in interface BugTrackerLocalService
Parameters:
btIssueId - the id of that issue
Returns:
the URL where you may find that issue.


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