OpenCMIS server: performance improvments

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29257 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Florian Mü
2011-07-21 16:43:12 +00:00
parent 2c3c17229b
commit 240f77d3ba
2 changed files with 22 additions and 10 deletions

View File

@@ -2702,7 +2702,7 @@ public class AlfrescoCmisService extends AbstractCmisService
private void checkRepositoryId(String repositoryId) private void checkRepositoryId(String repositoryId)
{ {
if (!connector.getRepositoryInfo().getId().equals(repositoryId)) if (!connector.getRepositoryId().equals(repositoryId))
{ {
throw new CmisObjectNotFoundException("Unknown repository '" + repositoryId + "'!"); throw new CmisObjectNotFoundException("Unknown repository '" + repositoryId + "'!");
} }

View File

@@ -1872,7 +1872,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
// relationships from and to versions are not preserved // relationships from and to versions are not preserved
return result; return result;
} }
// get relationships // get relationships
List<AssociationRef> assocs = new ArrayList<AssociationRef>(); List<AssociationRef> assocs = new ArrayList<AssociationRef>();
if (relationshipDirection == RelationshipDirection.SOURCE if (relationshipDirection == RelationshipDirection.SOURCE
@@ -2876,6 +2876,14 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
return createRepositoryInfo(); return createRepositoryInfo();
} }
/**
* Returns the repository id.
*/
public String getRepositoryId()
{
return descriptorService.getCurrentRepositoryDescriptor().getId();
}
/** /**
* Creates the repository info object. * Creates the repository info object.
*/ */
@@ -2884,14 +2892,19 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
Descriptor currentDescriptor = descriptorService.getCurrentRepositoryDescriptor(); Descriptor currentDescriptor = descriptorService.getCurrentRepositoryDescriptor();
// get change token // get change token
boolean auditEnabled = auditService.isAuditEnabled(CMIS_CHANGELOG_AUDIT_APPLICATION, "/"
+ CMIS_CHANGELOG_AUDIT_APPLICATION);
String latestChangeLogToken = null; String latestChangeLogToken = null;
EntryIdCallback auditQueryCallback = new EntryIdCallback(false); if (auditEnabled)
AuditQueryParameters params = new AuditQueryParameters(); {
params.setApplicationName(CMIS_CHANGELOG_AUDIT_APPLICATION); EntryIdCallback auditQueryCallback = new EntryIdCallback(false);
params.setForward(false); AuditQueryParameters params = new AuditQueryParameters();
auditService.auditQuery(auditQueryCallback, params, 1); params.setApplicationName(CMIS_CHANGELOG_AUDIT_APPLICATION);
latestChangeLogToken = auditQueryCallback.getEntryId(); params.setForward(false);
auditService.auditQuery(auditQueryCallback, params, 1);
latestChangeLogToken = auditQueryCallback.getEntryId();
}
if (repositoryPermissions == null) if (repositoryPermissions == null)
{ {
@@ -2926,8 +2939,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
repCap.setAllVersionsSearchable(false); repCap.setAllVersionsSearchable(false);
repCap.setCapabilityAcl(CapabilityAcl.MANAGE); repCap.setCapabilityAcl(CapabilityAcl.MANAGE);
repCap.setCapabilityChanges(auditService.isAuditEnabled(CMIS_CHANGELOG_AUDIT_APPLICATION, "/" repCap.setCapabilityChanges(auditEnabled ? CapabilityChanges.OBJECTIDSONLY : CapabilityChanges.NONE);
+ CMIS_CHANGELOG_AUDIT_APPLICATION) ? CapabilityChanges.OBJECTIDSONLY : CapabilityChanges.NONE);
repCap.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.ANYTIME); repCap.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.ANYTIME);
repCap.setCapabilityJoin(CapabilityJoin.NONE); repCap.setCapabilityJoin(CapabilityJoin.NONE);
repCap.setCapabilityQuery(CapabilityQuery.BOTHCOMBINED); repCap.setCapabilityQuery(CapabilityQuery.BOTHCOMBINED);