Package org.geotools.data.store
Class DiffTransactionState
Object
DiffTransactionState
- All Implemented Interfaces:
Transaction.State
Transaction state responsible for holding an in memory
Diff
of any modifications.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Diff
protected ContentState
ContentState for this transaction used to hold information for FeatureReader implementationsprotected Transaction
The transaction (ie session) associated with this state -
Constructor Summary
ConstructorsModifierConstructorDescriptionDiffTransactionState
(ContentState state) Transaction state responsible for holding an in memoryDiff
.protected
DiffTransactionState
(ContentState state, Diff diff) Transaction state responsible for holding an in memoryDiff
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAuthorization
(String AuthID) Call back used for Transaction.setAuthorization()void
commit()
Will apply differences to store.diffWriter
(ContentFeatureStore contentFeatureStore, FeatureReader<SimpleFeatureType, SimpleFeature> reader) Provides a wrapper on the provided reader which gives a diff writer.getDiff()
Access the in memory Diff.void
rollback()
Call back used for Transaction.rollback()void
setTransaction
(Transaction transaction) We are already holding onto our transaction from ContentState; however this method does check that the transaction is correct.
-
Field Details
-
diff
-
transaction
The transaction (ie session) associated with this state -
state
ContentState for this transaction used to hold information for FeatureReader implementations
-
-
Constructor Details
-
Method Details
-
getDiff
Access the in memory Diff.- Returns:
- in memory diff.
-
setTransaction
We are already holding onto our transaction from ContentState; however this method does check that the transaction is correct.- Specified by:
setTransaction
in interfaceTransaction.State
-
commit
Will apply differences to store.The provided diff will be modified as the differences are applied, If the operations are all successful diff will be empty at the end of this process.
diff can be used to represent the following operations:
- fid|null: represents a fid being removed
- fid|feature: where fid exists, represents feature modification
- fid|feature: where fid does not exist, represents feature being modified
- Specified by:
commit
in interfaceTransaction.State
- Throws:
IOException
- If the entire diff cannot be writen out- See Also:
-
rollback
Description copied from interface:Transaction.State
Call back used for Transaction.rollback()- Specified by:
rollback
in interfaceTransaction.State
- Throws:
IOException
- See Also:
-
addAuthorization
Description copied from interface:Transaction.State
Call back used for Transaction.setAuthorization()- Specified by:
addAuthorization
in interfaceTransaction.State
- Throws:
IOException
- See Also:
-
diffWriter
public FeatureWriter<SimpleFeatureType,SimpleFeature> diffWriter(ContentFeatureStore contentFeatureStore, FeatureReader<SimpleFeatureType, SimpleFeature> reader) Provides a wrapper on the provided reader which gives a diff writer.- Parameters:
contentFeatureStore
- ContentFeatureStorereader
- FeatureReader requiring diff support- Returns:
- FeatureWriter with diff support
-