|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.wfs.v1_0_0.WFSTransactionState
public class WFSTransactionState
Hold the list of actions to perform in the Transaction.
Constructor Summary | |
---|---|
WFSTransactionState(WFS_1_0_0_DataStore ds)
|
Method Summary | |
---|---|
void |
addAction(java.lang.String typeName,
Action a)
|
void |
addAuthorization(java.lang.String AuthID)
Call back used for Transaction.setAuthorization() |
protected void |
combineActions()
Combines updates and inserts reducing the number of actions in the commit. |
void |
commit()
Call back used for Transaction.commit() |
java.util.List |
getActions(java.lang.String typeName)
|
java.util.List |
getAllActions()
Returns all the actions for all FeatureTypes |
java.lang.String[] |
getFids(java.lang.String typeName)
|
java.lang.String |
getLockId()
Not implemented |
java.lang.String |
nextFid(java.lang.String typeName)
|
void |
rollback()
Call back used for Transaction.rollback() |
void |
setTransaction(Transaction transaction)
Provides configuration information for Transaction.State |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WFSTransactionState(WFS_1_0_0_DataStore ds)
ds
- Method Detail |
---|
public void setTransaction(Transaction transaction)
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() ).
setTransaction
in interface Transaction.State
Transaction.State.setTransaction(org.geotools.data.Transaction)
public void addAuthorization(java.lang.String AuthID)
Transaction.State
addAuthorization
in interface Transaction.State
Transaction.State.addAuthorization(java.lang.String)
public java.lang.String getLockId()
public void commit() throws java.io.IOException
Transaction.State
commit
in interface Transaction.State
java.io.IOException
Transaction.State.commit()
public void rollback()
Transaction.State
rollback
in interface Transaction.State
Transaction.State.rollback()
public java.lang.String[] getFids(java.lang.String typeName)
public void addAction(java.lang.String typeName, Action a)
a
- public java.util.List getActions(java.lang.String typeName)
public java.util.List getAllActions()
protected void combineActions()
This is in response to an issue where the FID is not known until after the commit so if a Feature is inserted then later updated(using a FID filter to identify the feature to update) within a single transactin then the commit will fail because the fid filter will be not apply once the insert action is processed.
For Example:
Transaction assigns it the id: NewFeature.
Fid filter is used to update NewFeature.
Update will fail because when the Insert action is processed NewFeature will not refer to any feature.
The algorithm is essentially foreach( insertAction ){ Apply each update and Delete action that applies to the inserted feature move insertAction to end of list }
Mind you this only works assuming there aren't any direct dependencies between the actions beyond the ones specified by the API. For example if the value of an update depends directly on an earlier feature object (which is bad practice and should never be done). Then we may have problems with this solution. But I think that this solution is better than doing nothing because at least in the proper use of the API the correct result will be obtained. Whereas before the correct use of the API could obtain incorrect results.
public java.lang.String nextFid(java.lang.String typeName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |