org.objectweb.jotm
Class XidImpl

java.lang.Object
  extended byorg.objectweb.jotm.XidImpl
All Implemented Interfaces:
Serializable, Xid, Xid

public class XidImpl
extends Object
implements Xid, Serializable

Xid implementation for JTA XID has the following format as defined by X/Open Specification: XID long formatId format identifier long gtrid_length value 1-64 long bqual_length value 1-64 byte data [XIDDATASIZE] where XIDDATASIZE = 128 The data field comprises at most two contiguous components: a global transaction identifier (gtrid) and a branch qualifier (bqual) which are defined as: byte gtrid [1-64] global transaction identfier byte bqual [1-64] branch qualifier

See Also:
Serialized Form

Field Summary
static int JOTM_FORMAT_ID
           
 
Fields inherited from interface javax.transaction.xa.Xid
MAXBQUALSIZE, MAXGTRIDSIZE
 
Constructor Summary
XidImpl()
          build a new Xid with a null BQual
XidImpl(byte[] XidByteArray)
          Construct an Xid from a byte array.
XidImpl(java.nio.ByteBuffer XidByteBuffer)
          Construct an Xid from a byteBuffer.
XidImpl(int formatId, byte[] gtrid, byte[] bqual)
          build Xid with all its components (for performance on java serialization)
XidImpl(int fid, int bqualsz, byte[] tid)
          Build an Xid from an otid_t CORBA
XidImpl(String serverName, int ipAddr)
          Build an Xid for a local transaction
XidImpl(Xid passedXid)
          The xid was passed from an external EIS (inflow transaction).
XidImpl(Xid oldXid, int index)
          build a new Xid from an existing Xid, preserving the gtrid, and using the 'index' as part of the unique but recognizable BQual.
 
Method Summary
 boolean equals(Object obj2)
          return true if objects are identical
 byte[] getBranchQualifier()
          Get the Branch Qualifier for that Xid
 int getFormatId()
          Get the format id for that Xid
 byte[] getGlobalTransactionId()
          Get the Global Id for that Xid
 int hashCode()
          return a hashcode value for this object
 boolean IsThisOneOfOurs(byte[] gtrid_or_bqual)
           
static void setUuids(long passedUuid0, long passedUuid1)
          Provide static interface to recover uuid0 & uuid1 after journal replay.
 String toString()
          String form default toString() compresses Xid's
 String toString(boolean Full)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

JOTM_FORMAT_ID

public static final int JOTM_FORMAT_ID
See Also:
Constant Field Values
Constructor Detail

XidImpl

public XidImpl(String serverName,
               int ipAddr)
Build an Xid for a local transaction


XidImpl

public XidImpl(int fid,
               int bqualsz,
               byte[] tid)
Build an Xid from an otid_t CORBA


XidImpl

public XidImpl(int formatId,
               byte[] gtrid,
               byte[] bqual)
build Xid with all its components (for performance on java serialization)


XidImpl

public XidImpl()
build a new Xid with a null BQual


XidImpl

public XidImpl(Xid oldXid,
               int index)
build a new Xid from an existing Xid, preserving the gtrid, and using the 'index' as part of the unique but recognizable BQual. The important thing is that this method must return the same result on successive calls given the same input.


XidImpl

public XidImpl(java.nio.ByteBuffer XidByteBuffer)
Construct an Xid from a byteBuffer. This is necessary for use during recovery when the Xid has been converted to a String so that it can be written to a file. The Xid must be reconstructed from the byte array resulting from toString(true). Note that the byte array includes ':' characters as separators between components. NOTE: Current position of input ByteBuffer is employed!!


XidImpl

public XidImpl(byte[] XidByteArray)
Construct an Xid from a byte array. This is necessary for use during recovery when the Xid has been converted to a byte array so that it can be written to the Howl log. The Xid must be reconstructed from the byte array resulting from toString(true). Note that the byte array includes ':' characters as separators between components.


XidImpl

public XidImpl(Xid passedXid)
The xid was passed from an external EIS (inflow transaction). Need to store the formatId, gtrid.length, bqual.length, gtrid, and bqual from the passed xid.

Method Detail

setUuids

public static void setUuids(long passedUuid0,
                            long passedUuid1)
Provide static interface to recover uuid0 & uuid1 after journal replay.


getFormatId

public int getFormatId()
Get the format id for that Xid

Specified by:
getFormatId in interface Xid

getGlobalTransactionId

public byte[] getGlobalTransactionId()
Get the Global Id for that Xid

Specified by:
getGlobalTransactionId in interface Xid

getBranchQualifier

public byte[] getBranchQualifier()
Get the Branch Qualifier for that Xid

Specified by:
getBranchQualifier in interface Xid

toString

public String toString()
String form default toString() compresses Xid's

Specified by:
toString in interface Xid

toString

public String toString(boolean Full)
Specified by:
toString in interface Xid

IsThisOneOfOurs

public boolean IsThisOneOfOurs(byte[] gtrid_or_bqual)
Specified by:
IsThisOneOfOurs in interface Xid

equals

public boolean equals(Object obj2)
return true if objects are identical


hashCode

public int hashCode()
return a hashcode value for this object