Class PluginInfo
- java.lang.Object
-
- net.shibboleth.idp.installer.plugin.impl.PluginInfo
-
public class PluginInfo extends Object
Class which encapsulates the information about a given plugin as downloaded fro the plugin URL (or file).
-
-
Field Summary
Fields Modifier and Type Field Description private booleanallInfoPresentWhether the information was sufficient.private Map<PluginVersion,Pair<URL,String>>downloadInfoThe Download information.private org.slf4j.LoggerlogClass logger.private StringpluginIdThe pluginId.private static PatternSPACE_CONTAININGregexp for spaces.private Map<PluginVersion,PluginState.VersionInfo>versionInfoThe support information.
-
Constructor Summary
Constructors Constructor Description PluginInfo(String id, Properties props)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<PluginVersion,PluginState.VersionInfo>getAvailableVersions()Get the raw version imfo for this plugin.private StringgetDefaultedValue(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.StringgetUpdateBaseName(PluginVersion version)Get the base Name for this version.URLgetUpdateURL(PluginVersion version)Get the base URL for this version.private voidhandleAvailableVersion(Properties props, String version)Given a version find out more.private voidhandleAvailableVersions(Properties props, String availableVersions)Given a list of versions find out more.booleanisInfoComplete()Did the property file have enough information?static booleanisSupportedWithIdPVersion(PluginState.VersionInfo pluginVersionInfo, PluginVersion idPVersion)Is the specified plugin supported with this IdP version.booleanisSupportedWithIdPVersion(PluginVersion pluginVersion, PluginVersion idPVersion)Is the specified plugin supported with this IdP version.private voidparse(Properties props)(try to) populate the information about this plugin.
-
-
-
Field Detail
-
SPACE_CONTAINING
private static final Pattern SPACE_CONTAINING
regexp for spaces.
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
versionInfo
@Nonnull private final Map<PluginVersion,PluginState.VersionInfo> versionInfo
The support information.
-
downloadInfo
@Nonnull private final Map<PluginVersion,Pair<URL,String>> downloadInfo
The Download information.
-
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 aboutprops- 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
-
getAvailableVersions
public Map<PluginVersion,PluginState.VersionInfo> getAvailableVersions()
Get the raw version imfo for this plugin.- Returns:
- the info.
-
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 atversion- 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 atavailableVersions- 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 ininterfix- 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 aPluginVersionidPVersion- the version if the IDP as aPluginVersion- 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 consideridPVersion- the version as aPluginVersion- Returns:
- whether it is supported.
-
-