Package oracle.streams
Class XStreamUtility
- java.lang.Object
-
- oracle.streams.XStreamUtility
-
public class XStreamUtility extends java.lang.Object
The XStreamUtility class provides utility methods for using XStream APIs.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_POS_LENGTH
static int
POS_LENGTH_V1
static int
POS_LENGTH_V2
static int
POS_VERSION_V1
static int
POS_VERSION_V2
static int
SCN_START_V1
static int
SCN_START_V2
-
Constructor Summary
Constructors Constructor Description XStreamUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
convertSCNToPosition(oracle.sql.NUMBER scn)
Converts the given SCN to a XStream position.static byte[]
convertSCNToPosition(oracle.sql.NUMBER scn, int version)
Converts the given SCN to a XStream position.static oracle.sql.NUMBER
getCommitSCNFromPosition(byte[] position)
Gets the commit system change number (SCN) from a position.static oracle.sql.NUMBER
getSCNFromPosition(byte[] position)
Gets the SCN from a position.
-
-
-
Field Detail
-
POS_VERSION_V1
public static final int POS_VERSION_V1
- See Also:
- Constant Field Values
-
POS_VERSION_V2
public static final int POS_VERSION_V2
- See Also:
- Constant Field Values
-
SCN_START_V1
public static final int SCN_START_V1
- See Also:
- Constant Field Values
-
SCN_START_V2
public static final int SCN_START_V2
- See Also:
- Constant Field Values
-
POS_LENGTH_V1
public static final int POS_LENGTH_V1
- See Also:
- Constant Field Values
-
POS_LENGTH_V2
public static final int POS_LENGTH_V2
- See Also:
- Constant Field Values
-
MAX_POS_LENGTH
public static final int MAX_POS_LENGTH
- See Also:
- Constant Field Values
-
-
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.
-
-