com.atlassian.jira.plugin.util
Class SimplePluginsTracker

java.lang.Object
  extended by com.atlassian.jira.plugin.util.SimplePluginsTracker
All Implemented Interfaces:
PluginsTracker

@ThreadSafe
public class SimplePluginsTracker
extends Object
implements PluginsTracker

Since:
v6.2.3

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.plugin.util.PluginsTracker
PluginsTracker.PluginInfo
 
Constructor Summary
SimplePluginsTracker()
           
 
Method Summary
 void clear()
          Clear the underlying set of tracked plugins
 Set<PluginsTracker.PluginInfo> getInvolvedPluginKeys()
           
 String getStateHashCode()
          Return a hash that represents all the plugins in this tracker.
 boolean isPluginInvolved(com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
          Returns true if the plugin that this ModuleDescriptor belongs to is being tracked
 boolean isPluginInvolved(com.atlassian.plugin.Plugin plugin)
          Returns true if the plugin is being tracked
 boolean isPluginWithModuleDescriptor(com.atlassian.plugin.ModuleDescriptor moduleDescriptor, Class<? extends com.atlassian.plugin.ModuleDescriptor> targetModuleClass)
          Returns true if the plugin pointed to by the moduleDescriptor contains in it a 1 or modules with the target module descriptor class.
 boolean isPluginWithModuleDescriptor(com.atlassian.plugin.Plugin plugin, Class<? extends com.atlassian.plugin.ModuleDescriptor> targetModuleClass)
          Returns true if the plugin pointed to by the moduleDescriptor contains in it a 1 or module descriptors with the target module descriptor class.
 boolean isPluginWithResourceType(com.atlassian.plugin.ModuleDescriptor moduleDescriptor, String pluginResourceType)
          Returns true if the underlying plugin contains resources of the specified type, for example "i18n" resource types
 boolean isPluginWithResourceType(com.atlassian.plugin.Plugin plugin, String pluginResourceType)
          Returns true if the plugin contains resources of the specified type, for example "i18n" resource types
 String toString()
           
 void trackInvolvedPlugin(com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
          Tracks a plugin as being involved via it's ModuleDescriptor
 void trackInvolvedPlugin(com.atlassian.plugin.Plugin plugin)
          Tracks a plugin as being involved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimplePluginsTracker

public SimplePluginsTracker()
Method Detail

trackInvolvedPlugin

public void trackInvolvedPlugin(com.atlassian.plugin.Plugin plugin)
Description copied from interface: PluginsTracker
Tracks a plugin as being involved

Specified by:
trackInvolvedPlugin in interface PluginsTracker
Parameters:
plugin - the plugin in play

trackInvolvedPlugin

public void trackInvolvedPlugin(com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
Description copied from interface: PluginsTracker
Tracks a plugin as being involved via it's ModuleDescriptor

Specified by:
trackInvolvedPlugin in interface PluginsTracker
Parameters:
moduleDescriptor - the ModuleDescriptor of the plugin in play

isPluginInvolved

public boolean isPluginInvolved(com.atlassian.plugin.Plugin plugin)
Description copied from interface: PluginsTracker
Returns true if the plugin is being tracked

Specified by:
isPluginInvolved in interface PluginsTracker
Parameters:
plugin - the plugin in play
Returns:
true if the underlying plugin is being tracked

isPluginInvolved

public boolean isPluginInvolved(com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
Description copied from interface: PluginsTracker
Returns true if the plugin that this ModuleDescriptor belongs to is being tracked

Specified by:
isPluginInvolved in interface PluginsTracker
Parameters:
moduleDescriptor - the ModuleDescriptor of the plugin in play
Returns:
true if the underlying plugin is being tracked

isPluginWithModuleDescriptor

public boolean isPluginWithModuleDescriptor(com.atlassian.plugin.ModuleDescriptor moduleDescriptor,
                                            Class<? extends com.atlassian.plugin.ModuleDescriptor> targetModuleClass)
Description copied from interface: PluginsTracker
Returns true if the plugin pointed to by the moduleDescriptor contains in it a 1 or modules with the target module descriptor class.

Specified by:
isPluginWithModuleDescriptor in interface PluginsTracker
Parameters:
moduleDescriptor - the module descriptor in play (typically from a plugin event)
targetModuleClass - the target capabilities you want to test
Returns:
true if the underlying plugin has the designed module descriptor class

isPluginWithModuleDescriptor

public boolean isPluginWithModuleDescriptor(com.atlassian.plugin.Plugin plugin,
                                            Class<? extends com.atlassian.plugin.ModuleDescriptor> targetModuleClass)
Description copied from interface: PluginsTracker
Returns true if the plugin pointed to by the moduleDescriptor contains in it a 1 or module descriptors with the target module descriptor class.

Specified by:
isPluginWithModuleDescriptor in interface PluginsTracker
Parameters:
plugin - the plugin play (typically from a plugin event)
targetModuleClass - the target capabilities you want to test
Returns:
true if the underlying plugin has the designed module descriptor class

isPluginWithResourceType

public boolean isPluginWithResourceType(com.atlassian.plugin.Plugin plugin,
                                        String pluginResourceType)
Description copied from interface: PluginsTracker
Returns true if the plugin contains resources of the specified type, for example "i18n" resource types

Specified by:
isPluginWithResourceType in interface PluginsTracker
Parameters:
plugin - the plugin play (typically from a plugin event)
pluginResourceType - the descriptive name of the resource type (for example "i18n")
Returns:
true if the plugin cvontains resources of the specified type

isPluginWithResourceType

public boolean isPluginWithResourceType(com.atlassian.plugin.ModuleDescriptor moduleDescriptor,
                                        String pluginResourceType)
Description copied from interface: PluginsTracker
Returns true if the underlying plugin contains resources of the specified type, for example "i18n" resource types

Specified by:
isPluginWithResourceType in interface PluginsTracker
Parameters:
moduleDescriptor - the module descriptor of the plugin play (typically from a plugin event)
pluginResourceType - the descriptive name of the resource type (for example "i18n")
Returns:
true if the plugin cvontains resources of the specified type

getInvolvedPluginKeys

public Set<PluginsTracker.PluginInfo> getInvolvedPluginKeys()
Specified by:
getInvolvedPluginKeys in interface PluginsTracker
Returns:
a copy of the underlying tracked plugin keys

clear

public void clear()
Description copied from interface: PluginsTracker
Clear the underlying set of tracked plugins

Specified by:
clear in interface PluginsTracker

getStateHashCode

public String getStateHashCode()
Description copied from interface: PluginsTracker
Return a hash that represents all the plugins in this tracker. This hash should change if the list of plugins being tracked changes. It is used to help generate a cache busting WebResource URL prefix. That is, if this hash changes then it is likely that the URLs to all of JIRA's WebResources will change which will force all browsers to request all resources again.

Specified by:
getStateHashCode in interface PluginsTracker
Returns:
Return a hash that represents all the plugins in this tracker.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2014 Atlassian. All Rights Reserved.