public interface

PluginPersistentState

com.atlassian.plugin.manager.PluginPersistentState
Known Indirect Subclasses

Class Overview

Interface that represents a configuration state for plugins and plugin modules. The configuration state (enabled or disabled) is separate from the plugins and modules themselves because a plugin may have multiple states depending on the context.

Summary

Nested Classes
class PluginPersistentState.Builder Builder for PluginPersistentState instances. 
class PluginPersistentState.Util  
Public Methods
abstract Map<StringBoolean> getMap()
Get the map of all states.
abstract PluginRestartState getPluginRestartState(String pluginKey)
Gets whether the plugin is expected to be upgraded, installed, or removed on next restart
abstract Map<StringBoolean> getPluginStateMap(Plugin plugin)
Get state map of the given plugin and its modules
abstract boolean isEnabled(Plugin plugin)
Whether or not a plugin is enabled, calculated from it's current state AND default state.
abstract boolean isEnabled(ModuleDescriptor<?> pluginModule)
Whether or not a given plugin module is enabled in this state, calculated from it's current state AND default state.

Public Methods

public abstract Map<StringBoolean> getMap ()

Get the map of all states.

Returns
  • The map that maps plugins and modules' keys to a state (Boolean.True/Boolean.False). State stored in this map represents only the differences between the current state and the default state configured in the plugin(module).

public abstract 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

public abstract Map<StringBoolean> getPluginStateMap (Plugin plugin)

Get state map of the given plugin and its modules

Returns
  • The map that maps the plugin and its modules' keys to plugin state (Boolean.TRUE/Boolean.FALSE). State stored in this map represents only the differences between the current state and the default state configured in the plugin(module).

public abstract boolean isEnabled (Plugin plugin)

Whether or not a plugin is enabled, calculated from it's current state AND default state.

public abstract boolean isEnabled (ModuleDescriptor<?> pluginModule)

Whether or not a given plugin module is enabled in this state, calculated from it's current state AND default state.