de.topicmapslab.majortom.database.transaction
Class TransactionCommand

java.lang.Object
  extended by de.topicmapslab.majortom.database.transaction.TransactionCommand

public class TransactionCommand
extends java.lang.Object

Author:
Sven Krosse

Field Summary
private  de.topicmapslab.majortom.model.core.IConstruct context
          the context of operation
private  TransactionOperation operation
          the operation type
private  java.lang.Object[] parameters
          the parameters
private  de.topicmapslab.majortom.model.store.TopicMapStoreParameterType paramterType
          the parameter type
private  java.lang.Object result
          the result of operation
 
Constructor Summary
TransactionCommand(de.topicmapslab.majortom.model.transaction.ITransaction transaction, java.lang.Object result, TransactionOperation operation, de.topicmapslab.majortom.model.core.IConstruct context, de.topicmapslab.majortom.model.store.TopicMapStoreParameterType parameterType, java.lang.Object... parameters)
           
 
Method Summary
private  java.lang.Object cleanParameter(de.topicmapslab.majortom.model.store.ITopicMapStore store, java.lang.Object parameter, java.util.Map<java.lang.Object,java.lang.Object> lazy)
           
 java.lang.Object commit(de.topicmapslab.majortom.model.store.ITopicMapStore store, java.util.Map<java.lang.Object,java.lang.Object> lazy)
          Commit the transaction store to the given topic map store.
 java.lang.Object getResult()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operation

private final TransactionOperation operation
the operation type


context

private final de.topicmapslab.majortom.model.core.IConstruct context
the context of operation


paramterType

private final de.topicmapslab.majortom.model.store.TopicMapStoreParameterType paramterType
the parameter type


parameters

private final java.lang.Object[] parameters
the parameters


result

private final java.lang.Object result
the result of operation

Constructor Detail

TransactionCommand

public TransactionCommand(de.topicmapslab.majortom.model.transaction.ITransaction transaction,
                          java.lang.Object result,
                          TransactionOperation operation,
                          de.topicmapslab.majortom.model.core.IConstruct context,
                          de.topicmapslab.majortom.model.store.TopicMapStoreParameterType parameterType,
                          java.lang.Object... parameters)
Method Detail

commit

public java.lang.Object commit(de.topicmapslab.majortom.model.store.ITopicMapStore store,
                               java.util.Map<java.lang.Object,java.lang.Object> lazy)
                        throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
Commit the transaction store to the given topic map store.

Parameters:
store - the topic map store
lazy - a lazy map containing the mapping between the transaction stubs and the real construct
Returns:
the created item if operation is TransactionOperation.CREATE, null otherwise.
Throws:
de.topicmapslab.majortom.model.exception.TopicMapStoreException - thrown if operation fails

getResult

public java.lang.Object getResult()
Returns:
the result

cleanParameter

private final java.lang.Object cleanParameter(de.topicmapslab.majortom.model.store.ITopicMapStore store,
                                              java.lang.Object parameter,
                                              java.util.Map<java.lang.Object,java.lang.Object> lazy)