com.atlassian.greenhopper.service.rapid.view
Class RapidViewServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.rapid.view.RapidViewServiceImpl
All Implemented Interfaces:
GreenHopperCache, RapidViewService

@Service
public class RapidViewServiceImpl
extends java.lang.Object
implements RapidViewService


Constructor Summary
RapidViewServiceImpl()
           
 
Method Summary
 ServiceOutcome<RapidView> copy(com.atlassian.crowd.embedded.api.User user, RapidView sourceRapidView)
          Create a new copy of the specified RapidView entity and store it in the database.
 ServiceOutcome<RapidView> create(com.atlassian.crowd.embedded.api.User user, java.lang.String name, java.lang.Long savedFilterId, RapidViewPreset preset)
          Create a new RapidView entity and store it in the database.
 ServiceOutcome<java.lang.Void> delete(com.atlassian.crowd.embedded.api.User user, java.lang.Long id)
          Delete a rapid view given its ID
 ServiceOutcome<java.util.List<RapidView>> findRapidViewsByName(com.atlassian.crowd.embedded.api.User user, java.lang.String nameQuery)
          Returns all views whose name matches the nameQuery in any part of the name.
 void flushCache()
          Invoked when all caches in the plugin need to be cleared.
 ServiceOutcome<RapidView> getFirstVisibleRapidView(com.atlassian.crowd.embedded.api.User user)
          Get the first visible rapid view for a given user
 ServiceOutcome<RapidView> getRapidView(com.atlassian.crowd.embedded.api.User user, java.lang.Long id)
           
 java.util.List<RapidView> getRapidViews(com.atlassian.crowd.embedded.api.User user, ErrorCollection errors)
           
 ServiceOutcome<java.util.List<RapidView>> getRapidViewsWithOutcome(com.atlassian.crowd.embedded.api.User user)
           
 ServiceOutcome<com.atlassian.jira.issue.fields.CustomField> getSortedByRankField(com.atlassian.crowd.embedded.api.User user, RapidView view)
           
 boolean isSortedByRankField(com.atlassian.crowd.embedded.api.User user, RapidView rapidView)
           
 ServiceOutcome<java.lang.Void> update(com.atlassian.crowd.embedded.api.User user, RapidView view)
          Save a RapidView entity's state to the database.
 ServiceOutcome<java.lang.Void> updateWithOutcome(com.atlassian.crowd.embedded.api.User user, RapidView view)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RapidViewServiceImpl

public RapidViewServiceImpl()
Method Detail

create

@NotNull
public ServiceOutcome<RapidView> create(com.atlassian.crowd.embedded.api.User user,
                                                java.lang.String name,
                                                java.lang.Long savedFilterId,
                                                RapidViewPreset preset)
Description copied from interface: RapidViewService
Create a new RapidView entity and store it in the database.

Specified by:
create in interface RapidViewService
savedFilterId - : The ID of JIRA's SearchRequest that is to be associated with the new view

copy

public ServiceOutcome<RapidView> copy(com.atlassian.crowd.embedded.api.User user,
                                      RapidView sourceRapidView)
Description copied from interface: RapidViewService
Create a new copy of the specified RapidView entity and store it in the database.

Specified by:
copy in interface RapidViewService
Parameters:
user - the user who requested to copy the rapid view
sourceRapidView - the view to copy
Returns:
the copied RapidView

updateWithOutcome

public ServiceOutcome<java.lang.Void> updateWithOutcome(com.atlassian.crowd.embedded.api.User user,
                                                        RapidView view)
Specified by:
updateWithOutcome in interface RapidViewService

update

public ServiceOutcome<java.lang.Void> update(com.atlassian.crowd.embedded.api.User user,
                                             RapidView view)
Description copied from interface: RapidViewService
Save a RapidView entity's state to the database. The ID must be set.

Specified by:
update in interface RapidViewService

delete

public ServiceOutcome<java.lang.Void> delete(com.atlassian.crowd.embedded.api.User user,
                                             java.lang.Long id)
Description copied from interface: RapidViewService
Delete a rapid view given its ID

Specified by:
delete in interface RapidViewService
Returns:
an error collection containing any errors, empty if successful

getRapidViews

public java.util.List<RapidView> getRapidViews(com.atlassian.crowd.embedded.api.User user,
                                               ErrorCollection errors)
Specified by:
getRapidViews in interface RapidViewService
Returns:
all views the user is allowed to see, or an empty list.

getFirstVisibleRapidView

public ServiceOutcome<RapidView> getFirstVisibleRapidView(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: RapidViewService
Get the first visible rapid view for a given user

Specified by:
getFirstVisibleRapidView in interface RapidViewService
Parameters:
user - the user in play
Returns:
the first visible rapid view, invalid service outcome otherwise

getRapidViewsWithOutcome

public ServiceOutcome<java.util.List<RapidView>> getRapidViewsWithOutcome(com.atlassian.crowd.embedded.api.User user)
Specified by:
getRapidViewsWithOutcome in interface RapidViewService
Returns:
all views the user is allowed to see, or an empty list.

findRapidViewsByName

public ServiceOutcome<java.util.List<RapidView>> findRapidViewsByName(com.atlassian.crowd.embedded.api.User user,
                                                                      java.lang.String nameQuery)
Description copied from interface: RapidViewService
Returns all views whose name matches the nameQuery in any part of the name. For example, "green" will match views named "green team" and "blue and green" alike.

Views will be filtered down to those which the user can see.

Specified by:
findRapidViewsByName in interface RapidViewService
Parameters:
user - the user performing the search
nameQuery - a part of a view name to match e.g. "green"
Returns:
all views the user is allowed to see, or an empty list.

getRapidView

@NotNull
public ServiceOutcome<RapidView> getRapidView(com.atlassian.crowd.embedded.api.User user,
                                                      java.lang.Long id)
Specified by:
getRapidView in interface RapidViewService

isSortedByRankField

public boolean isSortedByRankField(com.atlassian.crowd.embedded.api.User user,
                                   RapidView rapidView)
Specified by:
isSortedByRankField in interface RapidViewService
Returns:
if the rapidView can be ranked

getSortedByRankField

@NotNull
public ServiceOutcome<com.atlassian.jira.issue.fields.CustomField> getSortedByRankField(com.atlassian.crowd.embedded.api.User user,
                                                                                                RapidView view)
Specified by:
getSortedByRankField in interface RapidViewService
Returns:
the rank custom field the board is sorted by, or an error otherwise

flushCache

public void flushCache()
Description copied from interface: GreenHopperCache
Invoked when all caches in the plugin need to be cleared.

Specified by:
flushCache in interface GreenHopperCache


Copyright © 2007-2013 Atlassian. All Rights Reserved.