Another lookup cache checkpoint.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4407 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-11-21 01:46:55 +00:00
parent 837095a411
commit 75f3c91b12
5 changed files with 124 additions and 4 deletions

View File

@@ -30,6 +30,8 @@ import java.util.SortedMap;
import org.alfresco.repo.avm.AVMRepository;
import org.alfresco.repo.domain.DbAccessControlList;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.repo.transaction.TransactionListener;
import org.alfresco.service.cmr.avm.AVMBadArgumentException;
import org.alfresco.service.cmr.avm.AVMException;
import org.alfresco.service.cmr.avm.AVMExistsException;
@@ -63,6 +65,8 @@ public class AVMServiceImpl implements AVMService
*/
private AVMRepository fAVMRepository;
private TransactionListener fTransactionListener;
/**
* Basic constructor for the service.
*/
@@ -79,6 +83,15 @@ public class AVMServiceImpl implements AVMService
fAVMRepository = avmRepository;
}
/**
* Set the transaction listener.
* @param transactionListener
*/
public void setTransactionListener(TransactionListener transactionListener)
{
fTransactionListener = transactionListener;
}
/**
* Get an InputStream from a file.
* @param version The version to look under.
@@ -104,6 +117,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Null path.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
return fAVMRepository.getOutputStream(path);
}
@@ -133,6 +147,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Null path.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
return fAVMRepository.createContentWriter(path);
}
@@ -324,6 +339,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
return fAVMRepository.createFile(path, name);
}
@@ -340,6 +356,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
// Save the contents to temp space.
File temp;
try
@@ -380,6 +397,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.createDirectory(path, name);
}
@@ -396,6 +414,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.createLayeredFile(srcPath, parent, name);
}
@@ -412,6 +431,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.createLayeredDirectory(srcPath, parent, name);
}
@@ -443,6 +463,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.createBranch(version, srcPath, dstPath, name);
}
@@ -458,6 +479,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal null argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.remove(parent, name);
}
@@ -476,6 +498,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Cannot remove root node.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.remove(basePath[0], basePath[1]);
}
@@ -494,6 +517,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.rename(srcParent, srcName, dstParent, dstName);
}
@@ -508,6 +532,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal null argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.uncover(dirPath, name);
}
@@ -523,6 +548,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal null argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.flatten(dirPath, name);
}
@@ -802,6 +828,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal null argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.retargetLayeredDirectory(path, target);
}
@@ -815,6 +842,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Path is null.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.makePrimary(path);
}
@@ -906,6 +934,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Null path.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.setOpacity(path, opacity);
}
@@ -956,6 +985,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal null argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.setNodeProperty(path, name, value);
}
@@ -970,6 +1000,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal null argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.setNodeProperties(path, properties);
}
@@ -1015,6 +1046,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal null argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.deleteNodeProperty(path, name);
}
@@ -1028,6 +1060,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Null path.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.deleteNodeProperties(path);
}
@@ -1130,6 +1163,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Invalid null argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.deleteStoreProperty(store, name);
}
@@ -1159,6 +1193,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Null Path.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
return fAVMRepository.getContentDataForWrite(path);
}
@@ -1176,6 +1211,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Null Path.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.setContentData(path, data);
}
@@ -1190,6 +1226,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal null argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.setMetaDataFrom(path, from);
}
@@ -1206,6 +1243,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal Null Argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.addAspect(path, aspectName);
}
@@ -1235,6 +1273,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Null path.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.removeAspect(path, aspectName);
}
@@ -1266,6 +1305,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal Null Argument.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
fAVMRepository.link(parentPath, name, toLink);
}
@@ -1279,6 +1319,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Null Path.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
return fAVMRepository.forceCopy(path);
}
@@ -1317,6 +1358,7 @@ public class AVMServiceImpl implements AVMService
{
throw new AVMBadArgumentException("Illegal name.");
}
AlfrescoTransactionSupport.bindListener(fTransactionListener);
AVMNodeDescriptor srcDesc = lookup(srcVersion, srcPath);
recursiveCopy(srcVersion, srcDesc, dstPath, name);
}