net.ontopia.topicmaps.db2tm
Class ChangelogReaderWrapper

java.lang.Object
  extended by net.ontopia.topicmaps.db2tm.ChangelogReaderWrapper
All Implemented Interfaces:
ChangelogReaderIF, TupleReaderIF

public class ChangelogReaderWrapper
extends java.lang.Object
implements ChangelogReaderIF

INTERNAL: This tuple reader wraps an underlying tuple reader, and collapses a sequence of actions for the same key into a single final action, using a state machine. Tuples are coming through ordered by key first, then by sequence. We run the changes for each key through a state machine to determine the final action for that key, then move on to the next key.


Field Summary
 
Fields inherited from interface net.ontopia.topicmaps.db2tm.ChangelogReaderIF
CHANGE_TYPE_CREATE, CHANGE_TYPE_DELETE, CHANGE_TYPE_IGNORE, CHANGE_TYPE_UNKNOWN, CHANGE_TYPE_UPDATE
 
Constructor Summary
ChangelogReaderWrapper(ChangelogReaderIF source, int keylength)
           
 
Method Summary
 void close()
          INTERNAL: Releases all resources held by the tuple reader.
 int getChangeType()
          INTERNAL: Returns the type of change that the current tuple went through.
 java.lang.String getOrderValue()
          INTERNAL: Returns the current order value found in the order-column.
 java.lang.String[] readNext()
          INTERNAL: Returns the next tuple.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangelogReaderWrapper

public ChangelogReaderWrapper(ChangelogReaderIF source,
                              int keylength)
Method Detail

getChangeType

public int getChangeType()
Description copied from interface: ChangelogReaderIF
INTERNAL: Returns the type of change that the current tuple went through.

Specified by:
getChangeType in interface ChangelogReaderIF

getOrderValue

public java.lang.String getOrderValue()
Description copied from interface: ChangelogReaderIF
INTERNAL: Returns the current order value found in the order-column. This information is used so that one can keep track of incremental updates.

Specified by:
getOrderValue in interface ChangelogReaderIF

readNext

public java.lang.String[] readNext()
Description copied from interface: TupleReaderIF
INTERNAL: Returns the next tuple. Method will return null when there are no more tuples.

Specified by:
readNext in interface TupleReaderIF

close

public void close()
Description copied from interface: TupleReaderIF
INTERNAL: Releases all resources held by the tuple reader. This method should be called when done with the tuple reader.

Specified by:
close in interface TupleReaderIF


Copyright © 2000-2010 Ontopia.