Class RollbackPluginInstall

java.lang.Object
net.shibboleth.idp.installer.plugin.impl.RollbackPluginInstall
All Implemented Interfaces:
AutoCloseable

public class RollbackPluginInstall
extends Object
implements AutoCloseable
An object which does installation rollback in its AutoCloseable.close() method.
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      logger.
    • modulesEnabled

      @Live @Nonnull private List<IdPModule> modulesEnabled
      The modules enabled when the IdPPlugin was installed.
    • modulesDisabled

      @Live @Nonnull private List<IdPModule> modulesDisabled
      The modules disabled when the IdPPlugin was installed.
    • filesCopied

      @Live @Nonnull private List<Path> filesCopied
      The files copied in as the IdPPlugin was installed.
    • filesRenamedAway

      @Live @Nonnull private List<Pair<Path,​Path>> filesRenamedAway
      The files renamed away during the installation.
    • moduleContext

      @Nonnull private final ModuleContext moduleContext
      The ModuleContext that the module subsystem needs.
  • Constructor Details

    • RollbackPluginInstall

      public RollbackPluginInstall​(ModuleContext context)
      Constructor.
      Parameters:
      context - The Module Context
  • Method Details

    • getModulesEnabled

      @Live @Nonnull public List<IdPModule> getModulesEnabled()
      What was enabled?
      Returns:
      Returns the modules enabled as the plugin was installed.
    • getModulesDisabled

      @Live @Nonnull public List<IdPModule> getModulesDisabled()
      What was enabled?
      Returns:
      Returns the modules disabled as the plugin was installed.
    • getFilesCopied

      @Live @Nonnull public List<Path> getFilesCopied()
      What was copied?
      Returns:
      Returns the files copied as part of the install
    • getFilesRenamedAway

      @Live @Nonnull public List<Pair<Path,​Path>> getFilesRenamedAway()
      What was renamed away?
      Returns:
      Returns the filesRenamedAway.
    • rollbackEnabledModules

      private boolean rollbackEnabledModules()
      Traverse the modulesEnabled list disabling modules.
      Returns:
      true if we did any work.
    • rollbackDisabledModules

      private boolean rollbackDisabledModules()
      Traverse the modulesDisabled list re-enabling modules.
      Returns:
      true if we did any work.
    • rollbackCopies

      private boolean rollbackCopies()
      Traverse the filesCopied list deleting the files.
      Returns:
      true if we did any work.
    • rollbackRenamed

      private boolean rollbackRenamed()
      Traverse the filesRenamedAway list copying the files back.
      Returns:
      true if we did any work.
    • 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 interface AutoCloseable