Package net.shibboleth.profile.plugin
Class PropertyDrivenPlugin<T extends Module>
java.lang.Object
net.shibboleth.profile.plugin.AbstractPlugin<T>
net.shibboleth.profile.plugin.PropertyDrivenPlugin<T>
- Type Parameters:
T- module type
- All Implemented Interfaces:
Plugin<T>
public abstract class PropertyDrivenPlugin<T extends Module>
extends AbstractPlugin<T>
implements Plugin<T>
Implementation of
Plugin relying on Java Properties.- Since:
- 4.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classImplementation ofPlugin.Packagefor our use.Nested classes/interfaces inherited from interface net.shibboleth.profile.plugin.Plugin
Plugin.Package -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault name of plugin properties resource.private org.slf4j.LoggerClass logger.Module source URLs.static final StringProperty for plugin ID.static final StringProperty for plugin license.static final StringPrefix of property for plugin module URL.static final StringPostfix for the destination package properties.static final StringPostfix for the non-windows package properties.static final StringPrefix for the properties for plugin's packages.static final StringPostfix for the source package properties.static final StringPostfix for the non-windows package properties.static final StringPostfix for the windows package properties.static final StringProperty for plugin's required modules.static final StringPrefix of property for plugin update URL.static final StringProperty for plugin version.private StringNon-defaulted plugin ID.private final PropertiesProperties describing plugin.private InstallableComponentVersionHandles parsing of plugin version.Required modules.Plugin update URLs. -
Constructor Summary
ConstructorsConstructorDescriptionPropertyDrivenPlugin(InputStream inputStream) Constructor.PropertyDrivenPlugin(Class<? extends Plugin<T>> claz) Constructor.PropertyDrivenPlugin(Properties properties) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionProvides default module info locations to use.Provides default update locations to use.Return the classpath location of the license file to emit when --license is specified.intReturn the major version, (as defined by the Java Product Version Policy.intReturn the minor version, (as defined by the Java Product Version Policy.Return the places to look for information for the modules this plugin may require The format of the (property) file at this location is fixed.intReturn The patch version, (as defined by the Java Product Version Policy.Return the unique identifier for the plugin.Get the IDs of anyModules required for installation of this plugin.Return the places to look for information for this plugin package.protected voidload()Load plugin information from properties.Methods inherited from class net.shibboleth.profile.plugin.AbstractPlugin
equals, getDisableOnRemoval, getEnableOnInstall, getPackages, hashCode, setDisableOnRemoval, setEnableOnInstall, setPackages, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.shibboleth.profile.plugin.Plugin
getDisableOnRemoval, getEnableOnInstall, getPackages
-
Field Details
-
DEFAULT_RESOURCE
Default name of plugin properties resource.- See Also:
-
PLUGIN_ID_PROPERTY
Property for plugin ID.- See Also:
-
PLUGIN_VERSION_PROPERTY
Property for plugin version.- See Also:
-
PLUGIN_LICENSE_PROPERTY
Property for plugin license.- See Also:
-
PLUGIN_URL_PROPERTY
Prefix of property for plugin update URL.- See Also:
-
PLUGIN_MODULE_URL_PROPERTY
Prefix of property for plugin module URL.- See Also:
-
PLUGIN_REQ_MODULES_PROPERTY
Property for plugin's required modules.- See Also:
-
PLUGIN_PACKAGE_PROPERTY
Prefix for the properties for plugin's packages.- See Also:
-
PLUGIN_PACKAGE_SOURCE_PROPERTY
Postfix for the source package properties.- See Also:
-
PLUGIN_PACKAGE_DESTNATION_PROPERTY
Postfix for the destination package properties.- See Also:
-
PLUGIN_PACKAGE_WINDOWS_PROPERTY
Postfix for the windows package properties. Default true.- See Also:
-
PLUGIN_PACKAGE_NONWINDOWS_PROPERTY
Postfix for the non-windows package properties. Default true.- See Also:
-
PLUGIN_PACKAGE_STRIP_TLD_PROPERTY
Postfix for the non-windows package properties. Default true.- See Also:
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
pluginProperties
Properties describing plugin. -
pluginId
Non-defaulted plugin ID. -
pluginVersion
Handles parsing of plugin version. -
updateURLs
Plugin update URLs. -
moduleSourceURLs
Module source URLs. -
requiredModules
Required modules.
-
-
Constructor Details
-
PropertyDrivenPlugin
public PropertyDrivenPlugin(@Nonnull Class<? extends Plugin<T>> claz) throws IOException, PluginException Constructor.- 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
-
PropertyDrivenPlugin
Constructor.- Parameters:
inputStream- property stream- Throws:
IOException- if unable to read filePluginException- if the plugin is not in a valid state
-
PropertyDrivenPlugin
Constructor.- Parameters:
properties- property set- Throws:
PluginException- if the plugin is not in a valid state
-
-
Method Details
-
load
Load plugin information from properties.- Throws:
PluginException- on errors
-
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 interfacePlugin<T extends Module>- Overrides:
getPluginIdin classAbstractPlugin<T extends Module>- Returns:
- The id of this plugin.
-
getUpdateURLs
Return the places to look for information for this plugin package. The format of the (property) file at this location is fixed.- Specified by:
getUpdateURLsin interfacePlugin<T extends Module>- Returns:
- Zero or more URLs
-
getModuleInfoSources
Return the places to look for information for the modules this plugin may require The format of the (property) file at this location is fixed. modules.id.plugin=PluginIdRequired modules.id.version=VersionOfPlugin- Specified by:
getModuleInfoSourcesin interfacePlugin<T extends Module>- Returns:
- Zero or more URLs
-
getRequiredModules
Get the IDs of anyModules required for installation of this plugin.- Specified by:
getRequiredModulesin interfacePlugin<T extends Module>- Overrides:
getRequiredModulesin classAbstractPlugin<T extends Module>- Returns:
- module IDs that are required
-
getLicenseFileLocation
Return the classpath location of the license file to emit when --license is specified.- Specified by:
getLicenseFileLocationin interfacePlugin<T extends Module>- Overrides:
getLicenseFileLocationin classAbstractPlugin<T extends Module>- Returns:
- the location
-
getMajorVersion
Return the major version, (as defined by the Java Product Version Policy.- Specified by:
getMajorVersionin interfacePlugin<T extends Module>- Returns:
- The major version.
-
getMinorVersion
Return the minor version, (as defined by the Java Product Version Policy.- Specified by:
getMinorVersionin interfacePlugin<T extends Module>- Returns:
- The minor version.
-
getPatchVersion
Return The patch version, (as defined by the Java Product Version Policy.- Specified by:
getPatchVersionin interfacePlugin<T extends Module>- Overrides:
getPatchVersionin classAbstractPlugin<T extends Module>- Returns:
- The patch version.
-
getDefaultUpdateURLs
Provides default update locations to use.- Returns:
- default update locations
- Throws:
PluginException- if a derived class throws it (see derived classes)
-
getDefaultModuleInfoSources
@Nonnull @Unmodifiable @NotLive protected List<URL> getDefaultModuleInfoSources() throws PluginExceptionProvides default module info locations to use.- Returns:
- default module locations
- Throws:
PluginException- if a derived class throws it (see derived classes)
-