@ThreadSafe public class BrokerRemovalStateTracker extends java.lang.Object implements BrokerRemovalCallback
initialize()
MUST be called on any state tracker instance before it can be utilized.BrokerRemovalCallback.BrokerRemovalEvent
Constructor and Description |
---|
BrokerRemovalStateTracker(int brokerId,
BrokerRemovalProgressListener progressListener,
BrokerRemovalTerminationListener terminationListener,
java.util.concurrent.atomic.AtomicReference<java.lang.String> stateReference) |
BrokerRemovalStateTracker(int brokerId,
BrokerRemovalStateMachine.BrokerRemovalState initState,
BrokerRemovalProgressListener progressListener,
BrokerRemovalTerminationListener terminationListener,
java.util.concurrent.atomic.AtomicReference<java.lang.String> stateReference) |
Modifier and Type | Method and Description |
---|---|
int |
brokerId() |
boolean |
cancel(java.lang.Exception eventException,
BrokerRemovalCancellationMode cancellationMode)
Cancels the broker removal state tracking by setting a terminal canceled state
|
BrokerRemovalStateMachine.BrokerRemovalState |
currentState() |
void |
initialize()
Initialize the RemovalStateTracker by setting the current state and notifying the listener of the initial state.
|
void |
registerEvent(BrokerRemovalCallback.BrokerRemovalEvent pe)
Registers a new #
BrokerRemovalCallback.BrokerRemovalEvent as part of the progress changing |
void |
registerEvent(BrokerRemovalCallback.BrokerRemovalEvent pe,
java.lang.Exception eventException)
Registers a new errorful #
BrokerRemovalCallback.BrokerRemovalEvent as part of the progress changing |
public BrokerRemovalStateTracker(int brokerId, BrokerRemovalProgressListener progressListener, BrokerRemovalTerminationListener terminationListener, java.util.concurrent.atomic.AtomicReference<java.lang.String> stateReference)
brokerId
- the ID of the broker that's going to be removedprogressListener
- the listener to call whenever the broker removal operation's progress changesstateReference
- an atomic reference of the current state name to keep up to datepublic BrokerRemovalStateTracker(int brokerId, BrokerRemovalStateMachine.BrokerRemovalState initState, BrokerRemovalProgressListener progressListener, BrokerRemovalTerminationListener terminationListener, java.util.concurrent.atomic.AtomicReference<java.lang.String> stateReference)
public void initialize()
public int brokerId()
public BrokerRemovalStateMachine.BrokerRemovalState currentState()
currentState
in interface BrokerRemovalCallback
public void registerEvent(BrokerRemovalCallback.BrokerRemovalEvent pe)
BrokerRemovalCallback
BrokerRemovalCallback.BrokerRemovalEvent
as part of the progress changingregisterEvent
in interface BrokerRemovalCallback
public void registerEvent(BrokerRemovalCallback.BrokerRemovalEvent pe, java.lang.Exception eventException)
BrokerRemovalCallback
BrokerRemovalCallback.BrokerRemovalEvent
as part of the progress changingregisterEvent
in interface BrokerRemovalCallback
public boolean cancel(java.lang.Exception eventException, BrokerRemovalCancellationMode cancellationMode)