public boolean syncPlugins ( NewRelicCache cache ) { boolean ret = true ; if ( apiClient == null ) throw new IllegalArgumentException ( "null API client" ) ; // Get the Plugins configuration using the REST API if ( cache . isPluginsEnabled ( ) ) { ret = false ; logger . info ( "Getting the plugins" ) ; Collection < Plugin > plugins = apiClient . plugins ( ) . list ( true ) ; for ( Plugin plugin : plugins ) { cache . plugins ( ) . add ( plugin ) ; logger . fine ( "Getting the components for plugin: " + plugin . getId ( ) ) ; Collection < PluginComponent > components = apiClient . pluginComponents ( ) . list ( PluginComponentService . filters ( ) . pluginId ( plugin . getId ( ) ) . build ( ) ) ; cache . plugins ( ) . components ( plugin . getId ( ) ) . add ( components ) ; } cache . setUpdatedAt ( ) ; ret = true ; } return ret ; }
Synchronise the Plugins configuration with the cache .