org.mmbase.module.core
Class TransactionManager

java.lang.Object
  extended byorg.mmbase.module.core.TransactionManager
All Implemented Interfaces:
TransactionManagerInterface

public class TransactionManager
extends Object
implements TransactionManagerInterface

Version:
$Id: TransactionManager.java,v 1.34 2006/07/06 11:24:44 michiel Exp $
Author:
Rico Jansen
Warning: No Java Documentation Available.

Field Summary
static String EXISTS_NO
           
static String EXISTS_NOLONGER
           
static String EXISTS_YES
           
static int I_EXISTS_NO
           
static int I_EXISTS_NOLONGER
           
static int I_EXISTS_YES
           
protected  TransactionResolver transactionResolver
           
protected  Map transactions
           
 
Constructor Summary
TransactionManager(MMBase mmbase, TemporaryNodeManagerInterface tmpn)
           
 
Method Summary
 String addNode(String transactionName, String owner, String tmpnumber)
           
 String cancel(Object user, String transactionName)
           
 String commit(Object user, String transactionName)
           
 String create(Object user, String transactionName)
          Deprecated. Use createTransaction(java.lang.String)
 Collection createTransaction(String transactionName)
          Creates transaction with given name.
 String deleteObject(String transactionName, String owner, String tmpnumber)
           
protected  Collection deleteTransaction(String transactionName)
          Removes the transaction with given name
 String findUserName(Object user)
           
 Collection get(Object user, String transactionName)
          Deprecated. use getTransaction(java.lang.String)
 Vector getNodes(Object user, String transactionName)
          Deprecated. use getTransaction(java.lang.String)
 Collection getTransaction(String transactionName)
          Returns transaction with given name.
 String removeNode(String transactionName, String owner, String tmpnumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXISTS_NO

public static final String EXISTS_NO
See Also:
Constant Field Values

I_EXISTS_NO

public static final int I_EXISTS_NO
See Also:
Constant Field Values

EXISTS_YES

public static final String EXISTS_YES
See Also:
Constant Field Values

I_EXISTS_YES

public static final int I_EXISTS_YES
See Also:
Constant Field Values

EXISTS_NOLONGER

public static final String EXISTS_NOLONGER
See Also:
Constant Field Values

I_EXISTS_NOLONGER

public static final int I_EXISTS_NOLONGER
See Also:
Constant Field Values

transactions

protected Map transactions

transactionResolver

protected TransactionResolver transactionResolver
Constructor Detail

TransactionManager

public TransactionManager(MMBase mmbase,
                          TemporaryNodeManagerInterface tmpn)
Method Detail

getTransaction

public Collection getTransaction(String transactionName)
                          throws TransactionManagerException
Returns transaction with given name.

Parameters:
transactionName - The name of the transaction to return
Returns:
Collection containing the nodes in this transaction (as MMObjectNodes).
Throws:
TransactionManagerExcpeption - if the transaction with given name does not exist
TransactionManagerException

createTransaction

public Collection createTransaction(String transactionName)
                             throws TransactionManagerException
Creates transaction with given name.

Parameters:
transactionName - The name of the transaction to return
Returns:
Collection containing the nodes in this transaction (so, this is an empty collection)
Throws:
TransactionManagerExcpeption - if the transaction with given name existed already
TransactionManagerException

deleteTransaction

protected Collection deleteTransaction(String transactionName)
Removes the transaction with given name

Returns:
the collection with nodes from the removed transaction or null if no transaction with this name existed

getNodes

public Vector getNodes(Object user,
                       String transactionName)
Deprecated. use getTransaction(java.lang.String)

Specified by:
getNodes in interface TransactionManagerInterface

create

public String create(Object user,
                     String transactionName)
              throws TransactionManagerException
Deprecated. Use createTransaction(java.lang.String)

Creates a new transaction with given name

Specified by:
create in interface TransactionManagerInterface
Parameters:
user - This parameter is ignored (WTF!)
transactionName - The name of the transaction to create
Returns:
transactionName
Throws:
TransactionManagerExcpeption - if the transaction with given name already existed
TransactionManagerException

get

public Collection get(Object user,
                      String transactionName)
               throws TransactionManagerException
Deprecated. use getTransaction(java.lang.String)

Returns the (existing) transaction with given name.

Parameters:
user - This parameter is ignored (WTF!)
transactionName - The name of the transaction to return
Throws:
TransactionManagerExcpeption - if the transaction with given name does not exist
TransactionManagerException

addNode

public String addNode(String transactionName,
                      String owner,
                      String tmpnumber)
               throws TransactionManagerException
Specified by:
addNode in interface TransactionManagerInterface
Throws:
TransactionManagerException

removeNode

public String removeNode(String transactionName,
                         String owner,
                         String tmpnumber)
                  throws TransactionManagerException
Specified by:
removeNode in interface TransactionManagerInterface
Throws:
TransactionManagerException

deleteObject

public String deleteObject(String transactionName,
                           String owner,
                           String tmpnumber)
                    throws TransactionManagerException
Specified by:
deleteObject in interface TransactionManagerInterface
Throws:
TransactionManagerException

cancel

public String cancel(Object user,
                     String transactionName)
              throws TransactionManagerException
Specified by:
cancel in interface TransactionManagerInterface
Throws:
TransactionManagerException

commit

public String commit(Object user,
                     String transactionName)
              throws TransactionManagerException
Specified by:
commit in interface TransactionManagerInterface
Throws:
TransactionManagerException

findUserName

public String findUserName(Object user)
Specified by:
findUserName in interface TransactionManagerInterface


MMBase build 1.8.1.20060716