Class JtdsXid

  • All Implemented Interfaces:
    javax.transaction.xa.Xid

    public class JtdsXid
    extends java.lang.Object
    implements javax.transaction.xa.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

      Fields 
      Modifier and Type Field Description
      private byte[] bqual
      The branch qualifier ID.
      int fmtId
      The format ID.
      private byte[] gtran
      The global transaction ID.
      int hash
      Precalculated hash value.
      static int XID_SIZE
      The size of an XID in bytes.
      • Fields inherited from interface javax.transaction.xa.Xid

        MAXBQUALSIZE, MAXGTRIDSIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      JtdsXid​(byte[] global, byte[] branch)
      Construct an XID using two byte arrays.
      JtdsXid​(byte[] buf, int pos)
      Construct an XID using an offset into a byte buffer.
      JtdsXid​(javax.transaction.xa.Xid xid)
      Construct an XID as a clone of another XID.
    • Field Detail

      • XID_SIZE

        public static final int XID_SIZE
        The size of an XID in bytes.
        See Also:
        Constant Field Values
      • gtran

        private final byte[] gtran
        The global transaction ID.
      • bqual

        private final byte[] bqual
        The branch qualifier ID.
      • fmtId

        public final int fmtId
        The format ID.
      • hash

        public int hash
        Precalculated hash value.
    • Constructor Detail

      • JtdsXid

        public JtdsXid​(byte[] buf,
                       int pos)
        Construct an XID using an offset into a byte buffer.
        Parameters:
        buf - the byte buffer
        pos - the offset
      • JtdsXid

        public JtdsXid​(byte[] global,
                       byte[] branch)
        Construct an XID using two byte arrays.
        Parameters:
        global - the global transaction id
        branch - the transaction branch
      • JtdsXid

        public JtdsXid​(javax.transaction.xa.Xid xid)
        Construct an XID as a clone of another XID.
    • Method Detail

      • calculateHash

        private void calculateHash()
      • hashCode

        public int hashCode()
        Get the hash code for this object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash value of this object as a int
      • equals

        public boolean equals​(java.lang.Object obj)
        Test for equality.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to test for equality with this
        Returns:
        boolean true if the parameter equals this
      • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object