com.revusky.niggle.data.transaction
Interface TransactionalDataSource

All Superinterfaces:
DataSource, MutableDataSource, java.rmi.Remote

public interface TransactionalDataSource
extends MutableDataSource

An interface that represents the contract of a Niggle DataSource that supports atomic transactions


Method Summary
 void commit(java.lang.String transactionID)
          Commit the transaction that is identified by this transactionID
 void delete(java.lang.String type, java.lang.Object key, java.lang.String transactionID)
          delete the Record of the given type and primary key taking into account the transaction which this is part of.
 Record get(java.lang.String type, java.lang.Object key, java.lang.String transactionID)
           
 void insert(Record rec, java.lang.String transactionID)
          update the Record taking into account the transaction which this is part of.
 java.lang.String newTransaction()
           
 void rollback(java.lang.String transactionID)
          Roll back the transaction
 java.util.List select(java.lang.String type, RecordFilter filter, java.lang.String transactionID)
           
 void update(Record rec, java.lang.String transactionID)
          update the Record taking into account the transaction which this is part of.
 
Methods inherited from interface com.revusky.niggle.data.MutableDataSource
addDataListener, delete, insert, removeDataListener, select, select, update, wipeCache
 
Methods inherited from interface com.revusky.niggle.data.DataSource
close, get, get, getName, getRecords, init, keys, keys
 

Method Detail

insert

public void insert(Record rec,
                   java.lang.String transactionID)
            throws java.io.IOException
update the Record taking into account the transaction which this is part of.

update

public void update(Record rec,
                   java.lang.String transactionID)
            throws java.io.IOException
update the Record taking into account the transaction which this is part of.

delete

public void delete(java.lang.String type,
                   java.lang.Object key,
                   java.lang.String transactionID)
            throws java.io.IOException
delete the Record of the given type and primary key taking into account the transaction which this is part of.

get

public Record get(java.lang.String type,
                  java.lang.Object key,
                  java.lang.String transactionID)
           throws java.io.IOException
Returns:
the Record of the given type and primary key taking into account the transaction which this is part of.

select

public java.util.List select(java.lang.String type,
                             RecordFilter filter,
                             java.lang.String transactionID)
                      throws java.io.IOException
Returns:
a List of records that meet the criterion encapsulated by the filter arg, taking into account the transaction which this is part of.

commit

public void commit(java.lang.String transactionID)
            throws java.io.IOException
Commit the transaction that is identified by this transactionID

rollback

public void rollback(java.lang.String transactionID)
              throws java.io.IOException
Roll back the transaction

newTransaction

public java.lang.String newTransaction()
                                throws java.io.IOException
Returns:
a unique ID for a new transaction.