de.topicmapslab.majortom.inmemory.transaction
Class InMemoryTransactionTopicMapStore

java.lang.Object
  extended by de.topicmapslab.majortom.store.TopicMapStoreImpl
      extended by de.topicmapslab.majortom.store.ReadOnlyTopicMapStoreImpl
          extended by de.topicmapslab.majortom.store.ModifableTopicMapStoreImpl
              extended by de.topicmapslab.majortom.inmemory.store.InMemoryTopicMapStore
                  extended by de.topicmapslab.majortom.inmemory.virtual.VirtualTopicMapStore
                      extended by de.topicmapslab.majortom.inmemory.transaction.InMemoryTransactionTopicMapStore
All Implemented Interfaces:
de.topicmapslab.majortom.model.store.ITopicMapStore, de.topicmapslab.majortom.model.transaction.ITransactionTopicMapStore

public class InMemoryTransactionTopicMapStore
extends VirtualTopicMapStore
implements de.topicmapslab.majortom.model.transaction.ITransactionTopicMapStore

Author:
Sven Krosse

Field Summary
private  java.util.List<TransactionCommand> commands
           
private  java.util.LinkedList<TransactionCommand> commited
           
private  de.topicmapslab.majortom.model.transaction.ITransaction transaction
           
 
Fields inherited from class de.topicmapslab.majortom.inmemory.store.InMemoryTopicMapStore
ITEMIDENTIFIER_PREFIX, SUBJECTIDENTIFIER_PREFIX, SUBJECTLOCATOR_PREFIX
 
Fields inherited from class de.topicmapslab.majortom.store.TopicMapStoreImpl
OUTPUT
 
Constructor Summary
InMemoryTransactionTopicMapStore(de.topicmapslab.majortom.model.core.ITopicMapSystem topicMapSystem, de.topicmapslab.majortom.model.store.ITopicMapStore store, de.topicmapslab.majortom.model.transaction.ITransaction transaction)
          constructor
 
Method Summary
 void commit()
          
protected  VirtualAssociationStore<?> createAssociationStore(InMemoryTopicMapStore store)
          Creates the internal association store reference.
protected  VirtualCharacteristicsStore<?> createCharacteristicsStore(InMemoryTopicMapStore store, de.topicmapslab.majortom.model.core.ILocator xsdString)
          Creates the internal characteristic store reference.
protected  VirtualIdentityStore<?> createIdentityStore(InMemoryTopicMapStore store)
          Creates the internal identity store reference.
protected  VirtualReificationStore<?> createReificationStore(InMemoryTopicMapStore store)
          Creates the internal reification store reference.
protected  VirtualScopeStore<?> createScopeStore(InMemoryTopicMapStore store)
          Creates the internal scope store reference.
protected  VirtualTopicTypeStore<?> createTopicTypeStore(InMemoryTopicMapStore store)
          Creates the internal topic-type hierarchy store reference.
protected  VirtualTypedStore<?> createTypedStore(InMemoryTopicMapStore store)
          Creates the internal types store reference.
 java.lang.Object doCreate(de.topicmapslab.majortom.model.core.IConstruct context, de.topicmapslab.majortom.model.store.TopicMapStoreParameterType paramType, java.lang.Object... params)
          
 void doModify(de.topicmapslab.majortom.model.core.IConstruct context, de.topicmapslab.majortom.model.store.TopicMapStoreParameterType paramType, java.lang.Object... params)
          
 java.lang.String doReadId(de.topicmapslab.majortom.model.core.IConstruct c)
          Read the id of the given construct
 void doRemove(de.topicmapslab.majortom.model.core.IConstruct context, boolean cascade)
          
 void doRemove(de.topicmapslab.majortom.model.core.IConstruct context, de.topicmapslab.majortom.model.store.TopicMapStoreParameterType paramType, java.lang.Object... params)
          
 InMemoryIdentity getTopicMapIdentity()
          
 de.topicmapslab.majortom.model.transaction.ITransaction getTransaction()
          
 boolean isRevisionManagementEnabled()
          
 void rollback()
          
 
Methods inherited from class de.topicmapslab.majortom.inmemory.virtual.VirtualTopicMapStore
getAssociationStore, getCharacteristicsStore, getIdentityStore, getRealStore, getReificationStore, getScopeStore, getTopicTypeStore, getTypedStore, removeVirtualConstruct
 
