Class TXPidImpl

java.lang.Object
com.iizix.txp.impl.TXPidImpl
All Implemented Interfaces:
ITXPid, Serializable

public class TXPidImpl extends Object implements ITXPid, Serializable
Implementation if the ITXPid interface. Pids should not be visible to the application programs.
Author:
Freggle
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The format ID should be a unique identifier for the transaction manager.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TXPidImpl(byte[] globalID, byte[] nodeQual, int seqNr)
    Constructs a TXPidImpl instance from the specified global ID, branch qualifier and sequence nr.
    TXPidImpl(ITXPid Pid, byte[] nodeQual)
    Constructs a TXPidImpl instance from the specified ITXPid and node qualifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares for equality.
    int
    Gets the format identifier
    byte[]
    Gets the global process ID
    byte[]
    Gets the node qualifier part of the PID
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • IIZI_FORMAT_ID

      public static final int IIZI_FORMAT_ID
      The format ID should be a unique identifier for the transaction manager. I just wrote something here
      See Also:
  • Constructor Details

    • TXPidImpl

      public TXPidImpl(byte[] globalID, byte[] nodeQual, int seqNr)
      Constructs a TXPidImpl instance from the specified global ID, branch qualifier and sequence nr.
      Parameters:
      globalID - the global ID
      nodeQual - the atm qualifier
      seqNr - the sequence nr
    • TXPidImpl

      public TXPidImpl(ITXPid Pid, byte[] nodeQual)
      Constructs a TXPidImpl instance from the specified ITXPid and node qualifier. Functionally this creates a new node of an existing global process ID
      Parameters:
      Pid - The process ID to create a new node of.
      nodeQual - The ID of the new node.
  • Method Details

    • getNodeQualifier

      public byte[] getNodeQualifier()
      Description copied from interface: ITXPid
      Gets the node qualifier part of the PID
      Specified by:
      getNodeQualifier in interface ITXPid
      Returns:
      the node qualifier
    • getFormatID

      public int getFormatID()
      Description copied from interface: ITXPid
      Gets the format identifier
      Specified by:
      getFormatID in interface ITXPid
      Returns:
      the format identifier
    • getGlobalProcessID

      public byte[] getGlobalProcessID()
      Description copied from interface: ITXPid
      Gets the global process ID
      Specified by:
      getGlobalProcessID in interface ITXPid
      Returns:
      the global process ID
    • equals

      public boolean equals(Object obj)
      Compares for equality. Instances are considered equal if they are both instances of TXPidImpl, and if they have the same global process id and node branch qualifier.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object