StateChangeEvent (Oracle - Berkeley DB Java Edition API)
Date: 2014-12-16

com.sleepycat.je.rep

## Class StateChangeEvent

- java.lang.Object
- - com.sleepycat.je.rep.StateChangeEvent

- All Implemented Interfaces:
    Serializable

      public class StateChangeEvent
      extends Object
      implements Serializable

  Communicates the `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.

  See Also:
    `StateChangeListener`, Serialized Form

- - ### Method Summary

    Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getState

          public ReplicatedEnvironment.State getState()

      Returns the state that the node has transitioned to.
      Returns:
        the new `State` resulting from this event

    - #### getEventTime

          public long getEventTime()

      Returns the time (in nano second units) the event occurred, as reported by `System.nanoTime()`
      Returns:
        the time the event occurred, in nanoseconds

    - #### getMasterNodeName

          public String getMasterNodeName()
                                   throws IllegalStateException

      Returns the node name identifying the master at the time of the event.
      Returns:
        the master node name
      Throws:
        `IllegalStateException` - if the node is in the `DETACHED` or `UNKNOWN` state.

Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.