Methods inherited from class de.topicmapslab.majortom.inmemory.store.InMemoryTopicMapStore
addTaskToThreadPool, clear, close, connect, createAssociation, createName, createOccurrence, createRevision, createRevisionStore, createRole, createSupertypeSubtypeAssociation, createTopic, createTopic, createTransaction, createTypeInstanceAssociation, createVariant, doCreateAssociation, doCreateAssociation, doCreateItemIdentifier, doCreateLocator, doCreateName, doCreateName, doCreateName, doCreateName, doCreateOccurrence, doCreateOccurrence, doCreateOccurrence, doCreateOccurrence, doCreateOccurrence, doCreateOccurrence, doCreateRole, doCreateScope, doCreateTopicByItemIdentifier, doCreateTopicBySubjectIdentifier, doCreateTopicBySubjectLocator, doCreateTopicWithoutIdentifier, doCreateVariant, doCreateVariant, doCreateVariant, doMergeTopicMaps, doMergeTopics, doModifyItemIdentifier, doModifyMetaData, doModifyPlayer, doModifyReifier, doModifyScope, doModifySubjectIdentifier, doModifySubjectLocator, doModifySupertype, doModifyTag, doModifyTag, doModifyTopicType, doModifyType, doModifyValue, doModifyValue, doModifyValue, doModifyValue, doReadAssociation, doReadAssociation, doReadAssociation, doReadAssociation, doReadAssociation, doReadAssociation, doReadAssociation, doReadAssociation, doReadBestIdentifier, doReadBestLabel, doReadBestLabel, doReadChangeSet, doReadChangeSetType, doReadCharacteristics, doReadCharacteristics, doReadCharacteristics, doReadCharacteristics, doReadConstruct, doReadConstruct, doReadDataType, doReadFutureRevision, doReadItemIdentifiers, doReadLocator, doReadMetaData, doReadMetaData, doReadNames, doReadNames, doReadNames, doReadNames, doReadOccurrences, doReadOccurrences, doReadOccurrences, doReadOccurrences, doReadPastRevision, doReadPlayer, doReadReification, doReadReification, doReadRevisionTimestamp, doReadRoles, doReadRoles, doReadRoles, doReadRoles, doReadRoles, doReadRoleTypes, doReadScope, doReadSubjectIdentifiers, doReadSubjectLocators, doReadSuptertypes, doReadTopicBySubjectIdentifier, doReadTopicBySubjectLocator, doReadTopics, doReadTopics, doReadType, doReadTypes, doReadValue, doReadValue, doReadValue, doReadVariants, doReadVariants, doRemoveAssociation, doRemoveItemIdentifier, doRemoveName, doRemoveOccurrence, doRemoveRole, doRemoveScope, doRemoveSubjectIdentifier, doRemoveSubjectLocator, doRemoveSupertype, doRemoveTopic, doRemoveTopicMap, doRemoveType, doRemoveVariant, enableCaching, existsTmdmDefaultNameType, existsTmdmInstanceRoleType, existsTmdmSubtypeRoleType, existsTmdmSupertypeRoleType, existsTmdmSupertypeSubtypeAssociationType, existsTmdmTypeInstanceAssociationType, existsTmdmTypeRoleType, getCapacityOfCollections, getIndex, getRevisionStore, getTmdmDefaultNameType, getTmdmInstanceRoleType, getTmdmSubtypeRoleType, getTmdmSupertypeRoleType, getTmdmSupertypeSubtypeAssociationType, getTmdmTypeInstanceAssociationType, getTmdmTypeRoleType, isCachingEnabled, isTopicInUse, isTransactable, mergeTopics, modifyItemIdentifier, modifyReifier, modifySubjectIdentifier, modifySubjectLocator, modifySupertype, modifyTopicType, removeAssociation, removeDuplicates, removeItemIdentifier, removeName, removeOccurrence, removeSubjectIdentifier, removeSubjectLocator, removeSupertype, removeSupertypeSubtypeAssociation, removeTopic, removeTopicType, removeTypeInstanceAssociation, removeVariant, setTopicMapSystem, storeRevision
 
