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 boolean
isTransitionAllowed(ServerStatus fromStatus, ServerStatus toStatus)
Returns whether transition fromfromStatus
totoStatus
is valid.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.
-
isTransitionAllowed
public static boolean isTransitionAllowed(ServerStatus fromStatus, ServerStatus toStatus)
Returns whether transition fromfromStatus
totoStatus
is valid.- Parameters:
fromStatus
- The current status we start from.toStatus
- The status we are trying to go to.- Returns:
true
if transition fromfromStatus
totoStatus
is valid,false
otherwise
-
-