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 Summary
Constructors Constructor Description ConfluenceLockerOnSiteRestore(com.atlassian.event.api.EventPublisher eventPublisher, JohnsonEventFactory johnsonEventFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
static void
assertDatabaseIsNotLocked()
Does nothing is the database is not locked.void
destroy()
void
handleEvent(ClusterEventWrapper eventWrapper)
Receives events from other nodes.void
handleEvent(AbstractRestoreEvent abstractRestoreEvent)
Receives AbstractRestoreEvent events from the same node.static boolean
isDatabaseLocked()
Indicates whether database should be locked because of site restorestatic boolean
isDisplayJohnson()
Indicates whether we should display Johnson page about restore progress/failure
-
-
-
Constructor Detail
-
ConfluenceLockerOnSiteRestore
public ConfluenceLockerOnSiteRestore(com.atlassian.event.api.EventPublisher eventPublisher, JohnsonEventFactory johnsonEventFactory)
-
-
Method Detail
-
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 interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
-