Methods inherited from class de.topicmapslab.majortom.store.ModifableTopicMapStoreImpl
checkMergeConditionOfItemIdentifier, checkMergeConditionOfSubjectIdentifier, checkMergeConditionOfSubjectLocator, checkMergeConstraint, checkReificationConstraintBeforeModification, doMerge, isTopicUsedAsPlayer, isTopicUsedAsReifier, isTopicUsedAsSupertype, isTopicUsedAsTheme, isTopicUsedAsType, storeRevision
 
Methods inherited from class de.topicmapslab.majortom.store.ReadOnlyTopicMapStoreImpl
clearCache, doRead, getCache, internalDoRead
 
Methods inherited from class de.topicmapslab.majortom.store.TopicMapStoreImpl
addTopicMapListener, createConstructFactory, createMetaDataInstance, doAutomaticMerging, doMergingByTopicName, enableRevisionManagement, generateId, generateStringId, getConstructFactory, getListeners, getMetaData, getThreadPool, getTopicMap, getTopicMapBaseLocator, getTopicMapBaseLocatorReference, getTopicMapSystem, initialize, isConnected, isReadOnly, isReificationDeletionRestricted, isRevisionManagementSupported, notifyListeners, recognizingSupertypeSubtypeAssociation, recognizingTypeInstanceAssociation, removeTopicMapListener, setTopicMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.topicmapslab.majortom.model.transaction.ITransactionTopicMapStore
getRealStore
 
Methods inherited from interface de.topicmapslab.majortom.model.store.ITopicMapStore
addTopicMapListener, clear, close, connect, createTransaction, doMerge, doRead, enableCaching, enableRevisionManagement, generateId, getConstructFactory, getIndex, getMetaData, getTopicMap, getTopicMapBaseLocator, getTopicMapBaseLocatorReference, initialize, isCachingEnabled, isConnected, isReadOnly, isRevisionManagementSupported, isTransactable, removeDuplicates, removeTopicMapListener, setTopicMapSystem
 

Field Detail

commands

private java.util.List<TransactionCommand> commands

commited

private java.util.LinkedList<TransactionCommand> commited

transaction

private final de.topicmapslab.majortom.model.transaction.ITransaction transaction
Constructor Detail

InMemoryTransactionTopicMapStore

public InMemoryTransactionTopicMapStore(de.topicmapslab.majortom.model.core.ITopicMapSystem topicMapSystem,
                                        de.topicmapslab.majortom.model.store.ITopicMapStore store,
                                        de.topicmapslab.majortom.model.transaction.ITransaction transaction)
constructor

Parameters:
topicMapSystem - the topic map system
store - the real store
transaction - the transaction
Method Detail

getTransaction

public de.topicmapslab.majortom.model.transaction.ITransaction getTransaction()

Specified by:
getTransaction in interface de.topicmapslab.majortom.model.transaction.ITransactionTopicMapStore

commit

public void commit()
            throws de.topicmapslab.majortom.model.exception.TransactionException

Specified by:
commit in interface de.topicmapslab.majortom.model.store.ITopicMapStore
Specified by:
commit in interface de.topicmapslab.majortom.model.transaction.ITransactionTopicMapStore
Overrides:
commit in class InMemoryTopicMapStore
Throws:
de.topicmapslab.majortom.model.exception.TransactionException

rollback

public void rollback()

Specified by:
rollback in interface de.topicmapslab.majortom.model.transaction.ITransactionTopicMapStore

doModify

public void doModify(de.topicmapslab.majortom.model.core.IConstruct context,
                     de.topicmapslab.majortom.model.store.TopicMapStoreParameterType paramType,
                     java.lang.Object... params)
              throws de.topicmapslab.majortom.model.exception.TopicMapStoreException

Specified by:
doModify in interface de.topicmapslab.majortom.model.store.ITopicMapStore
Overrides:
doModify in class ModifableTopicMapStoreImpl
Throws:
de.topicmapslab.majortom.model.exception.TopicMapStoreException

doRemove

public void doRemove(de.topicmapslab.majortom.model.core.IConstruct context,
                     de.topicmapslab.majortom.model.store.TopicMapStoreParameterType paramType,
                     java.lang.Object... params)
              throws de.topicmapslab.majortom.model.exception.TopicMapStoreException

