public final class

DefaultPluginPersistentState

extends Object
implements PluginPersistentState Serializable
java.lang.Object
   ↳ com.atlassian.plugin.manager.DefaultPluginPersistentState

Class Overview

Immutable implementation of the PluginPersistentState interface.

The state stored in this object represents only the differences between the desired state and the default state configured in the plugin. So if "getPluginState()" or "getPluginModuleState()" return null, then the manager should assume that the default state applies instead.

Summary

Public Constructors
DefaultPluginPersistentState()
This constructor is deprecated. create PluginPersistentState instances using the PluginPersistentState.Builder
DefaultPluginPersistentState(Map<StringBoolean> map)
This constructor is deprecated. create PluginPersistentState instances using the PluginPersistentState.Builder
DefaultPluginPersistentState(PluginPersistentState state)
Copy constructor.
Public Methods
Map<StringBoolean> getMap()
Get the map of all states.
PluginRestartState getPluginRestartState(String pluginKey)
Gets whether the plugin is expected to be upgraded, installed, or removed on next restart
Map<StringBoolean> getPluginStateMap(Plugin plugin)
Get state map of the given plugin and its modules
boolean isEnabled(Plugin plugin)
Whether or not a plugin is enabled, calculated from it's current state AND default state.
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.plugin.manager.PluginPersistentState

Public Constructors

public DefaultPluginPersistentState ()

This constructor is deprecated.
create PluginPersistentState instances using the PluginPersistentState.Builder

Creates an empty PluginPersistentState.

public DefaultPluginPersistentState (Map<StringBoolean> map)

This constructor is deprecated.
create PluginPersistentState instances using the PluginPersistentState.Builder

Creates a PluginPersistentState with the supplied states.

Parameters
map of the plugin states using the getKey() as the key.

public DefaultPluginPersistentState (PluginPersistentState state)

Copy constructor. Doesn't make sense to use as the map is immutable. Just use the

Public Methods

public 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 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 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 boolean isEnabled (Plugin plugin)

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

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