public final class ReadOnlyModeController extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
ReadOnlyModeController.ReadOnlyModeStatus
Read only mode status.
|
| Constructor and Description |
|---|
ReadOnlyModeController() |
| Modifier and Type | Method and Description |
|---|---|
void |
addStatusSupplier(ReadOnlyModeStatusSupplier supplier)
Registers a
ReadOnlyModeStatusSupplier with this instance. |
void |
addSwitchListener(ReadOnlyModeSwitchListener listener)
Registers a
ReadOnlyModeSwitchListener with this instance. |
static ReadOnlyModeController |
getInstance() |
ReadOnlyModeController.ReadOnlyModeStatus |
getReadOnlyStatus() |
List<ReadOnlyModeStatusInfo> |
getReadOnlyStatuses()
Returns a list of read-only statuses from multiple origins
|
static void |
readOnlyModeViolated(String message)
Handles the case, when a service encounters read-only mode violation, i.e.
|
void |
removeStatusSupplier(ReadOnlyModeStatusSupplier supplier)
Unregisters a
ReadOnlyModeStatusSupplier from this instance. |
void |
removeSwitchListener(ReadOnlyModeSwitchListener listener)
Unregisters a
ReadOnlyModeSwitchListener from this instance. |
void |
switchReadOnlyMode(boolean enable)
Performs the switch of all DX services into read-only mode or back.
|
public static void readOnlyModeViolated(String message) throws ReadOnlyModeException
message - the detailed error message from the serviceReadOnlyModeException - as a result of violation of read-only modepublic static ReadOnlyModeController getInstance()
public void switchReadOnlyMode(boolean enable)
enable - true if the read-only mode should be enabled; false if it should be disabledIllegalStateException - if switching to the specified mode is not permittedpublic ReadOnlyModeController.ReadOnlyModeStatus getReadOnlyStatus()
public List<ReadOnlyModeStatusInfo> getReadOnlyStatuses()
The returned list will always contain at least one element
which is the read-only status of the current instance.
Additional statuses can be provided by ReadOnlyModeStatusSupplier.
ReadOnlyModeStatusInfoaddStatusSupplier(ReadOnlyModeStatusSupplier),
removeStatusSupplier(ReadOnlyModeStatusSupplier)public void addSwitchListener(ReadOnlyModeSwitchListener listener)
ReadOnlyModeSwitchListener with this instance.
ReadOnlyModeSwitchListener.onReadOnlyModeSwitched(boolean) will be
fire once read only mode switch has completed.
listener - the listener to registerpublic void removeSwitchListener(ReadOnlyModeSwitchListener listener)
ReadOnlyModeSwitchListener from this instance.listener - the listener to unregisterpublic void addStatusSupplier(ReadOnlyModeStatusSupplier supplier)
ReadOnlyModeStatusSupplier with this instance.supplier - the supplier to registerpublic void removeStatusSupplier(ReadOnlyModeStatusSupplier supplier)
ReadOnlyModeStatusSupplier from this instance.supplier - the supplier to unregisterCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.