com.continuent.tungsten.replicator.extractor.oracle
Class OracleCDCExtractor

java.lang.Object
  extended by com.continuent.tungsten.replicator.extractor.oracle.OracleCDCExtractor
All Implemented Interfaces:
RawExtractor, ReplicatorPlugin

public class OracleCDCExtractor
extends java.lang.Object
implements RawExtractor

Version:
1.0
Author:
Stephane Giron

Constructor Summary
OracleCDCExtractor()
           
 
Method Summary
 void configure(PluginContext context)
          Complete plug-in configuration.
 DBMSEvent extract()
          Extract the next available DBMSEvent from the database log.
 DBMSEvent extract(java.lang.String eventId)
          Extract starting after the event ID provided as an argument.
 java.lang.String getCurrentResourceEventId()
          Returns the last event ID committed in the database from which we are extracting.
 void prepare(PluginContext context)
          Prepare plug-in for use.
 void release(PluginContext context)
          Release all resources used by plug-in.
 void setLastEventId(java.lang.String eventId)
          Set the value of the last event ID we have processed.
 void setPassword(java.lang.String password)
           
 void setUrl(java.lang.String url)
           
 void setUser(java.lang.String user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleCDCExtractor

public OracleCDCExtractor()
Method Detail

setUrl

public void setUrl(java.lang.String url)

setUser

public void setUser(java.lang.String user)

setPassword

public void setPassword(java.lang.String password)

configure

public void configure(PluginContext context)
               throws ReplicatorException,
                      java.lang.InterruptedException
Complete plug-in configuration. This is called after setters are invoked at the time that the replicator goes through configuration.

Specified by:
configure in interface ReplicatorPlugin
Throws:
ReplicatorException - Thrown if configuration is incomplete or fails
java.lang.InterruptedException
See Also:
ReplicatorPlugin.configure(com.continuent.tungsten.replicator.plugin.PluginContext)

prepare

public void prepare(PluginContext context)
             throws ReplicatorException,
                    java.lang.InterruptedException
Prepare plug-in for use. This method is assumed to allocate all required resources. It is called before the plug-in performs any operations.

Specified by:
prepare in interface ReplicatorPlugin
Throws:
ReplicatorException - Thrown if resource allocation fails
java.lang.InterruptedException
See Also:
ReplicatorPlugin.prepare(com.continuent.tungsten.replicator.plugin.PluginContext)

release

public void release(PluginContext context)
             throws ReplicatorException,
                    java.lang.InterruptedException
Release all resources used by plug-in. This is called before the plug-in is deallocated.

Specified by:
release in interface ReplicatorPlugin
Throws:
ReplicatorException - Thrown if resource deallocation fails
java.lang.InterruptedException
See Also:
ReplicatorPlugin.release(com.continuent.tungsten.replicator.plugin.PluginContext)

setLastEventId

public void setLastEventId(java.lang.String eventId)
                    throws ReplicatorException
Set the value of the last event ID we have processed. The extractor is responsible for returning the next event ID in sequence after this one the next time extract() is called.

Specified by:
setLastEventId in interface RawExtractor
Parameters:
eventId - Event ID at which to begin extracting
Throws:
ReplicatorException
See Also:
RawExtractor.setLastEventId(java.lang.String)

extract

public DBMSEvent extract()
                  throws ReplicatorException,
                         java.lang.InterruptedException
Extract the next available DBMSEvent from the database log.

Specified by:
extract in interface RawExtractor
Returns:
next DBMSEvent found in the logs
Throws:
ReplicatorException
java.lang.InterruptedException
See Also:
RawExtractor.extract()

extract

public DBMSEvent extract(java.lang.String eventId)
                  throws ReplicatorException,
                         java.lang.InterruptedException
Extract starting after the event ID provided as an argument. This is equivalent to invoking setLastEventId() followed by extract().

Specified by:
extract in interface RawExtractor
Parameters:
eventId - Event ID at which to begin extracting
Returns:
DBMSEvent corresponding to the id
Throws:
ReplicatorException - Thrown if extractor processing fails
java.lang.InterruptedException - Thrown if the applier is interrupted
See Also:
RawExtractor.extract(java.lang.String)

getCurrentResourceEventId

public java.lang.String getCurrentResourceEventId()
                                           throws ReplicatorException,
                                                  java.lang.InterruptedException
Returns the last event ID committed in the database from which we are extracting. It is used to help synchronize state between the database and the transaction history log. Values returned from this call must correspond with the last extracted DBMSEvent.eventId as follows:
  1. If the returned value is greater than DBMSEvent.eventId, the database has more recent updates
  2. If the returned value is equal to DBMSEvent.eventId, all events have been extracted
It should not be possible to receive a value that is less than the last extracted DBMSEvent.eventId as this implies that the extractor is somehow ahead of the state of the database, which would be inconsistent.

Specified by:
getCurrentResourceEventId in interface RawExtractor
Returns:
A current event ID that can be compared with event IDs in DBMSEvent
Throws:
ReplicatorException
java.lang.InterruptedException
See Also:
RawExtractor.getCurrentResourceEventId()