Class PluginInfo


  • public class PluginInfo
    extends Object
    Class which encapsulates the information about a given plugin as downloaded fro the plugin URL (or file).
    • Field Detail

      • SPACE_CONTAINING

        private static final Pattern SPACE_CONTAINING
        regexp for spaces.
      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • pluginId

        @Nonnull
        private final String pluginId
        The pluginId.
      • allInfoPresent

        private boolean allInfoPresent
        Whether the information was sufficient.
    • Constructor Detail

      • PluginInfo

        public PluginInfo​(String id,
                          Properties props)
        Constructor.
        Parameters:
        id - the id we care about
        props - all the properties.
    • Method Detail

      • isInfoComplete

        public boolean isInfoComplete()
        Did the property file have enough information?
        Returns:
        true if something was missing.
      • getUpdateURL

        @Nullable
        public URL getUpdateURL​(PluginVersion version)
        Get the base URL for this version.
        Parameters:
        version - which version
        Returns:
        the base URL
      • getUpdateBaseName

        @Nullable
        public String getUpdateBaseName​(PluginVersion version)
        Get the base Name for this version.
        Parameters:
        version - which version
        Returns:
        the base name
      • parse

        private void parse​(@Nonnull
                           Properties props)
        (try to) populate the information about this plugin.
        Parameters:
        props - what to load.
      • handleAvailableVersion

        private void handleAvailableVersion​(Properties props,
                                            String version)
        Given a version find out more.
        Parameters:
        props - the property files for this plugin we are looking at
        version - the version in question.
      • handleAvailableVersions

        private void handleAvailableVersions​(Properties props,
                                             String availableVersions)
        Given a list of versions find out more.
        Parameters:
        props - the property files for this plugin we are looking at
        availableVersions - a space delimited array of versions
      • getDefaultedValue

        @Nullable
        private String getDefaultedValue​(Properties props,
                                         String interfix,
                                         String version)
        Look up the key derived from the pluginId, the interfix and the version, but if that fails look for a templated definition.
        Parameters:
        props - what to look in
        interfix - the interface (between the ID and the version)
        version - the version.
        Returns:
        the suitable value
      • isSupportedWithIdPVersion

        public boolean isSupportedWithIdPVersion​(PluginVersion pluginVersion,
                                                 PluginVersion idPVersion)
        Is the specified plugin supported with this IdP version.
        Parameters:
        pluginVersion - the version if the plugin as a PluginVersion
        idPVersion - the version if the IDP as a PluginVersion
        Returns:
        whether it is supported.
      • isSupportedWithIdPVersion

        public static boolean isSupportedWithIdPVersion​(PluginState.VersionInfo pluginVersionInfo,
                                                        PluginVersion idPVersion)
        Is the specified plugin supported with this IdP version. Worker method for all 'isSupportedWith' classes.
        Parameters:
        pluginVersionInfo - the version info to consider
        idPVersion - the version as a PluginVersion
        Returns:
        whether it is supported.