com.tibco.datagrid

## Interface Event

-     public interface Event

  An Event object gives information about a change in a Row

  Table Listeners receive event objects in their callback to indicate that a change has occurred on the table they are listening on. Event objects are owned by the ActiveSpaces library and must not be accessed outside of the span of the Table Listener's callback function.

  This interface is implemented internally. Applications do not implement this interface.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `TIBDG_EVENT_ERRORCODE_COPYSET_LEADER_FAILURE` Error Code Copyset Leader Failure
    `static int` | `TIBDG_EVENT_ERRORCODE_GRID_REDISTRIBUTING` Error Code Grid Redistributing
    `static int` | `TIBDG_EVENT_ERRORCODE_INVALID`
    `static int` | `TIBDG_EVENT_ERRORCODE_PROXY_FAILURE` Error Code Proxy Failure
    `static int` | `TIBDG_EVENT_ERRORCODE_TABLE_DELETED` Error Code Table Deleted

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Row` | `getCurrent()` Get the value of the row after the Put event
    `int` | `getErrorCode()` Get the errorcode from an error event
    `java.lang.String` | `getErrorDescription()` Get the description from an error event
    `Row` | `getPrevious()` Get the value of the row of prior to the Put or Delete event
    `EventType` | `getType()` Get the type of the event

- - ### Field Detail

    - #### TIBDG_EVENT_ERRORCODE_INVALID

          static final int TIBDG_EVENT_ERRORCODE_INVALID

      See Also:
        Constant Field Values

    - #### TIBDG_EVENT_ERRORCODE_TABLE_DELETED

          static final int TIBDG_EVENT_ERRORCODE_TABLE_DELETED

      Error Code Table Deleted

      This error is generated when a table is deleted. The listener will not receive new events. The listener cannot be recreated afterwards

      See Also:
        Constant Field Values

    - #### TIBDG_EVENT_ERRORCODE_COPYSET_LEADER_FAILURE

          static final int TIBDG_EVENT_ERRORCODE_COPYSET_LEADER_FAILURE

      Error Code Copyset Leader Failure

      This error is generated when a copyset leader fails. The listener will not receive new events. This error invalidates the listener but it may be recreated. The application should attempt to recreate the listener until it succeeds when a copyset leader becomes available.

      See Also:
        Constant Field Values

    - #### TIBDG_EVENT_ERRORCODE_GRID_REDISTRIBUTING

          static final int TIBDG_EVENT_ERRORCODE_GRID_REDISTRIBUTING

      Error Code Grid Redistributing

      This error is generated when grid redistribution occurs when changing the number of copysets. The listener will not receive new events. This error invalidates the listener but it may be recreated. The application should attempt to recreate the listener until it succeeds when redistribution completes.

      See Also:
        Constant Field Values

    - #### TIBDG_EVENT_ERRORCODE_PROXY_FAILURE

          static final int TIBDG_EVENT_ERRORCODE_PROXY_FAILURE

      Error Code Proxy Failure

      This error is generated when the connection to the proxy is lost. The listener will not receive new events. This error invalidates the listener but it may be recreated. The application should attempt to recreate the listener until it succeeds when a proxy becomes available.

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getType

          EventType getType()
                     throws DataGridException

      Get the type of the event

      Other event functions only apply to certain types of events, so getType should be called to avoid exceptions.

      Returns:
        The type of the event `EventType`
      Throws:
        `DataGridException` - in case of failures

    - #### getPrevious

          Row getPrevious()
                   throws DataGridException

      Get the value of the row of prior to the Put or Delete event

      Calling getPrevious is only valid on Put and Delete events. The call will return null on a Put event where there was no previous value.

      Returns:
        A Row object representing the previous value
      Throws:
        `DataGridException` - in case of failures

    - #### getCurrent

          Row getCurrent()
                  throws DataGridException

      Get the value of the row after the Put event

      Calling getCurrent is only valid on Put events.

      Returns:
        A Row object representing the current value
      Throws:
        `DataGridException` - in case of failures

    - #### getErrorCode

          int getErrorCode()
                    throws DataGridException

      Get the errorcode from an error event

      The value will be one of the errorcode constants: `Event.TIBDG_EVENT_ERRORCODE_TABLE_DELETED` `Event.TIBDG_EVENT_ERRORCODE_COPYSET_LEADER_FAILURE` `Event.TIBDG_EVENT_ERRORCODE_GRID_REDISTRIBUTING` `Event.TIBDG_EVENT_ERRORCODE_PROXY_FAILURE` The Listener is invalidated by an error but may be recreated unless the error is `TIBDG_EVENT_ERRORCODE_TABLE_DELETED`

      Returns:
        Error code int
      Throws:
        `DataGridException` - in case of failures

    - #### getErrorDescription

          java.lang.String getErrorDescription()
                                        throws DataGridException

      Get the description from an error event

      Returns:
        Error description string
      Throws:
        `DataGridException` - in case of failures