|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.DefaultTransaction
Quick implementation of Transaction api.
Please see Transaction interface for an outline of what this class is all about.
Nested Class Summary |
Nested classes inherited from class org.geotools.data.Transaction |
Transaction.State |
Field Summary |
Fields inherited from interface org.geotools.data.Transaction |
AUTO_COMMIT |
Constructor Summary | |
DefaultTransaction()
|
|
DefaultTransaction(java.lang.String handle)
|
Method Summary | |
void |
addAuthorization(java.lang.String authID)
Provides an authorization ID allowing access to locked Features. |
void |
close()
Frees all State held by this Transaction. |
void |
commit()
Commits all modifications against this Transaction. |
java.util.Set |
getAuthorizations()
The current set of Authorization IDs held by this Transaction. |
java.lang.Object |
getProperty(java.lang.Object key)
Implementation of getProperty. |
Transaction.State |
getState(java.lang.Object key)
Returns externalized state or null if not available.
|
void |
putProperty(java.lang.Object key,
java.lang.Object value)
Implementation of addProperty. |
void |
putState(java.lang.Object key,
Transaction.State state)
Remembers Externalized State for a DataSource. |
void |
removeState(java.lang.Object key)
Removes state from DefaultTransaction's care. |
void |
rollback()
Rollsback all modifications against this Transaction. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DefaultTransaction()
public DefaultTransaction(java.lang.String handle)
Method Detail |
public void putState(java.lang.Object key, Transaction.State state)
This is the GOF Momento pattern: a FeatureSource is able to externalize its internal State required for Transaction support and have this class manage it. It may retrieve this State with getState( key ).
In addition several FeatureSource implementations may share State, a common example is JDBCDataSources keeping a shared JDBC connection using the JDBC URL as a key.
putState
in interface Transaction
key
- Key used to externalize Statestate
- Externalized State (Momeneto)
java.lang.IllegalArgumentException
- When Transaction already using keyTransaction.putState(java.lang.Object,
org.geotools.data.Transaction.State)
public void removeState(java.lang.Object key)
Currently does not complain if there is no State associated with key to remove - this may change in the future.
removeState
in interface Transaction
key
-
java.lang.IllegalArgumentException
- If no State was maintained for supplied
key
Transaction.removeState(java.lang.Object)
public Transaction.State getState(java.lang.Object key)
null
if not available.
Used by DataStore implementations to externalize information required for Transaction support using the GOF Momento pattern.
getState
in interface Transaction
key
-
Transaction.getState(java.lang.Object)
public void commit() throws java.io.IOException
This implementation will call commit() on all State managed by this Transaction. This allows DataStores to provide their own implementation of commit().
commit
in interface Transaction
java.io.IOException
- Encountered problem maintaining transaction state
DataSourceException
- See IOExceptionTransaction.commit()
public void rollback() throws java.io.IOException
This implementation will call rollback() on all State managed by this Transaction. This allows DataStores to provide their own implementation of rollback().
rollback
in interface Transaction
java.io.IOException
- Encountered problem maintaining transaction State
DataSourceException
- IOExceptionTransaction.rollback()
public void close()
close
in interface Transaction
public java.util.Set getAuthorizations()
This set is reset by the next call to commit or rollback.
getAuthorizations
in interface Transaction
public void addAuthorization(java.lang.String authID) throws java.io.IOException
Remember authorizations are cleared after every commit/rollback.
addAuthorization
in interface Transaction
authID
- Provided Authorization ID
java.io.IOException
- Encountered problems maintaing Transaction State
DataSourceException
- See IOExceptionorg.geotools.data.Transaction#setAuthorization(java.lang.String)
public java.lang.String toString()
public java.lang.Object getProperty(java.lang.Object key)
getProperty
in interface Transaction
key
-
Transaction.getProperty(java.lang.Object)
public void putProperty(java.lang.Object key, java.lang.Object value) throws java.io.IOException
putProperty
in interface Transaction
key
- value
-
java.io.IOException
org.geotools.data.Transaction#addProperty(java.lang.Object, java.lang.Object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |