dke.smwp.serialize
Class SerializeTupleModification

java.lang.Object
  |
  +--dke.smwp.serialize.SerializeTupleModification
Direct Known Subclasses:
SerializeCompleteImpl, SerializeIncrementalImpl

public abstract class SerializeTupleModification
extends java.lang.Object

Base class for all page serialization approaches which covers tuple modifications in fragment class relations and fragmentation relations.

triggeredSerializeFragmentDeletion / -insertion / -modification

Tuple Insertion in Fragmentation Relation:
For every page class the fragment class (whose fragmentation relation was modified) is mapped to a new page (xml document) will be created.

Tuple Deletion in Fragmentation Relation:
For every page class the fragment (class whose fragmentation relation was modified) is mapped to the pages which used the deletes tuples from the fragmentation relation are being deleted.

Tuple Update in Fragmentation Relation:
Updating tuples from fragmentation relation will result in deletion of existing pages, which used the old tuples for parameterization. Pages with the new (updated) tuples are being created.

triggeredSerializeTupleDeletion /- insertion / -modification

Tuples of fragment class relation can belong to none, one or more fragments within the one fragment class. Inserted tuples are being inserted into pages which map the fragment the tuple belongs to. Deleted tuples are removed from those pages. Updated tuples can fall into another fragment, no fragment or stay in the same fragment.

The method pages are being updated is determined by the maintenance mocde defined individually for each page class.

Version:
1.0
Author:
Martin Bernauer, Werner Enser

Field Summary
private static SerializeIncrementalImpl _instance
           
protected static boolean DEBUG
           
 
Constructor Summary
SerializeTupleModification()
           
 
Method Summary
protected static TupleModificationDescr buildModificationDescrObj(FragmentSer frag, java.lang.String rowId, TColumnTable newTuple, int mod)
           
protected static java.util.Hashtable getFragmentParameters(java.sql.Connection con, FragmentClassSer fc, TColumnTable tuple)
          Extracts the fragment parameters from the given tuple that resides within the given fragment class.
static SerializeTupleModification getInstance()
          gets instance of SerializeIncrementalImpl (only one instance exists)
abstract  void serializeFragmentDeletion(java.sql.Connection con, java.lang.String fc_longName, TColumnTable oldTuple)
          deletes published pages (xml documents)
abstract  void serializeFragmentInsertion(java.sql.Connection con, java.lang.String fc_longName, TColumnTable newTuple)
          creates new Page Class/pages as xml documents
abstract  void serializeFragmentModification(java.sql.Connection con, java.lang.String fc_longName, TColumnTable oldTuple, TColumnTable newTuple)
          updates published Page Class/pages (xml documents) by deleting old pages designated by fragmentation parameter values of oldTuple and creating new pages designated by newTuple
abstract  void serializeTupleDeletion(java.sql.Connection con, java.lang.String fcName, java.lang.String rowId, TColumnTable oldTuple)
           
abstract  void serializeTupleInsertion(java.sql.Connection con, java.lang.String fcName, java.lang.String rowId, TColumnTable newTuple)
           
abstract  void serializeTupleModification(java.sql.Connection con, java.lang.String fcName, java.lang.String rowId, TColumnTable oldTuple, TColumnTable newTuple)
          updates Page Class/pages (xml documents)
protected static java.util.Hashtable tupleAsXMLTuple(FragmentSer frag, TColumnTable tuple)
          converts tuple data from TColumn into an Hashtable containing column description QName as key, and tuple data as data;
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

DEBUG

protected static final boolean DEBUG

_instance

private static SerializeIncrementalImpl _instance
Constructor Detail

SerializeTupleModification

public SerializeTupleModification()
Method Detail

getInstance

public static SerializeTupleModification getInstance()
gets instance of SerializeIncrementalImpl (only one instance exists)

serializeFragmentModification

public abstract void serializeFragmentModification(java.sql.Connection con,
                                                   java.lang.String fc_longName,
                                                   TColumnTable oldTuple,
                                                   TColumnTable newTuple)
                                            throws java.io.IOException,
                                                   java.sql.SQLException,
                                                   org.xml.sax.SAXException
updates published Page Class/pages (xml documents) by deleting old pages designated by fragmentation parameter values of oldTuple and creating new pages designated by newTuple
Parameters:
con - Connection handle
fc_longName - name of Fragment Class in which a fragment is updated
oldTuple - fragmentation parameters of old tuple
newTuple - fragmentation parameters of new tuple
Throws:
java.sql.SQLException - fetching data failed
java.io.IOException - writing xml document failed
org.xml.sax.SAXException - creating xml document failed

serializeFragmentInsertion

public abstract void serializeFragmentInsertion(java.sql.Connection con,
                                                java.lang.String fc_longName,
                                                TColumnTable newTuple)
                                         throws java.sql.SQLException,
                                                java.io.IOException,
                                                org.xml.sax.SAXException
