1 of 1 people found this helpful
As far as I know, there's no way to change a plugin configuration on the agent side. There is a facet called 'ConfigurationFacet' which allows the plugin to provide the underlying resource's configuration and apply updates. The difference between plugin and resource configuration is sort of subtle.
The plugin configuration (aka connection settings) are not typically changed from the plugin code after being set during discovery. The writable settings can be changed via the GUI. And remote clients (like the CLI) can manipulate things via the remote API.
There is one exception, there is a way to update plugin config during resource upgrade. This is code that executes when the plugin is updated, in case the updated version needs to change some things, like resource naming, or in this case, plugin config settings. I'm not sure if this helps your situation. What is your motivation?
Our plugin extends the JMX plugin and in Connection Settings, rather than having the user input a connector address, we plan on having the user input port, protocol, and maybe hostname. And based on this info, we generate the connector address. And ideally, we would like to then push the connector address back out to the plugin config so that when the user views Connection Settings again, they can see the connector address that was generated/is being used. Also, based on which server version a user selects in Connection Settings, we want to add additional classpath library entries when we make our jmx remote connection. And we would like to store this in the plugin config as well to display to the user.
Since we are unable to store plugin configs, as a workaround, we'll just regenerate the library and connector address entries every time the server component stops/restarts since that is what apparently occurs whenever a user saves the Connection Settings, but the user will just not be able to see the entries we are actually setting.