Package net.shibboleth.idp.module
Class PropertyDrivenIdPModule
java.lang.Object
net.shibboleth.idp.module.AbstractIdPModule
net.shibboleth.idp.module.PropertyDrivenIdPModule
- All Implemented Interfaces:
IdPModule
,Component
,IdentifiedComponent
- Direct Known Subclasses:
CoreIdPModule
,PluginIdPModule
Implementation of
IdPModule
relying on Java Properties
.- Since:
- 4.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class net.shibboleth.idp.module.AbstractIdPModule
AbstractIdPModule.BasicModuleResource
Nested classes/interfaces inherited from interface net.shibboleth.idp.module.IdPModule
IdPModule.ModuleResource, IdPModule.ResourceResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Default name of module properties resource.Available message locales.private org.slf4j.Logger
Class logger.static final String
Suffix of property for module description.static final String
Suffix of property for resource destination.static final String
Suffix of property for resource executability.static final String
Suffix of property for module languages.static final String
Suffix of property for module name.static final String
Suffix of property for resource optionality.static final String
Suffix of property for module plugin owner.static final String
Suffix of property for module post-disable message.static final String
Suffix of property for module post-enable message.static final String
Suffix of property for resource replacement.static final String
Suffix of property for resource source.static final String
Suffix of property for module URL.private String
Module ID.private String
Module name.private final Properties
Properties describing module.private String
Module URL.private String
Plugin ID.private boolean
Whether to require an HTTP client. -
Constructor Summary
ConstructorsConstructorDescriptionPropertyDrivenIdPModule
(InputStream inputStream) Constructor.PropertyDrivenIdPModule
(Class<? extends IdPModule> claz) Constructor.PropertyDrivenIdPModule
(Properties properties) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondisable
(ModuleContext moduleContext, boolean clean) Disable the module.enable
(ModuleContext moduleContext) Enable the module.getDescription
(ModuleContext moduleContext) Gets module description.getId()
getName
(ModuleContext moduleContext) Gets module name.Gets the plugin name of the module's owner, if the module is provided by a plugin.getURL()
Gets module URL.boolean
Gets whether module enablement requires access to anHttpClient
.protected void
load()
Load module information from properties.void
Set the module URL.Methods inherited from class net.shibboleth.idp.module.AbstractIdPModule
equals, getResources, hashCode, isEnabled, setResources, toString
-
Field Details
-
DEFAULT_RESOURCE
Default name of module properties resource.- See Also:
-
MODULE_NAME_PROPERTY
Suffix of property for module name.- See Also:
-
MODULE_DESC_PROPERTY
Suffix of property for module description.- See Also:
-
MODULE_URL_PROPERTY
Suffix of property for module URL.- See Also:
-
MODULE_PLUGIN_PROPERTY
Suffix of property for module plugin owner.- See Also:
-
MODULE_SRC_PROPERTY
Suffix of property for resource source.- See Also:
-
MODULE_DEST_PROPERTY
Suffix of property for resource destination.- See Also:
-
MODULE_REPLACE_PROPERTY
Suffix of property for resource replacement.- See Also:
-
MODULE_OPTIONAL_PROPERTY
Suffix of property for resource optionality.- See Also:
-
MODULE_EXEC_PROPERTY
Suffix of property for resource executability.- See Also:
-
MODULE_POSTENABLE_PROPERTY
Suffix of property for module post-enable message.- See Also:
-
MODULE_POSTDISABLE_PROPERTY
Suffix of property for module post-disable message.- See Also:
-
MODULE_LANGS_PROPERTY
Suffix of property for module languages.- See Also:
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
moduleProperties
Properties describing module. -
moduleId
Module ID. -
moduleName
Module name. -
moduleURL
Module URL. -
pluginId
Plugin ID. -
locales
Available message locales. -
requireHttpClient
private boolean requireHttpClientWhether to require an HTTP client.
-
-
Constructor Details
-
PropertyDrivenIdPModule
public PropertyDrivenIdPModule(@Nonnull Class<? extends IdPModule> claz) throws IOException, ModuleException Constructor.- Parameters:
claz
- type of object used to locate default module.properties resource- Throws:
IOException
- if unable to read fileModuleException
- if the module is not in a valid state
-
PropertyDrivenIdPModule
public PropertyDrivenIdPModule(@Nonnull InputStream inputStream) throws IOException, ModuleException Constructor.- Parameters:
inputStream
- property stream- Throws:
IOException
- if unable to read fileModuleException
- if the module is not in a valid state
-
PropertyDrivenIdPModule
Constructor.- Parameters:
properties
- property set- Throws:
ModuleException
- if the module is not in a valid state
-
-
Method Details
-
load
Load module information from properties.- Throws:
ModuleException
- on errors
-
getId
-
getName
Gets module name.- Parameters:
moduleContext
- optional context for supplying i18n input- Returns:
- a human-readable name for the module
-
getDescription
Gets module description.- Parameters:
moduleContext
- optional context for supplying i18n input- Returns:
- a human-readable description for the module
-
getURL
Gets module URL.- Returns:
- a URL for obtaining additional information about the module
-
setURL
Set the module URL.- Parameters:
url
- URL to set
-
getOwnerId
Gets the plugin name of the module's owner, if the module is provided by a plugin.- Returns:
- plugin ID, if any
-
isHttpClientRequired
public boolean isHttpClientRequired()Gets whether module enablement requires access to anHttpClient
.- Returns:
- true iff enabling the module requires HTTP client
-
enable
@Nonnull @NonnullElements public Map<IdPModule.ModuleResource,IdPModule.ResourceResult> enable(@Nullable ModuleContext moduleContext) throws ModuleException Enable the module.This operation MUST be idempotent.
- Specified by:
enable
in interfaceIdPModule
- Overrides:
enable
in classAbstractIdPModule
- Parameters:
moduleContext
- module context- Returns:
- summary of resource results
- Throws:
ModuleException
- if not successful
-
disable
@Nonnull @NonnullElements public Map<IdPModule.ModuleResource,IdPModule.ResourceResult> disable(@Nullable ModuleContext moduleContext, boolean clean) throws ModuleException Disable the module.This operation MUST be idempotent with respect to the value of the input parameter.
- Specified by:
disable
in interfaceIdPModule
- Overrides:
disable
in classAbstractIdPModule
- Parameters:
moduleContext
- module contextclean
- if true, the module should attempt to fully remove traces of previous use in a potentially destructive fashion- Returns:
- summary of resource results
- Throws:
ModuleException
- if not successful
-