com.atlassian.greenhopper.service.context
Class ContextServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.context.ContextServiceImpl
All Implemented Interfaces:
ContextService

@Service(value="gh-contextService")
public class ContextServiceImpl
extends java.lang.Object
implements ContextService

ContextService implementation.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.greenhopper.service.context.ContextService
ContextService.Locator
 
Field Summary
 
Fields inherited from interface com.atlassian.greenhopper.service.context.ContextService
SERVICE
 
Constructor Summary
ContextServiceImpl()
           
 
Method Summary
 java.util.Set<ContextInfo> getAllContexts(com.opensymphony.user.User user, ProjectConfiguration projectConfiguration)
          This method returns context info objects for whatever has been stored against user/shared contexts No attempt is taken at verifying that the context is still available.
 Context2 getById(com.opensymphony.user.User user, XProject xproject, java.lang.String id, boolean fallbackToDefault)
          Get a Context by id
 ContextInfo getInfoForContext(Context2 context)
          Get the info object for a given context.
 Context2 getSelectedContext(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, UserBoardSettings settings)
          Get the last selected context for a given project / board type
 void removeContext(ProjectConfiguration projectConfiguration, Context context)
          Removes a context object.
 void setSelectedContext(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, Context2 context, UserBoardSettings settings)
          Set the last selected context for a given project / board type
 void updateShareAndUserLists(ProjectConfiguration projectConfiguration, Context context)
          Updates the shared state of a context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextServiceImpl

public ContextServiceImpl()
Method Detail

getById

public Context2 getById(com.opensymphony.user.User user,
                        XProject xproject,
                        java.lang.String id,
                        boolean fallbackToDefault)
Get a Context by id

Specified by:
getById in interface ContextService
fallbackToDefault - if true then the default context is returned if a context with that id could not be located.
Returns:
the Context, or the default in case not found

getSelectedContext

public Context2 getSelectedContext(com.opensymphony.user.User user,
                                   XProject xproject,
                                   ViewDefinition view,
                                   UserBoardSettings settings)
Get the last selected context for a given project / board type

Specified by:
getSelectedContext in interface ContextService
Parameters:
user - the user to get the context for
Returns:
a context object

setSelectedContext

public void setSelectedContext(com.opensymphony.user.User user,
                               XProject xproject,
                               ViewDefinition view,
                               Context2 context,
                               UserBoardSettings settings)
Set the last selected context for a given project / board type

Specified by:
setSelectedContext in interface ContextService

getAllContexts

public java.util.Set<ContextInfo> getAllContexts(com.opensymphony.user.User user,
                                                 ProjectConfiguration projectConfiguration)
This method returns context info objects for whatever has been stored against user/shared contexts No attempt is taken at verifying that the context is still available.

Specified by:
getAllContexts in interface ContextService

getInfoForContext

public ContextInfo getInfoForContext(Context2 context)
Get the info object for a given context.

Specified by:
getInfoForContext in interface ContextService

updateShareAndUserLists

public void updateShareAndUserLists(ProjectConfiguration projectConfiguration,
                                    Context context)
Updates the shared state of a context.

Specified by:
updateShareAndUserLists in interface ContextService

removeContext

public void removeContext(ProjectConfiguration projectConfiguration,
                          Context context)
Removes a context object.

Specified by:
removeContext in interface ContextService


Copyright © 2007-2011 Atlassian. All Rights Reserved.