Package oracle.streams
Class AbstractLCR
- java.lang.Object
-
- oracle.streams.AbstractLCR
-
- All Implemented Interfaces:
LCR
- Direct Known Subclasses:
DefaultDDLLCR,DefaultRowLCR
public abstract class AbstractLCR extends java.lang.Object implements LCR
The AbstractLCR class provides an abstract implementation of the LCR interface. This class encapsulates the methods and attributes of the LCR message type defined by Oracle Streams. It is the super class for all Oracle Streams default LCR types, including DefaultRowLCR and DefaultDDLLCR.
-
-
Field Summary
-
Fields inherited from interface oracle.streams.LCR
ATTRIBUTE_ROOT_NAME, ATTRIBUTE_ROW_ID, ATTRIBUTE_SERIAL_NUM, ATTRIBUTE_SESSION_NUM, ATTRIBUTE_THREAD_NUM, ATTRIBUTE_TX_NAME, ATTRIBUTE_USERNAME
-
-
Constructor Summary
Constructors Constructor Description AbstractLCR()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetAttribute(java.lang.Object attributeName)Gets the attribute by specifying the attribute name.java.lang.ObjectgetAttributeName(int index)Gets the attribute name in the LCR attributes list by position.java.lang.Object[]getAttributesList()Gets the list of attribute name and value pairs in the LCR.java.lang.ObjectgetAttributeValue(int index)Gets the attribute value in the LCR attributes list by position.java.lang.StringgetCommandType()Gets the LCR command type executed in the DML or DDL statement.oracle.sql.NUMBERgetCommitSCN()Gets the LCR commit system change number (SCN) in the format of oracle.sql.NUMBER.java.lang.StringgetMessageTrackingLabel()Gets the message tracking label of the LCR.intgetNumAttributes()Gets the total number of attributes in the LCR.java.lang.StringgetObjectName()Gets the name of the object that is changed by the LCR.java.lang.StringgetObjectOwner()Gets the owner of the object that is changed by the LCR.byte[]getPosition()Gets the position of the current LCR.java.lang.StringgetRootName()Gets the root name of the LCR.oracle.sql.NUMBERgetSCN()Gets the SCN of the current LCR in the format of oracle.sql.NUMBER.java.lang.StringgetSourceDatabaseName()Gets the global name of the source database.oracle.sql.DATEgetSourceTime()Gets the time when the LCR was created.byte[]getTag()Gets the tag for the LCR.java.lang.StringgetTransactionId()Gets the transaction identifier of the LCR.voidsetAttribute(java.lang.Object attributeName, java.lang.Object attributeValue)Sets attribute by providing the name and value pair; the name is used as the hash key.voidsetCommandType(java.lang.String commandType)Sets the command type in the LCR.voidsetMessageTrackingLabel(java.lang.String messageTrackingLabel)Sets the message tracking label of the LCR.voidsetObjectName(java.lang.String objectName)Sets the name of the object that is changed by the LCR.voidsetObjectOwner(java.lang.String objectOwner)Sets the owner of the object that is changed by the LCR .voidsetPosition(byte[] position)Sets the position in the LCR.voidsetRootName(java.lang.String rootName)Sets the root name of the LCR.voidsetSourceDatabaseName(java.lang.String name)Sets the source database name of the object that is changed by the LCR.voidsetSourceTime(oracle.sql.DATE sourceTime)Sets the source timestamp when the LCR was created.voidsetTag(byte[] tag)Sets the LCR tag information.voidsetTransactionId(java.lang.String transactionId)Sets the transaction identifier for the LCR.
-
-
-
Method Detail
-
setSourceDatabaseName
public void setSourceDatabaseName(java.lang.String name)
Sets the source database name of the object that is changed by the LCR.
The source database is the database where the change originated.- Specified by:
setSourceDatabaseNamein interfaceLCR- Parameters:
name- The source database name in String format. Set this parameter to a non-NULL value.
-
setCommandType
public void setCommandType(java.lang.String commandType)
Sets the command type in the LCR.
See Oracle Call Interface reference manual for complete command type definition.- Specified by:
setCommandTypein interfaceLCR- Parameters:
commandType- The command type of an LCR. Set this parameter to a non-NULL value.
-
setObjectOwner
public void setObjectOwner(java.lang.String objectOwner)
Sets the owner of the object that is changed by the LCR .- Specified by:
setObjectOwnerin interfaceLCR- Parameters:
objectOwner- The object owner. Set this parameter to a non-NULL value.
-
setObjectName
public void setObjectName(java.lang.String objectName)
Sets the name of the object that is changed by the LCR.- Specified by:
setObjectNamein interfaceLCR- Parameters:
objectName- The name of the database object. Set this parameter to a non-NULL value.
-
setTag
public void setTag(byte[] tag)
Sets the LCR tag information.
A binary tag that enables tracking of the LCR. For example, this tag can be used to determine the original source database of the DML or DDL statement when apply forwarding is used.
See "Oracle Streams Replication Administrator's Guide" for more information about tags
-
setPosition
public void setPosition(byte[] position)
Sets the position in the LCR.
The position uniquely identifies each LCR in an LCR stream.- Specified by:
setPositionin interfaceLCR- Parameters:
position- A byte array that represents the LCR position. Set this parameter to a non-NULL value and ensure that the position is byte comparable and is strictly increasing.
-
setTransactionId
public void setTransactionId(java.lang.String transactionId)
Sets the transaction identifier for the LCR.
See Oracle Call Interface reference manual for the format of transactionId.- Specified by:
setTransactionIdin interfaceLCR- Parameters:
transactionId- The identifier of the transaction
-
setSourceTime
public void setSourceTime(oracle.sql.DATE sourceTime)
Sets the source timestamp when the LCR was created.
The source time is the time when the change in an LCR captured by a capture process was generated in the redo log of the source database, or the time when a persistent LCR was created.- Specified by:
setSourceTimein interfaceLCR- Parameters:
sourceTime- The srouce time in the form of oracle.sql.DATE
-
setAttribute
public void setAttribute(java.lang.Object attributeName, java.lang.Object attributeValue)Sets attribute by providing the name and value pair; the name is used as the hash key.
This method sets the attributes in an LCR.- Specified by:
setAttributein interfaceLCR- Parameters:
attributeName- The name of the attributeattributeValue- The value of the attribute
-
setMessageTrackingLabel
public void setMessageTrackingLabel(java.lang.String messageTrackingLabel) throws StreamsExceptionSets the message tracking label of the LCR.
You can use the SET_MESSAGE_TRACKING procedure in the DBMS_STREAMS_ADM package to track an LCR as it flows through a stream. See Oracle Streams Replication Administrator's Guide for information about setting message tracking labels.- Parameters:
messageTrackingLabel- The message tracking label- Throws:
StreamsException- If error occurs when obtaining message tracking label
-
getSourceDatabaseName
public java.lang.String getSourceDatabaseName()
Gets the global name of the source database.
The source database is the database where the change originated.- Specified by:
getSourceDatabaseNamein interfaceLCR- Returns:
- A string containing source database name
-
getCommandType
public java.lang.String getCommandType()
Gets the LCR command type executed in the DML or DDL statement. See Oracle Call Interface reference manual for complete command type definition.- Specified by:
getCommandTypein interfaceLCR- Returns:
- A string containing comand type
-
getObjectOwner
public java.lang.String getObjectOwner()
Gets the owner of the object that is changed by the LCR.
The owner is the user who owns the object on which the row change ocurred or the DDL statement was executed.- Specified by:
getObjectOwnerin interfaceLCR- Returns:
- A string containing the owner
-
getObjectName
public java.lang.String getObjectName()
Gets the name of the object that is changed by the LCR.
The name of the database object on which the DDL or DML statement was executed.- Specified by:
getObjectNamein interfaceLCR- Returns:
- A string containing the name
-
getTag
public byte[] getTag()
Gets the tag for the LCR.
A binary tag that enables tracking of the LCR. For example, this tag can be used to determine the original source database of the DML or DDL statement when apply forwarding is used.
-
getPosition
public byte[] getPosition()
Gets the position of the current LCR.
A byte array that uniquely identifies an LCR in the stream and is in strictly increasing order.- Specified by:
getPositionin interfaceLCR- Returns:
- A byte array that represents the LCR position
-
getTransactionId
public java.lang.String getTransactionId()
Gets the transaction identifier of the LCR.
See Oracle Call Interface reference manual for the format of transactionId.- Specified by:
getTransactionIdin interfaceLCR- Returns:
- A string containing the transaction id
-
getSourceTime
public oracle.sql.DATE getSourceTime()
Gets the time when the LCR was created.
Source time is the timestamp when the LCR was generated at source database.- Specified by:
getSourceTimein interfaceLCR- Returns:
- The source time object, an instance of oracle.sql.DATE.
-
getAttribute
public java.lang.Object getAttribute(java.lang.Object attributeName)
Gets the attribute by specifying the attribute name.
This method gets the attributes in an LCR.- Specified by:
getAttributein interfaceLCR- Parameters:
attributeName- The attribute name- Returns:
- The attribte value object
-
getSCN
public oracle.sql.NUMBER getSCN()
Gets the SCN of the current LCR in the format of oracle.sql.NUMBER.
The LCR SCN is the system change number when the LCR is generated at source database.- Returns:
- The SCN in the format of oracle.sql.NUMBER.
-
getCommitSCN
public oracle.sql.NUMBER getCommitSCN()
Gets the LCR commit system change number (SCN) in the format of oracle.sql.NUMBER.
The LCR commit SCN is the SCN when the transaction to which the LCR belongs committed at the source database.- Returns:
- The commit SCN in the format of oracle.sql.NUMBER.
-
getNumAttributes
public int getNumAttributes()
Gets the total number of attributes in the LCR.- Returns:
- The total number of attributes.
-
getAttributesList
public java.lang.Object[] getAttributesList()
Gets the list of attribute name and value pairs in the LCR.- Returns:
- An array of attribute entries.
-
getAttributeName
public java.lang.Object getAttributeName(int index)
Gets the attribute name in the LCR attributes list by position.- Parameters:
index- The atribute name's index.- Returns:
- The attribute name
-
getAttributeValue
public java.lang.Object getAttributeValue(int index)
Gets the attribute value in the LCR attributes list by position.- Parameters:
index- The atribute name's index.- Returns:
- The attribute value
-
getMessageTrackingLabel
public java.lang.String getMessageTrackingLabel() throws StreamsExceptionGets the message tracking label of the LCR.
You can use the SET_MESSAGE_TRACKING procedure in the DBMS_STREAMS_ADM package to track an LCR as it flows through a stream. See Oracle Streams Replication Administrator's Guide for information about setting message tracking labels.- Returns:
- A string contains the message tracking label
- Throws:
StreamsException- If error occurs when obtaining message tracking label
-
getRootName
public java.lang.String getRootName() throws StreamsExceptionGets the root name of the LCR.- Returns:
- A string contains the root name of the LCR.
- Throws:
StreamsException- If error occurs when obtaining root name.
-
setRootName
public void setRootName(java.lang.String rootName) throws StreamsExceptionSets the root name of the LCR.- Parameters:
rootName- The message tracking label- Throws:
StreamsException- If error occurs when obtaining message tracking label
-
-