Class ConfluenceLockerOnSiteRestore

java.lang.Object
com.atlassian.confluence.impl.backuprestore.restore.confluencelocker.ConfluenceLockerOnSiteRestore
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class ConfluenceLockerOnSiteRestore extends Object implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
Locks the whole UI on site restore. In addition, provides basic information about the progress. This class is supposed to work in cluster, so its methods should not be called directly. Instead, events should be sent, so any cluster node will know the current state.
Since:
8.3.0
  • Constructor Details

    • ConfluenceLockerOnSiteRestore

      public ConfluenceLockerOnSiteRestore(com.atlassian.event.api.EventPublisher eventPublisher, JohnsonEventFactory johnsonEventFactory)
  • Method Details

    • isDatabaseLocked

      public static boolean isDatabaseLocked()
      Indicates whether database should be locked because of site restore
    • isDisplayJohnson

      public static boolean isDisplayJohnson()
      Indicates whether we should display Johnson page about restore progress/failure
    • assertDatabaseIsNotLocked

      public static void assertDatabaseIsNotLocked() throws IllegalStateException
      Does nothing is the database is not locked.
      Throws:
      IllegalStateException - when the database is locked (by the site restore)
    • handleEvent

      @EventListener public void handleEvent(ClusterEventWrapper eventWrapper)
      Receives events from other nodes.
    • handleEvent

      @EventListener public void handleEvent(AbstractRestoreEvent abstractRestoreEvent)
      Receives AbstractRestoreEvent events from the same node.
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception