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

  • Constructor Details

  • 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.
    • captureChanges

      private void captureChanges(Map<IdPModule.ModuleResource,IdPModule.ResourceResult> changes)
      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 interface AutoCloseable