Package com.netrics.likeit

## Class NetricsTranStats

- java.lang.Object
- - com.netrics.likeit.NetricsTranStats

-     public final class NetricsTranStats
      extends java.lang.Object

  Represents the status information on an open transaction.

  Objects of this class hold information on one open transaction. This class also defines constants associated with transactions, such as object transaction states and special transaction ID values.

  See Also:
    `NetricsServerInterface.listTransactions(int)`

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `STATE_ADDED` | This item has been added, but not yet committed.
    `static int` | `STATE_DELETED` | This item has been deleted, but the delete is not yet committed.
    `static int` | `STATE_DIRTY` | This is a special state used to test if this object has been modified by an uncommitted transaction.
    `static int` | `STATE_EXIST` | The item exists but is not held by a transaction.
    `static int` | `STATE_HELD` | This item is held by a transaction that is not committed
    `static int` | `STATE_MIXED` | This item had different states on different nodes.
    `static int` | `STATE_NULL` | Special state indicating there is no state for this item.
    `static int` | `STATE_RENAMED` | This item was renamed, but the name change is not committed.
    `static int` | `STATE_REPLACED` | This item was replaced, but the update is not committed.
    `static int` | `STATE_UPDATED` | This item has been updated, the update is not committed.
    `static int` | `TRAN_ID_NULL` | Represents the special null or missing transaction id.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `getErrorCount()` | Return the number of modify operations associated with this transaction that terminated with an error.
    `long` | `getId()` | Return the full transaction id.
    `int` | `getIdleTime()` | Return the idle time for this transaction in seconds.
    `int` | `getLogSize()` | Return the number of entries in the rollback log of this transaction.
    `int` | `getShortId()` | Return the short form of the transaction id.
    `boolean` | `isExplicit()` | Return true if this is an explicit transaction.
    `boolean` | `isGatewayTran()` | Return true if this is a gateway transaction.
    `boolean` | `isImplicit()` | Return true if this is an implicit transaction.
    `java.lang.String` | `toString()` | Return a string that represents the NetricsTranStats object.

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### STATE_NULL

          public static final int STATE_NULL

      Special state indicating there is no state for this item.
      See Also:
        Constant Field Values

    - #### STATE_EXIST

          public static final int STATE_EXIST

      The item exists but is not held by a transaction.
      See Also:
        Constant Field Values

    - #### STATE_UPDATED

          public static final int STATE_UPDATED

      This item has been updated, the update is not committed.
      See Also:
        Constant Field Values

    - #### STATE_HELD

          public static final int STATE_HELD

      This item is held by a transaction that is not committed
      See Also:
        Constant Field Values

    - #### STATE_ADDED

          public static final int STATE_ADDED

      This item has been added, but not yet committed.
      See Also:
        Constant Field Values

    - #### STATE_DELETED

          public static final int STATE_DELETED

      This item has been deleted, but the delete is not yet committed.
      See Also:
        Constant Field Values

    - #### STATE_RENAMED

          public static final int STATE_RENAMED

      This item was renamed, but the name change is not committed.
      See Also:
        Constant Field Values

    - #### STATE_REPLACED

          public static final int STATE_REPLACED

      This item was replaced, but the update is not committed.
      See Also:
        Constant Field Values

    - #### STATE_MIXED

          public static final int STATE_MIXED

      This item had different states on different nodes. This can only be returned from a gateway. It is returned when not all nodes report that same state value for the same object.
      See Also:
        Constant Field Values

    - #### STATE_DIRTY

          public static final int STATE_DIRTY

      This is a special state used to test if this object has been modified by an uncommitted transaction.
      See Also:
        Constant Field Values

    - #### TRAN_ID_NULL

          public static final int TRAN_ID_NULL

      Represents the special null or missing transaction id.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Return a string that represents the NetricsTranStats object. The string is returned in human readable format.
      Overrides:
        `toString` in class `java.lang.Object`

    - #### getId

          public long getId()

      Return the full transaction id. If there is no transaction id NetricsTranStats.TRAN_ID_NULL is returned.
      Returns:
        a full transaction id, or NetricsTranStats.TRAN_ID_NULL.

    - #### getShortId

          public int getShortId()

      Return the short form of the transaction id. If there is no transaction id NetricsTranStats.TRAN_ID_NULL is returned.
      Returns:
        a short-form of the transaction id, or NetricsTranStats.TRAN_ID_NULL.

    - #### isExplicit

          public boolean isExplicit()

      Return true if this is an explicit transaction. False is returned if it is an implicit transaction or there is no transaction id.
      Returns:
        true if this is an explicit transaction.

    - #### isImplicit

          public boolean isImplicit()

      Return true if this is an implicit transaction. False is returned if it is an explicit transaction or there is no transaction id.
      Returns:
        true if this is an implicit transaction.

    - #### isGatewayTran

          public boolean isGatewayTran()

      Return true if this is a gateway transaction. False is returned if it is not a gateway transaction or there is no transaction id.
      Returns:
        true if this is a gateway transaction.

    - #### getIdleTime

          public int getIdleTime()

      Return the idle time for this transaction in seconds.

      If there is no transaction or no idle time it returns -1.

      The idle time is the time since the last modify operation associated with this transaction completed. If there are no update operations associated with this transaction it is the time since the transaction was created. If a modify operation is in progress the idle time will be zero.

      Returns:
        the idle time for this transaction in seconds.

    - #### getErrorCount

          public int getErrorCount()

      Return the number of modify operations associated with this transaction that terminated with an error.

      If there is no information it returns -1.

      Some commands may return an error code but not be considered to have terminated with an error from a transaction point of view. If the command would have committed its results if executed under an implicit transaction it is not considered to have failed. Examples are the checkpoint and restore commands that may return a partial checkpoint or partial restore error, but still commit those operations that succeeded.

      Returns:
        the number of modify operations associated with this transaction that terminated with an error.

    - #### getLogSize

          public int getLogSize()

      Return the number of entries in the rollback log of this transaction. It is a rough estimate of the size of the transaction. The count does not include the number of individual records updated. If there is no log size information it returns -1.
      Returns:
        the number of entries in the rollback log of this transaction.