Package net.shibboleth.profile.module

# Interface Module

All Superinterfaces:
  `Component`, `IdentifiedComponent`

All Known Implementing Classes:
  `AbstractModule`, `PropertyDrivenModule`

public interface Module extends IdentifiedComponent
This interface is the base of those exported via the service API into the IdP and in the future other applications.

Since:
  9.0.0

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static interface`
`Module.ModuleResource`
Interface to a resource managed by the module.
`static enum`
`Module.ResourceResult`
Resource management outcome.

## Method Summary

Modifier and Type
Method
Description
`Map<Module.ModuleResource,Module.ResourceResult>`
`disable(ModuleContext moduleContext, boolean clean)`
Disable the module.
`Map<Module.ModuleResource,Module.ResourceResult>`
`enable(ModuleContext moduleContext)`
Enable the module.
`default Map<Module.ModuleResource,Module.ResourceResult>`
`enable(ModuleContext moduleContext, boolean isReEnable)`
Enable the module - with information as to whether this is a re-enable.
`String`
`getDescription(ModuleContext moduleContext)`
Gets module description.
`String`
`getName(ModuleContext moduleContext)`
Gets module name.
`String`
`getNewExtension()`
Return the extension that the module manager will use for new default files..
`String`
`getOwnerId()`
Gets the plugin name of the module's owner, if the module is provided by a plugin.
`Collection<Module.ModuleResource>`
`getResources()`
Gets resources managed by this module.
`String`
`getSaveExtension()`
Return the extension that the module manager will use to preserve user files.
`String`
`getURL()`
Gets module URL.
`boolean`
`isEnabled(ModuleContext moduleContext)`
Gets whether the module is enabled.
`boolean`
`isHttpClientRequired()`
Gets whether module enablement requires access to an `HttpClient`.

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

## Method Details

### getName

@Nonnull @NotEmpty String getName(@Nullable ModuleContext moduleContext)
Gets module name.

Parameters:
  `moduleContext` - optional context for supplying i18n input
Returns:
  a human-readable name for the module

### getDescription

@Nullable @NotEmpty String getDescription(@Nullable ModuleContext moduleContext)
Gets module description.

Parameters:
  `moduleContext` - optional context for supplying i18n input
Returns:
  a human-readable description for the module

### getURL

@Nullable @NotEmpty String getURL()
Gets module URL.

Returns:
  a URL for obtaining additional information about the module

### getOwnerId

@Nullable @NotEmpty String getOwnerId()
Gets the plugin name of the module's owner, if the module is provided by a plugin.

Returns:
  plugin ID, if any

### isHttpClientRequired

boolean isHttpClientRequired()
Gets whether module enablement requires access to an `HttpClient`.

Returns:
  true iff enabling the module requires HTTP client

### getResources

@Nonnull @Unmodifiable @NotLive Collection<Module.ModuleResource> getResources()
Gets resources managed by this module.

Returns:
  resources managed by this module

### isEnabled

boolean isEnabled(@Nonnull ModuleContext moduleContext)
Gets whether the module is enabled.

The status of "enabled" is meant to reflect whether a deployer has previously or implicitly enabled the module, not necessarily whether the module is fully or properly configured or in use.

Parameters:
  `moduleContext` - module context
Returns:
  true iff the module is enabled

### enable

@Nonnull @Unmodifiable @NotLive Map<Module.ModuleResource,Module.ResourceResult> enable(@Nonnull ModuleContext moduleContext) throws ModuleException
Enable the module.

This operation MUST be idempotent.

Parameters:
  `moduleContext` - module context
Returns:
  summary of resource results
Throws:
  `ModuleException` - if not successful

### enable

@Nonnull @Unmodifiable @NotLive default Map<Module.ModuleResource,Module.ResourceResult> enable(@Nonnull ModuleContext moduleContext, boolean isReEnable) throws ModuleException
Enable the module - with information as to whether this is a re-enable.

This operation MUST be idempotent.

Parameters:
  `moduleContext` - module context
  `isReEnable` - has the installer determined that this was already enabled.
Returns:
  summary of resource results
Throws:
  `ModuleException` - if not successful

### disable

@Nonnull @Unmodifiable @NotLive Map<Module.ModuleResource,Module.ResourceResult> disable(@Nonnull ModuleContext moduleContext, boolean clean) throws ModuleException
Disable the module.

This operation MUST be idempotent with respect to the value of the input parameter.

Parameters:
  `moduleContext` - module context
  `clean` - 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

### getSaveExtension

@Nonnull String getSaveExtension()
Return the extension that the module manager will use to preserve user files.

Returns:
  the string.

### getNewExtension

@Nonnull String getNewExtension()
Return the extension that the module manager will use for new default files..

Returns:
  the string.