Top Description Fields Constructors Methods
org.apache.derby.iapi.store.access.xa

public Class XAXactId

extends GlobalXact
implements Xid
Class Inheritance
All Implemented Interfaces
javax.transaction.xa.Xid
Imports
org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.store.access.GlobalXact, javax.transaction.xa.Xid, .XAException

The XAXactId class is a specific implementation of the JTA Xid interface. It is only used by the TransactionTable.restore() interface to return an array of Xid's back to the caller, as part of serving the XAresource.restore() interface.

It is NOT the object that is stored in the log. One reason for this is that the Formattable and Xid interface's define two different return values for the getFormatId() interface.

Field Summary

Modifier and TypeField and Description
private static final char
COLON

Private Fields of the class

Inherited from org.apache.derby.iapi.store.access.GlobalXact:
branch_idformat_idglobal_id

Constructor Summary

AccessConstructor and Description
public
XAXactId(int format_id, byte[] global_id, byte[] branch_id)

Construct from given pieces of an Xid.

public
XAXactId(Xid xid)

Construct an Xid using an external Xid.

public
XAXactId(String xactIdString)

Method Summary

Modifier and TypeMethod and Description
private void
copy_init_xid(int format_id, byte[] global_id, byte[] branch_id)

initialize by making array copies of appropriate fields.

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides org.apache.derby.iapi.store.access.GlobalXact.equals.

Indicates whether some other object is "equal to" this one.

public byte[]

Returns:

A byte array containing the branch qualifier of the transaction.
getBranchQualifier
()

Implements javax.transaction.xa.Xid.getBranchQualifier.

Obtain the transaction branch qualifier part of the Xid in a byte array.

public int

Returns:

Format identifier. O means the OSI CCR format.
getFormatId
()

Implements javax.transaction.xa.Xid.getFormatId.

Obtain the format id part of the Xid.

public byte[]

Returns:

A byte array containing the global transaction identifier.
getGlobalTransactionId
()

Implements javax.transaction.xa.Xid.getGlobalTransactionId.

Obtain the global transaction identifier part of XID as an array of bytes.

public String
Inherited from org.apache.derby.iapi.store.access.GlobalXact:
hashCodetoString

Field Detail

COLONback to summary
private static final char COLON

Private Fields of the class

Constructor Detail

XAXactIdback to summary
public XAXactId(int format_id, byte[] global_id, byte[] branch_id)

Construct from given pieces of an Xid. Makes copies of arrays.

XAXactIdback to summary
public XAXactId(Xid xid) throws XAException

Construct an Xid using an external Xid.

Exceptions
XAException:
invalid external xid
XAXactIdback to summary
public XAXactId(String xactIdString)

Method Detail

copy_init_xidback to summary
private void copy_init_xid(int format_id, byte[] global_id, byte[] branch_id)

initialize by making array copies of appropriate fields.

equalsback to summary
public boolean equals(Object other)

Overrides org.apache.derby.iapi.store.access.GlobalXact.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getBranchQualifierback to summary
public byte[] getBranchQualifier()

Implements javax.transaction.xa.Xid.getBranchQualifier.

Obtain the transaction branch qualifier part of the Xid in a byte array.

Returns:byte[]

A byte array containing the branch qualifier of the transaction.

getFormatIdback to summary
public int getFormatId()

Implements javax.transaction.xa.Xid.getFormatId.

Obtain the format id part of the Xid.

Returns:int

Format identifier. O means the OSI CCR format.

getGlobalTransactionIdback to summary
public byte[] getGlobalTransactionId()

Implements javax.transaction.xa.Xid.getGlobalTransactionId.

Obtain the global transaction identifier part of XID as an array of bytes.

Returns:byte[]

A byte array containing the global transaction identifier.

toHexStringback to summary
public String toHexString()