Specified by:
doRemove in interface de.topicmapslab.majortom.model.store.ITopicMapStore
Overrides:
doRemove in class ModifableTopicMapStoreImpl
Throws:
de.topicmapslab.majortom.model.exception.TopicMapStoreException

doRemove

public void doRemove(de.topicmapslab.majortom.model.core.IConstruct context,
                     boolean cascade)
              throws de.topicmapslab.majortom.model.exception.TopicMapStoreException

Specified by:
doRemove in interface de.topicmapslab.majortom.model.store.ITopicMapStore
Overrides:
doRemove in class ModifableTopicMapStoreImpl
Throws:
de.topicmapslab.majortom.model.exception.TopicMapStoreException

doCreate

public java.lang.Object doCreate(de.topicmapslab.majortom.model.core.IConstruct context,
                                 de.topicmapslab.majortom.model.store.TopicMapStoreParameterType paramType,
                                 java.lang.Object... params)
                          throws de.topicmapslab.majortom.model.exception.TopicMapStoreException

Specified by:
doCreate in interface de.topicmapslab.majortom.model.store.ITopicMapStore
Overrides:
doCreate in class ModifableTopicMapStoreImpl
Throws:
de.topicmapslab.majortom.model.exception.TopicMapStoreException

doReadId

public java.lang.String doReadId(de.topicmapslab.majortom.model.core.IConstruct c)
                          throws de.topicmapslab.majortom.model.exception.TopicMapStoreException
Read the id of the given construct

Overrides:
doReadId in class InMemoryTopicMapStore
Parameters:
c - the construct
Returns:
the read information
Throws:
de.topicmapslab.majortom.model.exception.TopicMapStoreException - thrown if operation fails

createIdentityStore

protected VirtualIdentityStore<?> createIdentityStore(InMemoryTopicMapStore store)
Creates the internal identity store reference.

Specified by:
createIdentityStore in class VirtualTopicMapStore
Parameters:
store - the calling store instance
Returns:
the identityStore

createAssociationStore

protected VirtualAssociationStore<?> createAssociationStore(InMemoryTopicMapStore store)
Creates the internal association store reference.

Specified by:
createAssociationStore in class VirtualTopicMapStore
Parameters:
store - the calling store instance
Returns:
the associationStore

createReificationStore

protected VirtualReificationStore<?> createReificationStore(InMemoryTopicMapStore store)
Creates the internal reification store reference.

Specified by:
createReificationStore in class VirtualTopicMapStore
Parameters:
store - the calling store instance
Returns:
the reificationStore

createTypedStore

protected VirtualTypedStore<?> createTypedStore(InMemoryTopicMapStore store)
Creates the internal types store reference.

Specified by:
createTypedStore in class VirtualTopicMapStore
Parameters:
store - the calling store instance
Returns:
the typedStore

createCharacteristicsStore

protected VirtualCharacteristicsStore<?> createCharacteristicsStore(InMemoryTopicMapStore store,
                                                                    de.topicmapslab.majortom.model.core.ILocator xsdString)
Creates the internal characteristic store reference.

Specified by:
createCharacteristicsStore in class VirtualTopicMapStore
Parameters:
store - the calling store instance
xsdString - the locator of datatype xsd:string
Returns:
the characteristicsStore

createScopeStore

protected VirtualScopeStore<?> createScopeStore(InMemoryTopicMapStore store)
Creates the internal scope store reference.

Specified by:
createScopeStore in class VirtualTopicMapStore
Parameters:
store - the calling store instance
Returns:
the scopeStore

createTopicTypeStore

protected VirtualTopicTypeStore<?> createTopicTypeStore(InMemoryTopicMapStore store)
Creates the internal topic-type hierarchy store reference.

Specified by:
createTopicTypeStore in class VirtualTopicMapStore
Parameters:
store - the calling store instance
Returns:
the topicTypeStore

isRevisionManagementEnabled

public boolean isRevisionManagementEnabled()

Specified by:
isRevisionManagementEnabled in interface de.topicmapslab.majortom.model.store.ITopicMapStore
Overrides:
isRevisionManagementEnabled in class VirtualTopicMapStore

getTopicMapIdentity

public InMemoryIdentity getTopicMapIdentity()

Specified by:
getTopicMapIdentity in interface de.topicmapslab.majortom.model.store.ITopicMapStore
Overrides:
getTopicMapIdentity in class InMemoryTopicMapStore