Interface StoredPluginState


public interface StoredPluginState
A snapshot of persistent state data for all plugins -- whether the plugin has been disabled by the user, and whether anything special is to happen on restart. This class does not know whether a Plugin has successfully started -- it is just reporting whether the plugin has been explicitly disabled. The methods on this interface were pulled up from PluginPersistentState
Since:
5.1.0
  • Method Details

    • getStatesMap

      Map<String,PluginEnabledState> getStatesMap()
      Get the map of all states with the update timestamp for each of them. If the plugin or module has no entry in the Map, then it is in the default state.
      Returns:
      a map of plugins and modules' keys to their stored state
    • isEnabled

      boolean isEnabled(Plugin plugin)
      Whether or not a plugin is enabled, calculated from its persisted state AND default state. The default state is 'enabled' unless there is a disabled='true' attribute in atlassian-plugin.xml, or the minimum java-version specified in atlassian-plugin.xml is higher than the version we are running in. This does not report whether the plugin has successfully started -- use PluginAccessor for that information.
    • isEnabled

      boolean isEnabled(ModuleDescriptor<?> pluginModule)
      Whether or not a given plugin module is enabled, calculated from its persisted state AND default state. The default state is 'enabled' unless there is a disabled='true' attribute in atlassian-plugin.xml, or the minimum java-version specified in atlassian-plugin.xml is higher than the version we are running in. This does not report whether the plugin has successfully started -- use PluginAccessor for that information.
    • getPluginEnabledStateMap

      Map<String,PluginEnabledState> getPluginEnabledStateMap(Plugin plugin)
      Get state map of the given plugin and its modules. If the plugin or module has no entry in the Map, then it is in the default state.
      Parameters:
      plugin - the plugin
      Returns:
      a map of plugin and module keys to their stored state
    • getPluginRestartState

      PluginRestartState getPluginRestartState(String pluginKey)
      Gets whether the plugin is expected to be upgraded, installed, or removed on next restart.
      Parameters:
      pluginKey - The plugin to query
      Returns:
      The state of the plugin on restart