I am able to store the configuration data in pluginsettings factory.
But I am unable to read it in my scheduler task code, Could you please guide me to fix this?
My code is here
@Scanned
public class ScheduledTask implements PluginJob {
private static final String PLUGIN_STORAGE_KEY = "com.jiradev.jira.plugins.dsconfigadmin";
//private static PluginSettingsFactory pluginSettingsFactory = null;
@ComponentImport
private final PluginSettingsFactory pluginSettingsFactory;
@Inject
public ScheduledTask(PluginSettingsFactory pluginSettingsFactory)
{
this.pluginSettingsFactory = pluginSettingsFactory;
}
public void execute(Map jobDataMap) {
PluginSettings pluginSettings = pluginSettingsFactory.createGlobalSettings();
System.out.println("Scheduler API Key: " + pluginSettings.get(PLUGIN_STORAGE_KEY + ".api_key") );
...
...
...
I am able to get the pluginsettings using the below code.
PluginSettingsFactory pluginSettingsFactory = ComponentAccessor.getOSGiComponentInstanceOfType(PluginSettingsFactory.class);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.