org.geotools.data.store
Class TypeDiffState

Object
  extended by TypeDiffState
All Implemented Interfaces:
Transaction.State

public class TypeDiffState
extends Object
implements Transaction.State

A Transaction.State that keeps a difference table.

This implementation is backed by memory, please feel free to make a scalable implementation backed by a temporary file.

Author:
Jody Garnett, Refractions Research
Module:

Constructor Summary
TypeDiffState(ActiveTypeEntry typeEntry)
           
 
Method Summary
 void addAuthorization(String AuthID)
          Call back used for Transaction.setAuthorization()
 void commit()
          Will apply differences to store.
 Diff diff()
           
 FeatureReader<SimpleFeatureType,SimpleFeature> reader()
          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 setTransaction is called with non null transaction when Transaction.State is putState into a Transaction.
 FeatureWriter<SimpleFeatureType,SimpleFeature> writer()
          Convience Method for a Transaction based FeatureWriter Constructs a DiffFeatureWriter that works against this Transaction.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeDiffState

public TypeDiffState(ActiveTypeEntry typeEntry)
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

diff

public Diff diff()
          throws IOException
Throws:
IOException

addAuthorization

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

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

commit

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

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

rollback

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

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

reader

public FeatureReader<SimpleFeatureType,SimpleFeature> reader()
                                                      throws IOException
Convience Method for a Transaction based FeatureReader.

Constructs a DiffFeatureReader that works against this Transaction.

Returns:
FeatureReader the mask orgional contents with against the current Differences recorded by the Tansasction State
Throws:
IOException - If typeName is not Manged by this Tansaction State

writer

public FeatureWriter<SimpleFeatureType,SimpleFeature> writer()
                                                      throws IOException
Convience Method for a Transaction based FeatureWriter

Constructs a DiffFeatureWriter that works against this Transaction.

Returns:
A FeatureWriter that records Differences against a FeatureReader
Throws:
IOException - If a FeatureRader could not be constucted to record differences against


Copyright © 1996-2009 Geotools. All Rights Reserved.