Package net.sourceforge.jtds.jdbcx
Class JtdsXid
java.lang.Object
net.sourceforge.jtds.jdbcx.JtdsXid
- All Implemented Interfaces:
Xid
jTDS implementation of the
Xid
interface.- Version:
- $Id: JtdsXid.java,v 1.3 2005-04-28 14:29:30 alin_sinpalean Exp $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
The branch qualifier ID.final int
The format ID.private final byte[]
The global transaction ID.int
Precalculated hash value.static final int
The size of an XID in bytes.Fields inherited from interface javax.transaction.xa.Xid
MAXBQUALSIZE, MAXGTRIDSIZE
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
XID_SIZE
public static final int XID_SIZEThe size of an XID in bytes.- See Also:
-
gtran
private final byte[] gtranThe global transaction ID. -
bqual
private final byte[] bqualThe branch qualifier ID. -
fmtId
public final int fmtIdThe format ID. -
hash
public int hashPrecalculated hash value.
-
-
Constructor Details
-
JtdsXid
public JtdsXid(byte[] buf, int pos) Construct an XID using an offset into a byte buffer.- Parameters:
buf
- the byte bufferpos
- the offset
-
JtdsXid
public JtdsXid(byte[] global, byte[] branch) Construct an XID using two byte arrays.- Parameters:
global
- the global transaction idbranch
- the transaction branch
-
JtdsXid
Construct an XID as a clone of another XID.
-
-
Method Details
-
calculateHash
private void calculateHash() -
hashCode
public int hashCode()Get the hash code for this object. -
equals
Test for equality. -
getFormatId
public int getFormatId()- Specified by:
getFormatId
in interfaceXid
-
getBranchQualifier
public byte[] getBranchQualifier()- Specified by:
getBranchQualifier
in interfaceXid
-
getGlobalTransactionId
public byte[] getGlobalTransactionId()- Specified by:
getGlobalTransactionId
in interfaceXid
-
toString
-