Package net.shibboleth.idp.plugin
Class PropertyDrivenIdPPlugin
- java.lang.Object
-
- net.shibboleth.idp.plugin.AbstractIdPPlugin
-
- net.shibboleth.idp.plugin.PropertyDrivenIdPPlugin
-
- All Implemented Interfaces:
IdPPlugin
- Direct Known Subclasses:
FirstPartyIdPPlugin
public abstract class PropertyDrivenIdPPlugin extends AbstractIdPPlugin
Implementation ofIdPPluginrelying on JavaProperties.- Since:
- 4.1.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_RESOURCEDefault name of plugin properties resource.private org.slf4j.LoggerlogClass logger.static StringPLUGIN_ID_PROPERTYProperty for plugin ID.static StringPLUGIN_LICENSE_PROPERTYProperty for plugin license.static StringPLUGIN_REQ_MODULES_PROPERTYProperty for plugin's required modules.static StringPLUGIN_URL_PROPERTYPrefix of property for plugin update URL.static StringPLUGIN_VERSION_PROPERTYProperty for plugin version.private StringpluginIdNon-defaulted plugin ID.private PropertiespluginPropertiesProperties describing plugin.private PluginVersionpluginVersionHandles parsing of plugin version.private Set<String>requiredModulesRequired modules.private List<URL>updateURLsPlugin update URLs.
-
Constructor Summary
Constructors Constructor Description PropertyDrivenIdPPlugin(InputStream inputStream)Constructor.PropertyDrivenIdPPlugin(Class<? extends IdPPlugin> claz)Constructor.PropertyDrivenIdPPlugin(Properties properties)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<URL>getDefaultUpdateURLs()Provides default update locations to use.StringgetLicenseFileLocation()Return the classpath location of the license file to emit when --license is specified.intgetMajorVersion()Return the major version, (as defined by the Java Product Version Policy.intgetMinorVersion()Return the minor version, (as defined by the Java Product Version Policy.intgetPatchVersion()Return The patch version, (as defined by the Java Product Version Policy.StringgetPluginId()Return the unique identifier for the plugin.Set<String>getRequiredModules()Get the IDs of anyIdPModules required for installation of this plugin.List<URL>getUpdateURLs()Return the places to look for information for this plugin package.protected voidload()Load plugin information from properties.-
Methods inherited from class net.shibboleth.idp.plugin.AbstractIdPPlugin
equals, getDisableOnRemoval, getEnableOnInstall, hashCode, setDisableOnRemoval, setEnableOnInstall, toString
-
-
-
-
Field Detail
-
DEFAULT_RESOURCE
@Nonnull @NotEmpty public static final String DEFAULT_RESOURCE
Default name of plugin properties resource.- See Also:
- Constant Field Values
-
PLUGIN_ID_PROPERTY
@Nonnull @NotEmpty public static final String PLUGIN_ID_PROPERTY
Property for plugin ID.- See Also:
- Constant Field Values
-
PLUGIN_VERSION_PROPERTY
@Nonnull @NotEmpty public static final String PLUGIN_VERSION_PROPERTY
Property for plugin version.- See Also:
- Constant Field Values
-
PLUGIN_LICENSE_PROPERTY
@Nonnull @NotEmpty public static final String PLUGIN_LICENSE_PROPERTY
Property for plugin license.- See Also:
- Constant Field Values
-
PLUGIN_URL_PROPERTY
@Nonnull @NotEmpty public static final String PLUGIN_URL_PROPERTY
Prefix of property for plugin update URL.- See Also:
- Constant Field Values
-
PLUGIN_REQ_MODULES_PROPERTY
@Nonnull @NotEmpty public static final String PLUGIN_REQ_MODULES_PROPERTY
Property for plugin's required modules.- See Also:
- Constant Field Values
-
log
@Nonnull private org.slf4j.Logger log
Class logger.
-
pluginProperties
@Nonnull private final Properties pluginProperties
Properties describing plugin.
-
pluginId
@Nullable private String pluginId
Non-defaulted plugin ID.
-
pluginVersion
@Nullable private PluginVersion pluginVersion
Handles parsing of plugin version.
-
updateURLs
@Nonnull @NonnullElements private List<URL> updateURLs
Plugin update URLs.
-
requiredModules
@Nonnull @NonnullElements private Set<String> requiredModules
Required modules.
-
-
Constructor Detail
-
PropertyDrivenIdPPlugin
public PropertyDrivenIdPPlugin(@Nonnull Class<? extends IdPPlugin> claz) throws IOException, PluginExceptionConstructor.- Parameters:
claz- type of object used to locate default module.properties resource- Throws:
IOException- if unable to read filePluginException- if the plugin is not in a valid state
-
PropertyDrivenIdPPlugin
public PropertyDrivenIdPPlugin(@Nonnull InputStream inputStream) throws IOException, PluginExceptionConstructor.- Parameters:
inputStream- property stream- Throws:
IOException- if unable to read filePluginException- if the plugin is not in a valid state
-
PropertyDrivenIdPPlugin
public PropertyDrivenIdPPlugin(@Nonnull Properties properties) throws PluginExceptionConstructor.- Parameters:
properties- property set- Throws:
PluginException- if the plugin is not in a valid state
-
-
Method Detail
-
load
protected void load() throws PluginExceptionLoad plugin information from properties.- Throws:
PluginException- on errors
-
getPluginId
@Nonnull @NotEmpty public String getPluginId()
Return the unique identifier for the plugin. This name MUST be- renderable in all file systems (for instance alphanumerics, '-' and '.' only)
- unique. This is best done using java module guidance
org.example.plugins.myplugin- Specified by:
getPluginIdin interfaceIdPPlugin- Overrides:
getPluginIdin classAbstractIdPPlugin- Returns:
- The id of this plugin.
-
getUpdateURLs
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<URL> getUpdateURLs()
Return the places to look for information for this plugin package. The format of the (property) file at this location is fixed.- Returns:
- Zero or more URLs
-
getRequiredModules
@Nonnull @NonnullElements @Unmodifiable @NotLive public Set<String> getRequiredModules()
Get the IDs of anyIdPModules required for installation of this plugin.- Specified by:
getRequiredModulesin interfaceIdPPlugin- Overrides:
getRequiredModulesin classAbstractIdPPlugin- Returns:
- module IDs that are required
-
getLicenseFileLocation
@Nullable public String getLicenseFileLocation()
Return the classpath location of the license file to emit when --license is specified.- Specified by:
getLicenseFileLocationin interfaceIdPPlugin- Overrides:
getLicenseFileLocationin classAbstractIdPPlugin- Returns:
- the location
-
getMajorVersion
@NonNegative public int getMajorVersion()
Return the major version, (as defined by the Java Product Version Policy.- Returns:
- The major version.
-
getMinorVersion
@NonNegative public int getMinorVersion()
Return the minor version, (as defined by the Java Product Version Policy.- Returns:
- The minor version.
-
getPatchVersion
@NonNegative public int getPatchVersion()
Return The patch version, (as defined by the Java Product Version Policy.- Specified by:
getPatchVersionin interfaceIdPPlugin- Overrides:
getPatchVersionin classAbstractIdPPlugin- Returns:
- The patch version.
-
getDefaultUpdateURLs
@Nonnull @NonnullElements @Unmodifiable @NotLive protected List<URL> getDefaultUpdateURLs() throws PluginException
Provides default update locations to use.- Returns:
- default update locations
- Throws:
PluginException- if a derived class throws it (see derived classes)
-
-