creates new Page Class/pages as xml documents
Parameters:
con - Connection handle
fc_longName - name of Fragment Class which gains a new fragment
newTuple - fragmentation parmeters of new fragment
Throws:
java.sql.SQLException - fetching data failed
java.io.IOException - writing xml document failed
org.xml.sax.SAXException - creating xml document failed

serializeTupleDeletion

public abstract void serializeTupleDeletion(java.sql.Connection con,
                                            java.lang.String fcName,
                                            java.lang.String rowId,
                                            TColumnTable oldTuple)
                                     throws java.io.IOException,
                                            java.sql.SQLException,
                                            org.xml.sax.SAXException
Parameters:
con - Connection handle
fcName - name of fragment class relation in which the deletion occured
rowId - rowid of tuple which was deleted
oldTuple - old tuple
Throws:
java.io.IOException - reading/writing xml document failed
java.sql.SQLException - fetching data failed
org.xml.sax.SAXException - updating xml document failed

serializeTupleInsertion

public abstract void serializeTupleInsertion(java.sql.Connection con,
                                             java.lang.String fcName,
                                             java.lang.String rowId,
                                             TColumnTable newTuple)
                                      throws java.io.IOException,
                                             java.sql.SQLException,
                                             org.xml.sax.SAXException
Parameters:
con - Connection handle
fcName - name of fragment class relation in which the update occurred
rowId - rowid of tuple which was inserted
newTuple - new tuple
Throws:
java.io.IOException - reading/writing xml document failed
java.sql.SQLException - fetching data failed
org.xml.sax.SAXException - updating xml document failed

serializeTupleModification

public abstract void serializeTupleModification(java.sql.Connection con,
                                                java.lang.String fcName,
                                                java.lang.String rowId,
                                                TColumnTable oldTuple,
                                                TColumnTable newTuple)
                                         throws java.io.IOException,
                                                java.sql.SQLException,
                                                org.xml.sax.SAXException
updates Page Class/pages (xml documents)
Parameters:
con - Connection object
fcName - fragment class name (whose Fragment Class relation was updated)
rowId - row id from the updated tuple
oldTuple - tuple whose data is replaced by the new tuple
newTuple - tuple whose data replaces the old tuple
Throws:
java.io.IOException - reading / writing xml document failed
java.sql.SQLException - fetching data failed
org.xml.sax.SAXException - generating / parsing xml document(s) failed

serializeFragmentDeletion

public abstract void serializeFragmentDeletion(java.sql.Connection con,
                                               java.lang.String fc_longName,
                                               TColumnTable oldTuple)
                                        throws java.io.IOException,
                                               java.sql.SQLException,
                                               org.xml.sax.SAXException
deletes published pages (xml documents)
Parameters:
con - Connection handle
fc_longName - name of Fragment Class where a fragment is being deleted
oldTuple - fragmentation parameters for fragment, which is to be deleted
Throws:
java.io.IOException - reading / writing xml document failed
java.sql.SQLException - fetching data failed
org.xml.sax.SAXException - generating / parsing xml document(s) failed

getFragmentParameters

protected static java.util.Hashtable getFragmentParameters(java.sql.Connection con,
                                                           FragmentClassSer fc,
                                                           TColumnTable tuple)
                                                    throws java.sql.SQLException
Extracts the fragment parameters from the given tuple that resides within the given fragment class. Since a tuple always contains all parameters the amount of contained parameters in tuple equals the amount of the fragment class' parameters.
Parameters:
con - Connection handle
fc - fragment class
tuple - tuple whose parameter values are extracted
Returns:
fragment parameters in the form of a Hashtable, a key corresponds to a parameter name, and a value to a parameter's actual value.
Throws:
java.sql.SQLException - error accessing tuple object

tupleAsXMLTuple

protected static java.util.Hashtable tupleAsXMLTuple(FragmentSer frag,
                                                     TColumnTable tuple)
                                              throws java.sql.SQLException
converts tuple data from TColumn into an Hashtable containing column description QName as key, and tuple data as data;
Parameters:
frag - fragment class providing namespace for tuple;
tuple - contains tuple description and tuple data;
Returns:
Hashtable tuple data using QName for column as key and tuple data as data
Throws:
java.sql.SQLException -  

buildModificationDescrObj

protected static TupleModificationDescr buildModificationDescrObj(FragmentSer frag,
                                                                  java.lang.String rowId,
                                                                  TColumnTable newTuple,
                                                                  int mod)
                                                           throws java.sql.SQLException
Parameters:
frag - fragment class
rowId - rowid of tuple which was modificated
newTuple - new tuple
mod - type of tuple modification (insert, delete, update)
Returns:
modification description object
Throws:
java.sql.SQLException -