Class StatusMachine
- java.lang.Object
-
- org.opends.server.replication.common.StatusMachine
-
public final class StatusMachine extends Object
This class contains static methods to implement the DS status state machine. They are used to validate the transitions of the state machine according to the current status and event, and to compute the new status. - Status (states of the state machine) are defined in ServerStatus enum - Events are defined in StateMachineEvent enum
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ServerStatus
computeNewStatus(ServerStatus curStatus, StatusMachineEvent event)
Computes the new status of the state machine according to the current status and the new generated event.static boolean
isValidInitialStatus(ServerStatus initStatus)
Checks if a given status is valid as an entering status for the state machine.
-
-
-
Method Detail
-
isValidInitialStatus
public static boolean isValidInitialStatus(ServerStatus initStatus)
Checks if a given status is valid as an entering status for the state machine.- Parameters:
initStatus
- Initial status to check.- Returns:
- True if the passed status is a valid initial status.
-
computeNewStatus
public static ServerStatus computeNewStatus(ServerStatus curStatus, StatusMachineEvent event)
Computes the new status of the state machine according to the current status and the new generated event.- Parameters:
curStatus
- The current status we start from.event
- The event that must make the current status evolve.- Returns:
- The newly computed status. If the state transition is impossible according to state machine, special INVALID_STATUS is returned.
-
-