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 theIdPPluginwas installed.The files renamed away during the installation.private final org.slf4j.Loggerlogger.private final Map<Module.ModuleResource,Module.ResourceResult> Module Changes.private final ModuleContextTheModuleContextthat the module subsystem needs.The modules disabled when theIdPPluginwas installed.The modules enabled when theIdPPluginwas installed. -
Constructor Summary
ConstructorsConstructorDescriptionRollbackPluginInstall(ModuleContext context, Map<Module.ModuleResource, Module.ResourceResult> changes) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidCapture module changes.voidclose()voidSignal 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 voidrollback()Perform the rollback.private booleanTraverse thefilesCopiedlist deleting the files.private booleanTraverse themodulesDisabledlist re-enabling modules.private booleanTraverse themodulesEnabledlist disabling modules.private booleanTraverse thefilesRenamedAwaylist copying the files back.
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger loglogger. -
modulesEnabled
The modules enabled when theIdPPluginwas installed. -
modulesDisabled
The modules disabled when theIdPPluginwas installed. -
filesCopied
The files copied in as theIdPPluginwas installed. -
filesRenamedAway
The files renamed away during the installation. -
moduleContext
TheModuleContextthat the module subsystem needs. -
moduleChanges
Module Changes.
-
-
Constructor Details
-
RollbackPluginInstall
public RollbackPluginInstall(@Nonnull @Live ModuleContext context, @Nonnull Map<Module.ModuleResource, Module.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 themodulesEnabledlist disabling modules.- Returns:
- true if we did any work.
-
rollbackDisabledModules
private boolean rollbackDisabledModules()Traverse themodulesDisabledlist re-enabling modules.- Returns:
- true if we did any work.
-
rollbackCopies
private boolean rollbackCopies()Traverse thefilesCopiedlist deleting the files.- Returns:
- true if we did any work.
-
rollbackRenamed
private boolean rollbackRenamed()Traverse thefilesRenamedAwaylist 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:
closein interfaceAutoCloseable
-