public class ThreadLocalCachingSimpleLinkManager extends DefaultSimpleLinkManager
SimpleLinkManager
implementation that caches results in JiraAuthenticationContextImpl.getRequestCache()
.Modifier and Type | Class and Description |
---|---|
protected static class |
ThreadLocalCachingSimpleLinkManager.CacheKey |
Constructor and Description |
---|
ThreadLocalCachingSimpleLinkManager(com.atlassian.plugin.web.api.DynamicWebInterfaceManager webInterfaceManager,
SimpleLinkFactoryModuleDescriptors simpleLinkFactoryModuleDescriptors,
JiraAuthenticationContext authenticationContext,
com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider,
VelocityRequestContextFactory velocityRequestContextFactory) |
Modifier and Type | Method and Description |
---|---|
List<SimpleLink> |
getLinksForSection(String section,
ApplicationUser remoteUser,
JiraHelper jiraHelper)
Gets a list of
SimpleLink for the given section. |
List<SimpleLink> |
getLinksForSection(String section,
ApplicationUser remoteUser,
JiraHelper jiraHelper,
boolean addIconCachingPrefix)
Gets a list of
SimpleLink for the given section. |
List<SimpleLink> |
getLinksForSectionIgnoreConditions(String section,
ApplicationUser remoteUser,
JiraHelper jiraHelper)
Gets a list of
SimpleLink for the given section, without
filtering links using the conditions specified for the links. |
List<SimpleLinkSection> |
getNotEmptySectionsForLocation(String location,
ApplicationUser remoteUser,
JiraHelper jiraHelper)
Gets a list of
SimpleLinkSection for the given location, that have either web-items or
other web-sections within them. |
SimpleLinkSection |
getSectionForURL(String topLevelSection,
String URL,
ApplicationUser remoteUser,
JiraHelper jiraHelper)
Recursively search through our sections within sections within sections within ...
|
List<SimpleLinkSection> |
getSectionsForLocation(String location,
ApplicationUser remoteUser,
JiraHelper jiraHelper)
Gets a list of
SimpleLinkSection for the given location. |
boolean |
shouldLocationBeLazy(String location,
ApplicationUser remoteUser,
JiraHelper jiraHelper)
This determines whether a location should be loaded lazily if possible.
|
boolean |
shouldSectionBeLazy(String section)
This determines whether a section should be loaded lazily if possible.
|
public ThreadLocalCachingSimpleLinkManager(com.atlassian.plugin.web.api.DynamicWebInterfaceManager webInterfaceManager, SimpleLinkFactoryModuleDescriptors simpleLinkFactoryModuleDescriptors, JiraAuthenticationContext authenticationContext, com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider, VelocityRequestContextFactory velocityRequestContextFactory)
public boolean shouldLocationBeLazy(@Nonnull String location, ApplicationUser remoteUser, @Nonnull JiraHelper jiraHelper)
DefaultSimpleLinkManager
SimpleLinkFactoryModuleDescriptor
for those sections and sees whether any of the factories say they should be lazy. If any say true, return true.shouldLocationBeLazy
in interface SimpleLinkManager
shouldLocationBeLazy
in class DefaultSimpleLinkManager
location
- The location to check forremoteUser
- The user that we are generating the list forjiraHelper
- The context under which the list is being generatedpublic boolean shouldSectionBeLazy(String section)
DefaultSimpleLinkManager
shouldSectionBeLazy
in interface SimpleLinkManager
shouldSectionBeLazy
in class DefaultSimpleLinkManager
section
- The section to check for@Nonnull public List<SimpleLink> getLinksForSection(@Nonnull String section, ApplicationUser remoteUser, @Nonnull JiraHelper jiraHelper)
SimpleLinkManager
SimpleLink
for the given section.getLinksForSection
in interface SimpleLinkManager
getLinksForSection
in class DefaultSimpleLinkManager
section
- The section to generate the list forremoteUser
- The user that we are generating the list forjiraHelper
- The context under which the list is being generated@Nonnull public List<SimpleLink> getLinksForSection(@Nonnull String section, ApplicationUser remoteUser, @Nonnull JiraHelper jiraHelper, boolean addIconCachingPrefix)
SimpleLinkManager
SimpleLink
for the given section.
Additionally it adds caching prefix to icon url, if addIconCachinPrefix is truegetLinksForSection
in interface SimpleLinkManager
getLinksForSection
in class DefaultSimpleLinkManager
section
- The section to generate the list forremoteUser
- The user that we are generating the list forjiraHelper
- The context under which the list is being generatedaddIconCachingPrefix
- Diecides if relative icon URL will be automatically prefixed@Nonnull public List<SimpleLink> getLinksForSectionIgnoreConditions(@Nonnull String section, ApplicationUser remoteUser, @Nonnull JiraHelper jiraHelper)
SimpleLinkManager
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.getLinksForSectionIgnoreConditions
in interface SimpleLinkManager
getLinksForSectionIgnoreConditions
in class DefaultSimpleLinkManager
section
- The section to generate the list forremoteUser
- The user that we are generating the list forjiraHelper
- The context under which the list is being generated@Nonnull public List<SimpleLinkSection> getSectionsForLocation(@Nonnull String location, ApplicationUser remoteUser, @Nonnull JiraHelper jiraHelper)
SimpleLinkManager
SimpleLinkSection
for the given location.getSectionsForLocation
in interface SimpleLinkManager
getSectionsForLocation
in class DefaultSimpleLinkManager
location
- The location to generate the list forremoteUser
- The user that we are generating the list forjiraHelper
- The context under which the list is being generatedpublic SimpleLinkSection getSectionForURL(@Nonnull String topLevelSection, @Nonnull String URL, ApplicationUser remoteUser, JiraHelper jiraHelper)
SimpleLinkManager
getSectionForURL
in interface SimpleLinkManager
getSectionForURL
in class DefaultSimpleLinkManager
topLevelSection
- The top level section from where to start searching!URL
- The URL for the action e.g. https://jdog.atlassian.com/secure/project/ViewProjects.jspa. We check if this URL contains a web-item's path which is usually something shorter like /secure/project/ViewProjects.jsparemoteUser
- The user that we are generating the list forjiraHelper
- The context under which the list is being generated@Nonnull public List<SimpleLinkSection> getNotEmptySectionsForLocation(@Nonnull String location, ApplicationUser remoteUser, @Nonnull JiraHelper jiraHelper)
SimpleLinkManager
SimpleLinkSection
for the given location, that have either web-items or
other web-sections within them.getNotEmptySectionsForLocation
in interface SimpleLinkManager
getNotEmptySectionsForLocation
in class DefaultSimpleLinkManager
location
- The location to generate the list forremoteUser
- The user that we are generating the list forjiraHelper
- The context under which the list is being generatedCopyright © 2002-2016 Atlassian. All Rights Reserved.