com.sun.jts.jtsxa
Class XID

java.lang.Object
  extended by com.sun.jts.jtsxa.XID
All Implemented Interfaces:
Xid

public class XID
extends java.lang.Object
implements Xid

The XID class provides an implementation of the X/Open transaction identifier it implements the javax.transaction.xa.Xid interface.


Field Summary
static int MAXBQUALSIZE
          The maximum size of the branch qualifier.
static int MAXGTRIDSIZE
          The maximum size of the global transaction identifier.
 
Constructor Summary
XID()
          Constructs a new null XID.
 
Method Summary
 void copy(org.omg.CosTransactions.otid_t from)
          Initialize an XID using an omg otid_t as the source of data.
 void copy(XID from)
          Initialize an XID using another XID as the source of data.
 boolean equals(java.lang.Object o)
          Determine whether or not two objects of this type are equal.
 byte[] getBranchQualifier()
          Returns the branch qualifier for this XID.
 int getFormatId()
           
 int getFormatID()
          Obtain the format identifier part of the XID.
 byte[] getGlobalTransactionId()
           
 byte[] getGlobalTransactionIdentifier()
          Returns the global transaction identifier for this XID.
 int hashCode()
          Compute the hash code.
 boolean isEqualBranchQualifier(byte[] data)
          Compares the input parameter with the branch qualifier for equality.
 boolean isEqualGtrid(XID xid)
          Return whether the Gtrid of this is equal to the Gtrid of xid
 void setBranchQualifier(byte[] qual)
          Set the branch qualifier for this XID.
 void setFormatID(int formatID)
          Set the format identifier part of the XID.
 java.lang.String toString()
          Return a string representing this XID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAXGTRIDSIZE

public static final int MAXGTRIDSIZE
The maximum size of the global transaction identifier.

See Also:
Constant Field Values

MAXBQUALSIZE

public static final int MAXBQUALSIZE
The maximum size of the branch qualifier.

See Also:
Constant Field Values
Constructor Detail

XID

public XID()
Constructs a new null XID.

After construction the data within the XID should be initialized.

Method Detail

copy

public void copy(XID from)
Initialize an XID using another XID as the source of data.

Parameters:
from - the XID to initialize this XID from

copy

public void copy(org.omg.CosTransactions.otid_t from)
Initialize an XID using an omg otid_t as the source of data.

Parameters:
from - the OMG otid_t to initialize this XID from
See Also:
otid_t

equals

public boolean equals(java.lang.Object o)
Determine whether or not two objects of this type are equal.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to be compared with this XID.
Returns:
Returns true of the supplied object represents the same global transaction as this, otherwise returns false.

hashCode

public int hashCode()
Compute the hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
the computed hashcode

toString

public java.lang.String toString()
Return a string representing this XID.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this XID

getBranchQualifier

public byte[] getBranchQualifier()
Returns the branch qualifier for this XID.

Specified by:
getBranchQualifier in interface Xid
Returns:
the branch qualifier

setBranchQualifier

public void setBranchQualifier(byte[] qual)
Set the branch qualifier for this XID.

Parameters:
qual - a Byte array containing the branch qualifier to be set. If the size of the array exceeds MAXBQUALSIZE, only the first MAXBQUALSIZE elements of qual will be used.

getFormatID

public int getFormatID()
Obtain the format identifier part of the XID.

Returns:
Format identifier. -1 indicates a null XID

setFormatID

public void setFormatID(int formatID)
Set the format identifier part of the XID.

Parameters:
Format - identifier. -1 indicates a null Xid.

isEqualBranchQualifier

public boolean isEqualBranchQualifier(byte[] data)
Compares the input parameter with the branch qualifier for equality.

Returns:
true if equal

isEqualGtrid

public boolean isEqualGtrid(XID xid)
Return whether the Gtrid of this is equal to the Gtrid of xid


getGlobalTransactionIdentifier

public byte[] getGlobalTransactionIdentifier()
Returns the global transaction identifier for this XID.

Returns:
the global transaction identifier

getFormatId

public int getFormatId()
Specified by:
getFormatId in interface Xid

getGlobalTransactionId

public byte[] getGlobalTransactionId()
Specified by:
getGlobalTransactionId in interface Xid


Copyright © 2012 GlassFish Community. All Rights Reserved.