org.geotools.data
Class TransactionStateDiff

java.lang.Object
  extended byorg.geotools.data.TransactionStateDiff
All Implemented Interfaces:
Transaction.State

public class TransactionStateDiff
extends java.lang.Object
implements Transaction.State

A Transaction.State that keeps a difference table for use with AbstractDataStore.

Author:
Jody Garnett, Refractions Research

Constructor Summary
TransactionStateDiff(AbstractDataStore dataStore)
           
 
Method Summary
 void addAuthorization(java.lang.String AuthID)
          Call back used for Transaction.setAuthorization()
 void commit()
          Will apply differences to store.
 java.util.Map diff(java.lang.String typeName)
           
 FeatureReader reader(java.lang.String typeName)
          Convience Method for a Transaction based FeatureReader.
 void rollback()
          Call back used for Transaction.rollback()
 void setTransaction(Transaction transaction)
          Provides configuration information for Transaction.State
 FeatureWriter writer(java.lang.String typeName)
          Convience Method for a Transaction based FeatureWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionStateDiff

public TransactionStateDiff(AbstractDataStore dataStore)
Method Detail

setTransaction

public void setTransaction(Transaction transaction)
Description copied from interface: Transaction.State
Provides configuration information for Transaction.State

setTransaction is called with non null transaction when Transaction.State is putState into a Transaction. This tranasction will be used to determine correct event notification.

setTransaction is called with null when removeState is called (usually during Transaction.close() ).

Specified by:
setTransaction in interface Transaction.State
Parameters:
transaction -

diff

public java.util.Map diff(java.lang.String typeName)
                   throws java.io.IOException
Throws:
java.io.IOException

addAuthorization

public void addAuthorization(java.lang.String AuthID)
                      throws java.io.IOException
Description copied from interface: Transaction.State
Call back used for Transaction.setAuthorization()

Specified by:
addAuthorization in interface Transaction.State
Throws:
java.io.IOException
See Also:
Transaction.State.addAuthorization(java.lang.String)

commit

public void commit()
            throws java.io.IOException
Will apply differences to store.

Specified by:
commit in interface Transaction.State
Throws:
java.io.IOException
See Also:
Transaction.State.commit()

rollback

public void rollback()
              throws java.io.IOException
Description copied from interface: Transaction.State
Call back used for Transaction.rollback()

Specified by:
rollback in interface Transaction.State
Throws:
java.io.IOException
See Also:
Transaction.State.rollback()

reader

public FeatureReader reader(java.lang.String typeName)
                     throws java.io.IOException
Convience Method for a Transaction based FeatureReader.

Constructs a DiffFeatureReader that works against this Transaction.

Parameters:
typeName - TypeName to aquire a Reader on
Returns:
FeatureReader the mask orgional contents with against the current Differences recorded by the Tansasction State
Throws:
java.io.IOException - If typeName is not Manged by this Tansaction State

writer

public FeatureWriter writer(java.lang.String typeName)
                     throws java.io.IOException
Convience Method for a Transaction based FeatureWriter

Constructs a DiffFeatureWriter that works against this Transaction.

Parameters:
typeName - Type Name to record differences against
Returns:
A FeatureWriter that records Differences against a FeatureReader
Throws:
java.io.IOException - If a FeatureRader could not be constucted to record differences against


Copyright © 1996-2003 GeoTools. All Rights Reserved.