|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Extends geotools2 DataSource to account for transaction support.
The goal of this class is to support "strong transactions", that is expose a locking mechanism that can be backed by a Database. The reference use of this DataSource extension is GeoServer. This project can be seen as GeoServer giving back some useful code to geotools2 for general reuse.
The Plan for this refactoring is:SELECT FOR UPDATE:
for per transaction locking
|
|
|
Method Summary | |
void |
lockFeatures()
Lock all Features. |
void |
lockFeatures(Filter filter)
Lock features described by Filter. |
void |
lockFeatures(Query query)
Lock features described by Query. |
void |
setAuthorization(java.lang.String[] locksIds)
Provides a set of Lock ids this Transaction can use for authorization. |
void |
setCurrentLock(Lock lock)
All locking operations will operate against the provided Lock. |
void |
unLockFeatures()
Unlocks all Features. |
void |
unLockFeatures(Filter filter)
Unlock Features denoted by provided filter. |
void |
unLockFeatures(Query query)
Unlock Features denoted by provided query. |
Methods inherited from interface org.geotools.data.DataSource |
abortLoading, addFeatures, commit, getAutoCommit, getBounds, getFeatures, getFeatures, getFeatures, getFeatures, getFeatures, getMetaData, getSchema, modifyFeatures, modifyFeatures, removeFeatures, rollback, setAutoCommit, setFeatures |
Method Detail |
public void setCurrentLock(Lock lock)
This in in keeping with the stateful spirit of DataSource in which operations are against the "current" transaction. If a Lock is not provided lock operations will only be applicable for the current transaction (they will expire on the next commit or rollback).
That is lock() and getFeaturesWithLock() operations will:This design allows for the following:
public void lockFeatures(Query query) throws DataSourceException
This is an All or nothing operartion - to implement parcial Locking retrieve the features with a query operation first before trying to lock them individually.
query
- Query describing the features to lock
DataSourceException
- Thrown if anything goes wrongpublic void lockFeatures(Filter filter) throws DataSourceException
This is an All or nothing operartion - to implement parcial Locking retrieve the features with a Filter operation first before trying to lock them individually.
filter
- Filter describing the features to lock
DataSourceException
- Thrown if anything goes wrongpublic void lockFeatures() throws DataSourceException
The method does not prevent addFeatures() from being used (we could add a lockDataSource() method if this functionality is required.
DataSourceException
public void setAuthorization(java.lang.String[] locksIds)
All proceeding modifyFeatures and removeFeature operations will make use of the provided authorization.
That is operations will only succeed if affected features are:
locksIds
- LockIds for Long Transaction operationspublic void unLockFeatures() throws DataSourceException
Authorization must be provided prior before calling this method.
|
DataSourceException
public void unLockFeatures(Filter filter) throws DataSourceException
Authorization must be provided prior before calling this method.
filter
-
DataSourceException
public void unLockFeatures(Query query) throws DataSourceException
Authorization must be provided prior before calling this method.
query
- Specifies fatures to unlock
DataSourceException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |