com.atlassian.jira.plugin.webfragment
Class DefaultSimpleLinkManager

java.lang.Object
  extended by com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager
All Implemented Interfaces:
SimpleLinkManager

public class DefaultSimpleLinkManager
extends java.lang.Object
implements SimpleLinkManager

Default implementation of the SimpleLinkManager This actually uses combines SimpleLinkFactory lists with WebItemModuleDescriptor links and WebSectionModuleDescriptor sections, respecting weights.

Since:
v4.0

Constructor Summary
DefaultSimpleLinkManager(JiraWebInterfaceManager webInterfaceManager, SimpleLinkFactoryModuleDescriptorAccessor accessor, JiraAuthenticationContext authenticationContext, VelocityRequestContextFactory velocityRequestContextFactory)
           
 
Method Summary
 java.util.List<SimpleLink> getLinksForSection(java.lang.String section, com.opensymphony.user.User remoteUser, JiraHelper jiraHelper)
          Gets a list of SimpleLink for the given section.
 java.util.List<SimpleLink> getLinksForSectionIgnoreConditions(java.lang.String section, com.opensymphony.user.User remoteUser, JiraHelper jiraHelper)
          Gets a list of SimpleLink for the given section, without filtering links using the conditions specified for the links.
 java.util.List<SimpleLinkSection> getSectionsForLocation(java.lang.String location, com.opensymphony.user.User remoteUser, JiraHelper jiraHelper)
          Gets a list of SimpleLinkSection for the given location.
 boolean shouldLocationBeLazy(java.lang.String location, com.opensymphony.user.User remoteUser, JiraHelper jiraHelper)
          This determines whether a location should be loaded lazily if possible.
 boolean shouldSectionBeLazy(java.lang.String section)
          This determines whether a section should be loaded lazily if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSimpleLinkManager

public DefaultSimpleLinkManager(JiraWebInterfaceManager webInterfaceManager,
                                SimpleLinkFactoryModuleDescriptorAccessor accessor,
                                JiraAuthenticationContext authenticationContext,
                                VelocityRequestContextFactory velocityRequestContextFactory)
Method Detail

shouldLocationBeLazy

public boolean shouldLocationBeLazy(@NotNull
                                    java.lang.String location,
                                    com.opensymphony.user.User remoteUser,
                                    @NotNull
                                    JiraHelper jiraHelper)
This determines whether a location should be loaded lazily if possible. This loops through all sections for the location and then retreives all SimpleLinkFactoryModuleDescriptor for those sections and sees whether any of the factories say they should be lazy. If any say true, return true.

Specified by:
shouldLocationBeLazy in interface SimpleLinkManager
Parameters:
location - The location to check for
remoteUser - The user that we are generating the list for
jiraHelper - The context under which the list is being generated
Returns:
true if any of the underlying factories for this location say they should be lazy, false otherwise

shouldSectionBeLazy

public boolean shouldSectionBeLazy(java.lang.String section)
This determines whether a section should be loaded lazily if possible.

Specified by:
shouldSectionBeLazy in interface SimpleLinkManager
Parameters:
section - The section to check for
Returns:
true if any of the underlying factories for this section say they should be lazy, false otherwise

getLinksForSection

public java.util.List<SimpleLink> getLinksForSection(java.lang.String section,
                                                     com.opensymphony.user.User remoteUser,
                                                     JiraHelper jiraHelper)
Description copied from interface: SimpleLinkManager
Gets a list of SimpleLink for the given section.

Specified by:
getLinksForSection in interface SimpleLinkManager
Parameters:
section - The section to generate the list for
remoteUser - The user that we are generating the list for
jiraHelper - The context under which the list is being generated
Returns:
The list of links for the given section

getLinksForSectionIgnoreConditions

public java.util.List<SimpleLink> getLinksForSectionIgnoreConditions(@NotNull
                                                                     java.lang.String section,
                                                                     com.opensymphony.user.User remoteUser,
                                                                     @NotNull
                                                                     JiraHelper jiraHelper)
Description copied from interface: SimpleLinkManager
Gets a list of SimpleLink for the given section, without filtering links using the conditions specified for the links. This will effectively return a list of links without running any security checks.

Specified by:
getLinksForSectionIgnoreConditions in interface SimpleLinkManager
Parameters:
section - The section to generate the list for
remoteUser - The user that we are generating the list for
jiraHelper - The context under which the list is being generated
Returns:
The list of links for the given section

getSectionsForLocation

public java.util.List<SimpleLinkSection> getSectionsForLocation(java.lang.String location,
                                                                com.opensymphony.user.User remoteUser,
                                                                JiraHelper jiraHelper)
Description copied from interface: SimpleLinkManager
Gets a list of SimpleLinkSection for the given location.

Specified by:
getSectionsForLocation in interface SimpleLinkManager
Parameters:
location - The location to generate the list for
remoteUser - The user that we are generating the list for
jiraHelper - The context under which the list is being generated
Returns:
The list of sections for the give location


Copyright © 2002-2011 Atlassian. All Rights Reserved.