public class StateChangeEvent extends Object implements Serializable
state
change at a node
to the StateChangeListener. There is a distinct instance of this event
representing each state change at a node.
Each event instance may have zero or more state change related exceptions
associated with it. The exceptions are of type StateChangeException
.
StateChangeException
has a method called StateChangeException.getEvent()
that can be used to associate an event with
an exception.
StateChangeListener
,
Serialized FormConstructor and Description |
---|
StateChangeEvent(ReplicatedEnvironment.State state,
com.sleepycat.je.rep.impl.node.NameIdPair masterNameId) |
Modifier and Type | Method and Description |
---|---|
long |
getEventTime()
Returns the time (in nano second units) the event occurred, as reported
by
System.nanoTime() |
String |
getMasterNodeName()
Returns the node name identifying the master at the time of the event.
|
ReplicatedEnvironment.State |
getState()
Returns the state that the node has transitioned to.
|
public StateChangeEvent(ReplicatedEnvironment.State state, com.sleepycat.je.rep.impl.node.NameIdPair masterNameId)
state
- the new statemasterNameId
- the new master or NULL
if there isn't
one.public ReplicatedEnvironment.State getState()
State
resulting from this eventpublic long getEventTime()
System.nanoTime()
public String getMasterNodeName() throws IllegalStateException
IllegalStateException
- if the node is in the
DETACHED
or UNKNOWN
state.Copyright (c) 2002, 2015 Oracle and/or its affiliates. All rights reserved.