Package net.shibboleth.profile.module

# Class AbstractModule

java.lang.Object
net.shibboleth.profile.module.AbstractModule

All Implemented Interfaces:
  `Module`, `Component`, `IdentifiedComponent`

Direct Known Subclasses:
  `PropertyDrivenModule`

public abstract class AbstractModule extends Object implements Module
`Module` base class implementing basic file management.

Since:
  9.0.0

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected class`
`AbstractModule.BasicModuleResource`
Models a specific resource managed by a module.

## Nested classes/interfaces inherited from interface net.shibboleth.profile.module.Module

`Module.ModuleResource, Module.ResourceResult`

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`appNewExt`
Version-aware extension for new files added.
`private org.slf4j.Logger`
`log`
Class logger.
`private Collection<Module.ModuleResource>`
`moduleResources`
Module resources.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`AbstractModule(String version)`
Constructor.

## 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.
`boolean`
`equals(Object obj)`
`Collection<Module.ModuleResource>`
`getResources()`
Gets resources managed by this module.
`int`
`hashCode()`
`boolean`
`isEnabled(ModuleContext moduleContext)`
Gets whether the module is enabled.
`void`
`setResources(Collection<AbstractModule.BasicModuleResource> resources)`
Sets the module resources to manage.
`String`
`toString()`

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

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

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

`getId`

### Methods inherited from interface net.shibboleth.profile.module.Module

`enable, getDescription, getName, getNewExtension, getOwnerId, getSaveExtension, getURL, isHttpClientRequired`

## Field Details

### log

@Nonnull private org.slf4j.Logger log
Class logger.

### moduleResources

@Nonnull private Collection<Module.ModuleResource> moduleResources
Module resources.

### appNewExt

@Nonnull private String appNewExt
Version-aware extension for new files added.

## Constructor Details

### AbstractModule

protected AbstractModule(@Nullable String version)
Constructor.

Parameters:
  `version` - version of the containing application (or null if none available)

## Method Details

### getResources

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

Specified by:
  `getResources` in interface `Module`
Returns:
  resources managed by this module

### setResources

public void setResources(@Nullable Collection<AbstractModule.BasicModuleResource> resources)
Sets the module resources to manage.

Parameters:
  `resources` - resources to manage

### isEnabled

public 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.

Specified by:
  `isEnabled` in interface `Module`
Parameters:
  `moduleContext` - module context
Returns:
  true iff the module is enabled

### enable

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

This operation MUST be idempotent.

Specified by:
  `enable` in interface `Module`
Parameters:
  `moduleContext` - module context
Returns:
  summary of resource results
Throws:
  `ModuleException` - if not successful

### disable

@Nonnull @Unmodifiable @NotLive public 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.

Specified by:
  `disable` in interface `Module`
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

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`