XID (Transactions JTA 4.0.6 API)
Date: 2018-01-11

com.atomikos.datasource.xa

## Class XID

- java.lang.Object
- - com.atomikos.datasource.xa.XID

- All Implemented Interfaces:
    java.io.Serializable, javax.transaction.xa.Xid

      public class XID
      extends java.lang.Object
      implements java.io.Serializable, javax.transaction.xa.Xid

  Our Xid class with correct equals and hashCode.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface javax.transaction.xa.Xid

      `MAXBQUALSIZE, MAXGTRIDSIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XID(java.lang.String tid, java.lang.String resourceURL)` Create a new instance with the resource name as branch.
    `XID(javax.transaction.xa.Xid xid)` Copy constructor needed during recovery: if the data source returns inappropriate instances (that do not implement equals and hashCode) then we will need this constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `byte[]` | `getBranchQualifier()`
    `java.lang.String` | `getBranchQualifierAsString()`
    `int` | `getFormatId()`
    `byte[]` | `getGlobalTransactionId()`
    `java.lang.String` | `getGlobalTransactionIdAsString()`
    `int` | `hashCode()`
    `java.lang.String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### XID

          public XID(java.lang.String tid,
             java.lang.String resourceURL)

      Create a new instance with the resource name as branch. This is the main constructor for new instances.
      Parameters:
        `tid` - The global transaction identifier.
        `resourceURL` - The name of the resource in the current configuration (UNIQUE!), needed for recovering the XIDs for this configuration. The resulting branch qualifier will ALWAYS start with the name of the resource, and this can be used during recovery to identify the XIDs to be recovered.

    - #### XID

          public XID(javax.transaction.xa.Xid xid)

      Copy constructor needed during recovery: if the data source returns inappropriate instances (that do not implement equals and hashCode) then we will need this constructor.
      Parameters:
        `xid` - The xid.

  - ### Method Detail

    - #### getFormatId

          public int getFormatId()

      Specified by:
        `getFormatId` in interface `javax.transaction.xa.Xid`

    - #### getBranchQualifier

          public byte[] getBranchQualifier()

      Specified by:
        `getBranchQualifier` in interface `javax.transaction.xa.Xid`

    - #### getGlobalTransactionId

          public byte[] getGlobalTransactionId()

      Specified by:
        `getGlobalTransactionId` in interface `javax.transaction.xa.Xid`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getBranchQualifierAsString

          public java.lang.String getBranchQualifierAsString()

    - #### getGlobalTransactionIdAsString

          public java.lang.String getGlobalTransactionIdAsString()

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

Copyright © 2018. All Rights Reserved.