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 Classes
Modifier and Type
Class
Description
`private static class`
`PropertyDrivenPlugin.PackageDescriptor`
Implementation of `Plugin.Package` for our use.

## Nested classes/interfaces inherited from interface net.shibboleth.profile.plugin.Plugin

`Plugin.Package`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DEFAULT_RESOURCE`
Default name of plugin properties resource.
`private org.slf4j.Logger`
`log`
Class logger.
`private List<URL>`
`moduleSourceURLs`
Module source URLs.
`static final String`
`PLUGIN_ID_PROPERTY`
Property for plugin ID.
`static final String`
`PLUGIN_LICENSE_PROPERTY`
Property for plugin license.
`static final String`
`PLUGIN_MODULE_URL_PROPERTY`
Prefix of property for plugin module URL.
`static final String`
`PLUGIN_PACKAGE_DESTNATION_PROPERTY`
Postfix for the destination package properties.
`static final String`
`PLUGIN_PACKAGE_NONWINDOWS_PROPERTY`
Postfix for the non-windows package properties.
`static final String`
`PLUGIN_PACKAGE_PROPERTY`
Prefix for the properties for plugin's packages.
`static final String`
`PLUGIN_PACKAGE_SOURCE_PROPERTY`
Postfix for the source package properties.
`static final String`
`PLUGIN_PACKAGE_STRIP_TLD_PROPERTY`
Postfix for the non-windows package properties.
`static final String`
`PLUGIN_PACKAGE_WINDOWS_PROPERTY`
Postfix for the windows package properties.
`static final String`
`PLUGIN_REQ_MODULES_PROPERTY`
Property for plugin's required modules.
`static final String`
`PLUGIN_URL_PROPERTY`
Prefix of property for plugin update URL.
`static final String`
`PLUGIN_VERSION_PROPERTY`
Property for plugin version.
`private String`
`pluginId`
Non-defaulted plugin ID.
`private final Properties`
`pluginProperties`
Properties describing plugin.
`private InstallableComponentVersion`
`pluginVersion`
Handles parsing of plugin version.
`private Set<String>`
`requiredModules`
Required modules.
`private List<URL>`
`updateURLs`
Plugin update URLs.

## Constructor Summary

Constructors
Constructor
Description
`PropertyDrivenPlugin(InputStream inputStream)`
Constructor.
`PropertyDrivenPlugin(Class<? extends Plugin<T>> claz)`
Constructor.
`PropertyDrivenPlugin(Properties properties)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected List<URL>`
`getDefaultModuleInfoSources()`
Provides default module info locations to use.
`protected List<URL>`
`getDefaultUpdateURLs()`
Provides default update locations to use.
`String`
`getLicenseFileLocation()`
Return the classpath location of the license file to emit when --license is specified.
`int`
`getMajorVersion()`
Return the major version, (as defined by the Java Product Version Policy.
`int`
`getMinorVersion()`
Return the minor version, (as defined by the Java Product Version Policy.
`List<URL>`
`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.
`int`
`getPatchVersion()`
Return The patch version, (as defined by the Java Product Version Policy.
`String`
`getPluginId()`
Return the unique identifier for the plugin.
`Set<String>`
`getRequiredModules()`
Get the IDs of any `Module`s required for installation of this plugin.
`List<URL>`
`getUpdateURLs()`
Return the places to look for information for this plugin package.
`protected void`
`load()`
Load plugin information from properties.

### Methods inherited from class net.shibboleth.profile.plugin.AbstractPlugin

`equals, getDisableOnRemoval, getEnableOnInstall, getPackages, hashCode, setDisableOnRemoval, setEnableOnInstall, setPackages, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface net.shibboleth.profile.plugin.Plugin

`getDisableOnRemoval, getEnableOnInstall, getPackages`

## Field Details

### 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_MODULE_URL_PROPERTY

@Nonnull @NotEmpty public static final String PLUGIN_MODULE_URL_PROPERTY
Prefix of property for plugin module 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

### PLUGIN_PACKAGE_PROPERTY

@Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_PROPERTY
Prefix for the properties for plugin's packages.

See Also:
  - Constant Field Values

### PLUGIN_PACKAGE_SOURCE_PROPERTY

@Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_SOURCE_PROPERTY
Postfix for the source package properties.

See Also:
  - Constant Field Values

### PLUGIN_PACKAGE_DESTNATION_PROPERTY

@Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_DESTNATION_PROPERTY
Postfix for the destination package properties.

See Also:
  - Constant Field Values

### PLUGIN_PACKAGE_WINDOWS_PROPERTY

@Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_WINDOWS_PROPERTY
Postfix for the windows package properties. Default true.

See Also:
  - Constant Field Values

### PLUGIN_PACKAGE_NONWINDOWS_PROPERTY

@Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_NONWINDOWS_PROPERTY
Postfix for the non-windows package properties. Default true.

See Also:
  - Constant Field Values

### PLUGIN_PACKAGE_STRIP_TLD_PROPERTY

@Nonnull @NotEmpty public static final String PLUGIN_PACKAGE_STRIP_TLD_PROPERTY
Postfix for the non-windows package properties. Default true.

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 InstallableComponentVersion pluginVersion
Handles parsing of plugin version.

### updateURLs

@Nonnull private List<URL> updateURLs
Plugin update URLs.

### moduleSourceURLs

@Nonnull private List<URL> moduleSourceURLs
Module source URLs.

### requiredModules

@Nonnull private Set<String> 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 file
  `PluginException` - if the plugin is not in a valid state

### PropertyDrivenPlugin

public PropertyDrivenPlugin(@Nonnull InputStream inputStream) throws IOException, PluginException
Constructor.

Parameters:
  `inputStream` - property stream
Throws:
  `IOException` - if unable to read file
  `PluginException` - if the plugin is not in a valid state

### PropertyDrivenPlugin

public PropertyDrivenPlugin(@Nonnull Properties properties) throws PluginException
Constructor.

Parameters:
  `properties` - property set
Throws:
  `PluginException` - if the plugin is not in a valid state

## Method Details

### load

protected void load() throws PluginException
Load 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

For instance `org.example.plugins.myplugin`

Specified by:
  `getPluginId` in interface `Plugin<T extends Module>`
Overrides:
  `getPluginId` in class `AbstractPlugin<T extends Module>`
Returns:
  The id of this plugin.

### getUpdateURLs

@Nonnull @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.

Specified by:
  `getUpdateURLs` in interface `Plugin<T extends Module>`
Returns:
  Zero or more URLs

### getModuleInfoSources

@Nonnull @Unmodifiable @NotLive public List<URL> 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:
  `getModuleInfoSources` in interface `Plugin<T extends Module>`
Returns:
  Zero or more URLs

### getRequiredModules

@Nonnull @Unmodifiable @NotLive public Set<String> getRequiredModules()
Get the IDs of any `Module`s required for installation of this plugin.

Specified by:
  `getRequiredModules` in interface `Plugin<T extends Module>`
Overrides:
  `getRequiredModules` in class `AbstractPlugin<T extends Module>`
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:
  `getLicenseFileLocation` in interface `Plugin<T extends Module>`
Overrides:
  `getLicenseFileLocation` in class `AbstractPlugin<T extends Module>`
Returns:
  the location

### getMajorVersion

@NonNegative public int getMajorVersion()
Return the major version, (as defined by the Java Product Version Policy.

Specified by:
  `getMajorVersion` in interface `Plugin<T extends Module>`
Returns:
  The major version.

### getMinorVersion

@NonNegative public int getMinorVersion()
Return the minor version, (as defined by the Java Product Version Policy.

Specified by:
  `getMinorVersion` in interface `Plugin<T extends Module>`
Returns:
  The minor version.

### getPatchVersion

@NonNegative public int getPatchVersion()
Return The patch version, (as defined by the Java Product Version Policy.

Specified by:
  `getPatchVersion` in interface `Plugin<T extends Module>`
Overrides:
  `getPatchVersion` in class `AbstractPlugin<T extends Module>`
Returns:
  The patch version.

### getDefaultUpdateURLs

@Nonnull @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)

### getDefaultModuleInfoSources

@Nonnull @Unmodifiable @NotLive protected List<URL> getDefaultModuleInfoSources() throws PluginException
Provides default module info locations to use.

Returns:
  default module locations
Throws:
  `PluginException` - if a derived class throws it (see derived classes)