com.unitesk.requality.core.transaction
Class TransactionStorage

java.lang.Object
  extended by com.unitesk.requality.core.AbstractTreeStorage
      extended by com.unitesk.requality.core.transaction.TransactionStorage
All Implemented Interfaces:
ITreeStorage

public class TransactionStorage
extends AbstractTreeStorage


Nested Class Summary
 class TransactionStorage.OperationData
           
 
Constructor Summary
TransactionStorage(ITreeStorage storage, java.util.List<ITransactionListener> tListeners)
           
 
Method Summary
 void apply()
           
 void apply(ITreeStorage aStorage)
           
 boolean canLoad(java.util.UUID uuid)
           
 void changeNodeId(java.util.UUID uuid, java.lang.String newNodeId)
           
 void createNode(java.util.UUID parentUUId, java.util.UUID uuid, java.lang.String id, java.util.Collection<Attribute> attrs)
           
 void createStorage(java.lang.String name)
           
 void deleteResource(java.util.UUID uuid, java.lang.String resName)
           
 void deleteStorage()
           
 void dispose()
           
 java.util.Collection<Attribute> getAttributes(java.util.UUID uuid)
           
 java.util.Collection<java.util.UUID> getChildren(java.util.UUID uuid)
           
 java.util.LinkedList<TransactionStorage.OperationData> getLastOperationsData()
           
 java.lang.String getName()
           
 java.lang.String getNodeId(java.util.UUID uuid)
           
 java.lang.String getNodeResourcePath(java.util.UUID uuId)
           
 java.util.UUID getParent(java.util.UUID uuid)
           
 java.io.InputStream getResourceContents(java.util.UUID uuid, java.lang.String resName)
           
 java.util.UUID getRootNode()
           
 ITreeStorage getStorage()
           
 boolean isResourceExists(java.util.UUID uuid, java.lang.String resName)
           
 boolean isResourceInTransaction(java.util.UUID uuid, java.lang.String resName)
           
 java.lang.String[] listResources(java.util.UUID uuid)
           
 void moveNodeTo(java.util.UUID uuid, java.util.UUID newParent)
           
 void remove(java.util.UUID uuid)
           
 void rollback()
           
 void rollback(ITreeStorage aStorage)
           
 void saveAttributes(java.util.UUID uuid, java.util.Collection<Attribute> newAttributes)
           
 void setName(java.lang.String name)
           
 void setResourceContents(java.util.UUID uuid, java.lang.String resName, java.io.InputStream in, java.lang.Object data)
           
 
Methods inherited from class com.unitesk.requality.core.AbstractTreeStorage
createNode, getDeltaTarget, getNodeType, setDeltaTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionStorage

public TransactionStorage(ITreeStorage storage,
                          java.util.List<ITransactionListener> tListeners)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface ITreeStorage
Specified by:
getName in class AbstractTreeStorage

setName

public void setName(java.lang.String name)

getRootNode

public java.util.UUID getRootNode()
Specified by:
getRootNode in interface ITreeStorage
Specified by:
getRootNode in class AbstractTreeStorage

getParent

public java.util.UUID getParent(java.util.UUID uuid)
Specified by:
getParent in interface ITreeStorage
Specified by:
getParent in class AbstractTreeStorage

getNodeId

public java.lang.String getNodeId(java.util.UUID uuid)
Specified by:
getNodeId in interface ITreeStorage
Specified by:
getNodeId in class AbstractTreeStorage

getAttributes

public java.util.Collection<Attribute> getAttributes(java.util.UUID uuid)
Specified by:
getAttributes in interface ITreeStorage
Specified by:
getAttributes in class AbstractTreeStorage

getChildren

public java.util.Collection<java.util.UUID> getChildren(java.util.UUID uuid)
Specified by:
getChildren in interface ITreeStorage
Specified by:
getChildren in class AbstractTreeStorage

canLoad

public boolean canLoad(java.util.UUID uuid)
Specified by:
canLoad in interface ITreeStorage
Specified by:
canLoad in class AbstractTreeStorage

getNodeResourcePath

public java.lang.String getNodeResourcePath(java.util.UUID uuId)
Specified by:
getNodeResourcePath in interface ITreeStorage
Specified by:
getNodeResourcePath in class AbstractTreeStorage

listResources

public java.lang.String[] listResources(java.util.UUID uuid)
Specified by:
listResources in interface ITreeStorage
Specified by:
listResources in class AbstractTreeStorage

getStorage

public ITreeStorage getStorage()

createNode

public void createNode(java.util.UUID parentUUId,
                       java.util.UUID uuid,
                       java.lang.String id,
                       java.util.Collection<Attribute> attrs)
Specified by:
createNode in interface ITreeStorage
Specified by:
createNode in class AbstractTreeStorage

remove

public void remove(java.util.UUID uuid)
Specified by:
remove in interface ITreeStorage
Specified by:
remove in class AbstractTreeStorage

changeNodeId

public void changeNodeId(java.util.UUID uuid,
                         java.lang.String newNodeId)
Specified by:
changeNodeId in interface ITreeStorage
Specified by:
changeNodeId in class AbstractTreeStorage

saveAttributes

public void saveAttributes(java.util.UUID uuid,
                           java.util.Collection<Attribute> newAttributes)
Specified by:
saveAttributes in interface ITreeStorage
Specified by:
saveAttributes in class AbstractTreeStorage

moveNodeTo

public void moveNodeTo(java.util.UUID uuid,
                       java.util.UUID newParent)
Specified by:
moveNodeTo in interface ITreeStorage
Specified by:
moveNodeTo in class AbstractTreeStorage

apply

public void apply()

apply

public void apply(ITreeStorage aStorage)

rollback

public void rollback()

rollback

public void rollback(ITreeStorage aStorage)

isResourceInTransaction

public boolean isResourceInTransaction(java.util.UUID uuid,
                                       java.lang.String resName)

isResourceExists

public boolean isResourceExists(java.util.UUID uuid,
                                java.lang.String resName)
Specified by:
isResourceExists in interface ITreeStorage
Specified by:
isResourceExists in class AbstractTreeStorage

getResourceContents

public java.io.InputStream getResourceContents(java.util.UUID uuid,
                                               java.lang.String resName)
Specified by:
getResourceContents in interface ITreeStorage
Specified by:
getResourceContents in class AbstractTreeStorage

setResourceContents

public void setResourceContents(java.util.UUID uuid,
                                java.lang.String resName,
                                java.io.InputStream in,
                                java.lang.Object data)
Specified by:
setResourceContents in interface ITreeStorage
Specified by:
setResourceContents in class AbstractTreeStorage

deleteResource

public void deleteResource(java.util.UUID uuid,
                           java.lang.String resName)
Specified by:
deleteResource in interface ITreeStorage
Specified by:
deleteResource in class AbstractTreeStorage

dispose

public void dispose()

createStorage

public void createStorage(java.lang.String name)
Specified by:
createStorage in interface ITreeStorage
Specified by:
createStorage in class AbstractTreeStorage

deleteStorage

public void deleteStorage()
Specified by:
deleteStorage in interface ITreeStorage
Specified by:
deleteStorage in class AbstractTreeStorage

getLastOperationsData

public java.util.LinkedList<TransactionStorage.OperationData> getLastOperationsData()