|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDefaultTransaction
public class DefaultTransaction
Quick implementation of Transaction api.
Please see Transaction interface for an outline of what this class is all about.
modules/library/main (gt-main.jar)
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface Transaction |
---|
Transaction.State |
Field Summary | |
---|---|
protected static Logger |
LOGGER
The logger for the data module. |
Fields inherited from interface Transaction |
---|
AUTO_COMMIT |
Constructor Summary | |
---|---|
DefaultTransaction()
|
|
DefaultTransaction(String handle)
|
Method Summary | |
---|---|
void |
addAuthorization(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. |
protected void |
finalize()
|
Set |
getAuthorizations()
The current set of Authorization IDs held by this Transaction. |
Object |
getProperty(Object key)
Implementation of getProperty. |
Transaction.State |
getState(Object key)
Returns externalized state or null if not available. |
void |
putProperty(Object key,
Object value)
Implementation of addProperty. |
void |
putState(Object key,
Transaction.State state)
Remembers Externalized State for a DataSource. |
void |
removeState(Object key)
Removes state from DefaultTransaction's care. |
void |
rollback()
Rollsback all modifications against this Transaction. |
String |
toString()
|
Methods inherited from class Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final Logger LOGGER
Constructor Detail |
---|
public DefaultTransaction()
public DefaultTransaction(String handle)
Method Detail |
---|
public void putState(Object key, Transaction.State state)
This is the GOF Momento pattern: a FeatureSource
In addition several FeatureSource
putState
in interface Transaction
key
- Key used to externalize Statestate
- Externalized State (Momeneto)
IllegalArgumentException
- When Transaction already using keyTransaction.putState(java.lang.Object,
org.geotools.data.Transaction.State)
public void removeState(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
-
IllegalArgumentException
- If no State was maintained for supplied key
Transaction.removeState(java.lang.Object)
public Transaction.State getState(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 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
IOException
- Encountered problem maintaining transaction state
DataSourceException
- See IOExceptionTransaction.commit()
public void rollback() throws 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
IOException
- Encountered problem maintaining transaction State
DataSourceException
- IOExceptionTransaction.rollback()
public void close()
close
in interface Transaction
public Set getAuthorizations()
This set is reset by the next call to commit or rollback.
getAuthorizations
in interface Transaction
public void addAuthorization(String authID) throws IOException
Remember authorizations are cleared after every commit/rollback.
addAuthorization
in interface Transaction
authID
- Provided Authorization ID
IOException
- Encountered problems maintaing Transaction State
DataSourceException
- See IOExceptionorg.geotools.data.Transaction#setAuthorization(java.lang.String)
public String toString()
toString
in class Object
public Object getProperty(Object key)
getProperty
in interface Transaction
key
- Transaction.getProperty(java.lang.Object)
public void putProperty(Object key, Object value) throws IOException
putProperty
in interface Transaction
key
- value
-
IOException
org.geotools.data.Transaction#addProperty(java.lang.Object, java.lang.Object)
protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |