3 Replies Latest reply on Dec 16, 2013 1:13 PM by Amy Wu

    Is it possible to programmatically update plugin configuration within ResourceComponent?

    Amy Wu Newbie

      Is there some way to update plugin configuration within a ResourceComponent and have the values persisted to the database so that when the user pulls up the Connection Settings page, they are able to see the updated value?

       

      We are noticing that if we call getPluginConfiguration() from our ResourceContext and then call setSimpleValue, we are not seeing the updated value on the Connection Settings page.  Also, if we call getPluginConfiguration() again from ResourceContext, we are not getting back the value we just set.

        • 1. Re: Is it possible to programmatically update plugin configuration within ResourceComponent?
          Elias Ross Master

          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.

          1 of 1 people found this helpful
          • 2. Re: Is it possible to programmatically update plugin configuration within ResourceComponent?
            jay shaughnessy Expert

            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?

            • 3. Re: Is it possible to programmatically update plugin configuration within ResourceComponent?
              Amy Wu Newbie

              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.