Class XStreamUtility


  • public class XStreamUtility
    extends java.lang.Object
    The XStreamUtility class provides utility methods for using XStream APIs.
    • Constructor Detail

      • XStreamUtility

        public XStreamUtility()
    • Method Detail

      • getSCNFromPosition

        public static oracle.sql.NUMBER getSCNFromPosition​(byte[] position)
                                                    throws StreamsException
        Gets the SCN from a position.
        This static method gets the SCN portion of an LCR position. This method can only be used for LCRs that contain positions generated by an Oracle database. This method does not support LCRs with user-defined positions.
        Parameters:
        position - An Oracle-specific XStream position.
        Returns:
        The SCN portion in the position in the form of oracle.sql.NUMBER
        Throws:
        StreamsException - if error occurs when retrieving SCN.
      • getCommitSCNFromPosition

        public static oracle.sql.NUMBER getCommitSCNFromPosition​(byte[] position)
                                                          throws StreamsException
        Gets the commit system change number (SCN) from a position.
        This method can only be used for LCRs that contain positions generated by an Oracle database. This method does not support LCRs with user-defined positions.
        Parameters:
        position - An Oracle-specific XStream position.
        Returns:
        the Commit SCN portion in the position in the form of oracle.sql.NUMBER
        Throws:
        StreamsException - if error occurs when retrieving CSCN.
      • convertSCNToPosition

        public static byte[] convertSCNToPosition​(oracle.sql.NUMBER scn)
                                           throws StreamsException
        Converts the given SCN to a XStream position.
        Parameters:
        scn - the system change number in the form of oracle.sql.NUMBER.
        Returns:
        the XStream position in the form of a byte array
        Throws:
        StreamsException - if error occurs when converting SCN.
      • convertSCNToPosition

        public static byte[] convertSCNToPosition​(oracle.sql.NUMBER scn,
                                                  int version)
                                           throws StreamsException
        Converts the given SCN to a XStream position.
        Parameters:
        scn - The system change number in the form of oracle.sql.NUMBER.
        version - LCR identifier version.
        Returns:
        The XStream position in the form of a byte array.
        Throws:
        StreamsException - if error occurs when converting SCN.