Class RollbackPluginInstall
java.lang.Object
net.shibboleth.idp.installer.plugin.impl.RollbackPluginInstall
- All Implemented Interfaces:
AutoCloseable
An object which does installation rollback in its
AutoCloseable.close()
method.-
Field Summary
FieldsModifier and TypeFieldDescriptionThe files copied in as theIdPPlugin
was installed.The files renamed away during the installation.private final org.slf4j.Logger
logger.private final Map<IdPModule.ModuleResource,
IdPModule.ResourceResult> Module Changes.private final ModuleContext
TheModuleContext
that the module subsystem needs.The modules disabled when theIdPPlugin
was installed.The modules enabled when theIdPPlugin
was installed. -
Constructor Summary
ConstructorsConstructorDescriptionRollbackPluginInstall
(ModuleContext context, Map<IdPModule.ModuleResource, IdPModule.ResourceResult> changes) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Capture module changes.void
close()
void
Signal that the operation completed and that rollback won't be needed.What was copied?What was renamed away?What was enabled?What was enabled?protected void
rollback()
Perform the rollback.private boolean
Traverse thefilesCopied
list deleting the files.private boolean
Traverse themodulesDisabled
list re-enabling modules.private boolean
Traverse themodulesEnabled
list disabling modules.private boolean
Traverse thefilesRenamedAway
list copying the files back.
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger loglogger. -
modulesEnabled
The modules enabled when theIdPPlugin
was installed. -
modulesDisabled
The modules disabled when theIdPPlugin
was installed. -
filesCopied
The files copied in as theIdPPlugin
was installed. -
filesRenamedAway
The files renamed away during the installation. -
moduleContext
TheModuleContext
that the module subsystem needs. -
moduleChanges
Module Changes.
-
-
Constructor Details
-
RollbackPluginInstall
public RollbackPluginInstall(@Nonnull ModuleContext context, @Nonnull Map<IdPModule.ModuleResource, IdPModule.ResourceResult> changes) Constructor.- Parameters:
context
- The Module Contextchanges
- Where to capture module changes
-
-
Method Details
-
getModulesEnabled
What was enabled?- Returns:
- Returns the modules enabled as the plugin was installed.
-
getModulesDisabled
What was enabled?- Returns:
- Returns the modules disabled as the plugin was installed.
-
getFilesCopied
What was copied?- Returns:
- Returns the files copied as part of the install
-
getFilesRenamedAway
What was renamed away?- Returns:
- Returns the filesRenamedAway.
-
rollbackEnabledModules
private boolean rollbackEnabledModules()Traverse themodulesEnabled
list disabling modules.- Returns:
- true if we did any work.
-
rollbackDisabledModules
private boolean rollbackDisabledModules()Traverse themodulesDisabled
list re-enabling modules.- Returns:
- true if we did any work.
-
rollbackCopies
private boolean rollbackCopies()Traverse thefilesCopied
list deleting the files.- Returns:
- true if we did any work.
-
rollbackRenamed
private boolean rollbackRenamed()Traverse thefilesRenamedAway
list copying the files back.- Returns:
- true if we did any work.
-
captureChanges
Capture module changes.- Parameters:
changes
- what has changed
-
rollback
protected void rollback()Perform the rollback. This is done in reverse order from the install, which is to say the the lists are iterated over backwards and the order is Enabled (which are disabled), then copied (which are deleted) then renamed (which are copied). -
completed
public void completed()Signal that the operation completed and that rollback won't be needed. -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-