chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1609721 [2/3] - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/ chemistry-opencmis-commons/chemistry-opencmis-commons-api/src...
Date Fri, 11 Jul 2014 15:01:06 GMT
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java Fri Jul 11 15:01:05 2014
@@ -18,7 +18,7 @@
  */
 package org.apache.chemistry.opencmis.server.impl.atompub;
 
-import static org.apache.chemistry.opencmis.commons.impl.CollectionsHelper.*;
+import static org.apache.chemistry.opencmis.commons.impl.CollectionsHelper.isNullOrEmpty;
 
 import java.util.List;
 
@@ -60,9 +60,17 @@ public class VersioningService {
             parser.parse(request.getInputStream());
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             Holder<String> checkOutId = new Holder<String>(parser.getId());
             service.checkOut(repositoryId, checkOutId, null, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             ObjectInfo objectInfo = service.getObjectInfo(repositoryId, checkOutId.getValue());
             if (objectInfo == null) {
                 throw new CmisRuntimeException("Object Info is missing!");
@@ -114,9 +122,17 @@ public class VersioningService {
             Boolean includeAllowableActions = getBooleanParameter(request, Constants.PARAM_ALLOWABLE_ACTIONS);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<ObjectData> versions = service.getAllVersions(repositoryId, objectId, versionSeriesId, filter,
                     includeAllowableActions, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (isNullOrEmpty(versions)) {
                 throw new CmisRuntimeException("Version list is null or empty!");
             }
@@ -178,8 +194,16 @@ public class VersioningService {
             String objectId = getStringParameter(request, Constants.PARAM_ID);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.deleteObjectOrCancelCheckOut(repositoryId, objectId, Boolean.TRUE, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             // set headers
             response.setStatus(HttpServletResponse.SC_NO_CONTENT);
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/AclService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/AclService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/AclService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/AclService.java Fri Jul 11 15:01:05 2014
@@ -45,14 +45,22 @@ public class AclService {
             assert repositoryId != null;
             assert request != null;
             assert response != null;
-            
+
             // get parameters
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
             Boolean onlyBasicPermissions = getBooleanParameter(request, Constants.PARAM_ONLY_BASIC_PERMISSIONS);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             Acl acl = service.getAcl(repositoryId, objectId, onlyBasicPermissions, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             // return ACL
             response.setStatus(HttpServletResponse.SC_OK);
 
@@ -85,9 +93,17 @@ public class AclService {
             // execute
             ControlParser cp = new ControlParser(request);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             Acl acl = service.applyAcl(repositoryId, objectId, createAddAcl(cp), createRemoveAcl(cp), aclPropagation,
                     null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             // return ACL
             setStatus(request, response, HttpServletResponse.SC_CREATED);
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java Fri Jul 11 15:01:05 2014
@@ -75,9 +75,17 @@ public class DiscoveryService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             ObjectList results = service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
                     includeRelationships, renditionFilter, maxItems, skipCount, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (results == null) {
                 throw new CmisRuntimeException("Results are null!");
             }
@@ -113,10 +121,18 @@ public class DiscoveryService {
             boolean succinct = getBooleanParameter(request, Constants.PARAM_SUCCINCT, false);
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             Holder<String> changeLogTokenHolder = new Holder<String>(changeLogToken);
             ObjectList changes = service.getContentChanges(repositoryId, changeLogTokenHolder, includeProperties,
                     filter, includePolicyIds, includeAcl, maxItems, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
             JSONObject jsonChanges = JSONConverter.convert(changes, typeCache, JSONConverter.PropertyMode.CHANGE,
                     succinct, dateTimeFormat);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java Fri Jul 11 15:01:05 2014
@@ -59,9 +59,17 @@ public class MultiFilingService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             Holder<String> objectIdHolder = new Holder<String>(objectId);
             service.addObjectToFolder(repositoryId, objectId, folderId, allVersions, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
 
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
@@ -101,9 +109,17 @@ public class MultiFilingService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             Holder<String> objectIdHolder = new Holder<String>(objectId);
             service.removeObjectFromFolder(repositoryId, objectId, folderId, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
 
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java Fri Jul 11 15:01:05 2014
@@ -83,10 +83,18 @@ public class NavigationService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             ObjectInFolderList children = service.getChildren(repositoryId, folderId, filter, orderBy,
                     includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, maxItems,
                     skipCount, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (children == null) {
                 throw new CmisRuntimeException("Children are null!");
             }
@@ -124,9 +132,17 @@ public class NavigationService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<ObjectInFolderContainer> descendants = service.getDescendants(repositoryId, folderId, depth, filter,
                     includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (descendants == null) {
                 throw new CmisRuntimeException("Descendants are null!");
             }
@@ -167,9 +183,17 @@ public class NavigationService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<ObjectInFolderContainer> folderTree = service.getFolderTree(repositoryId, folderId, depth, filter,
                     includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (folderTree == null) {
                 throw new CmisRuntimeException("Folder Tree are null!");
             }
@@ -204,8 +228,16 @@ public class NavigationService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             ObjectData parent = service.getFolderParent(repositoryId, objectId, filter, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (parent == null) {
                 throw new CmisRuntimeException("Parent is null!");
             }
@@ -243,9 +275,17 @@ public class NavigationService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<ObjectParentData> parents = service.getObjectParents(repositoryId, objectId, filter,
                     includeAllowableActions, includeRelationships, renditionFilter, includeRelativePathSegment, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (parents == null) {
                 throw new CmisRuntimeException("Parents are null!");
             }
@@ -287,9 +327,17 @@ public class NavigationService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             ObjectList checkedout = service.getCheckedOutDocs(repositoryId, folderId, filter, orderBy,
                     includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (checkedout == null) {
                 throw new CmisRuntimeException("Checked out list is null!");
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java Fri Jul 11 15:01:05 2014
@@ -106,6 +106,10 @@ public class ObjectService {
 
             ContentStream contentStream = createContentStream(request);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String newObjectId = null;
             try {
                 newObjectId = service
@@ -115,6 +119,10 @@ public class ObjectService {
                 closeContentStream(contentStream);
             }
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
             if (object == null) {
                 throw new CmisRuntimeException("New document is null!");
@@ -162,6 +170,10 @@ public class ObjectService {
                 throw new CmisRuntimeException("Source object has no type!?!");
             }
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String newObjectId = service.createDocumentFromSource(
                     repositoryId,
                     sourceId,
@@ -169,6 +181,10 @@ public class ObjectService {
                             Collections.singletonList(sourceId), typeCache), folderId, versioningState,
                     createPolicies(cp), createAddAcl(cp), createRemoveAcl(cp), null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
             if (object == null) {
                 throw new CmisRuntimeException("New document is null!");
@@ -208,9 +224,17 @@ public class ObjectService {
             ControlParser cp = new ControlParser(request);
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String newObjectId = service.createFolder(repositoryId, createNewProperties(cp, typeCache), folderId,
                     createPolicies(cp), createAddAcl(cp), createRemoveAcl(cp), null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
             if (object == null) {
                 throw new CmisRuntimeException("New folder is null!");
@@ -250,9 +274,17 @@ public class ObjectService {
             ControlParser cp = new ControlParser(request);
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String newObjectId = service.createPolicy(repositoryId, createNewProperties(cp, typeCache), folderId,
                     createPolicies(cp), createAddAcl(cp), createRemoveAcl(cp), null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
             if (object == null) {
                 throw new CmisRuntimeException("New policy is null!");
@@ -292,9 +324,17 @@ public class ObjectService {
             ControlParser cp = new ControlParser(request);
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String newObjectId = service.createItem(repositoryId, createNewProperties(cp, typeCache), folderId,
                     createPolicies(cp), createAddAcl(cp), createRemoveAcl(cp), null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
             if (object == null) {
                 throw new CmisRuntimeException("New item is null!");
@@ -333,9 +373,17 @@ public class ObjectService {
             ControlParser cp = new ControlParser(request);
             TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String newObjectId = service.createRelationship(repositoryId, createNewProperties(cp, typeCache),
                     createPolicies(cp), createAddAcl(cp), createRemoveAcl(cp), null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
             if (object == null) {
                 throw new CmisRuntimeException("New relationship is null!");
@@ -379,9 +427,17 @@ public class ObjectService {
             Holder<String> objectIdHolder = new Holder<String>(objectId);
             Holder<String> changeTokenHolder = (changeToken == null ? null : new Holder<String>(changeToken));
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.updateProperties(repositoryId, objectIdHolder, changeTokenHolder,
                     createUpdateProperties(cp, typeId, null, Collections.singletonList(objectId), typeCache), null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
 
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
@@ -446,9 +502,17 @@ public class ObjectService {
             Properties properties = createUpdateProperties(cp, null, addSecondaryTypes, objectIds, typeCache);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<BulkUpdateObjectIdAndChangeToken> result = service.bulkUpdateProperties(repositoryId,
                     objectIdAndChangeToken, properties, addSecondaryTypes, removeSecondaryTypes, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             // return result
             JSONArray jsonList = new JSONArray();
             if (result != null) {
@@ -486,6 +550,10 @@ public class ObjectService {
             // execute
             Properties properties;
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             if (returnVersion == ReturnVersion.LATEST || returnVersion == ReturnVersion.LASTESTMAJOR) {
                 properties = service.getPropertiesOfLatestVersion(repositoryId, objectId, null,
                         returnVersion == ReturnVersion.LASTESTMAJOR, filter, null);
@@ -493,6 +561,10 @@ public class ObjectService {
                 properties = service.getProperties(repositoryId, objectId, filter, null);
             }
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (properties == null) {
                 throw new CmisRuntimeException("Properties are null!");
             }
@@ -535,6 +607,10 @@ public class ObjectService {
             // execute
             ObjectData object;
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             if (returnVersion == ReturnVersion.LATEST || returnVersion == ReturnVersion.LASTESTMAJOR) {
                 object = service.getObjectOfLatestVersion(repositoryId, objectId, null,
                         returnVersion == ReturnVersion.LASTESTMAJOR, filter, includeAllowableActions,
@@ -544,6 +620,10 @@ public class ObjectService {
                         includeRelationships, renditionFilter, includePolicyIds, includeAcl, null);
             }
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (object == null) {
                 throw new CmisRuntimeException("Object is null!");
             }
@@ -573,8 +653,17 @@ public class ObjectService {
             // get parameters
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
 
+            // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             AllowableActions allowableActions = service.getAllowableActions(repositoryId, objectId, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             JSONObject jsonAllowableActions = JSONConverter.convert(allowableActions);
 
             response.setStatus(HttpServletResponse.SC_OK);
@@ -601,9 +690,17 @@ public class ObjectService {
             BigInteger skipCount = getBigIntegerParameter(request, Constants.PARAM_SKIP_COUNT);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<RenditionData> renditions = service.getRenditions(repositoryId, objectId, renditionFilter, maxItems,
                     skipCount, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             JSONArray jsonRenditions = new JSONArray();
             if (renditions != null) {
                 for (RenditionData rendition : renditions) {
@@ -637,8 +734,16 @@ public class ObjectService {
             BigInteger length = context.getLength();
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             ContentStream content = service.getContentStream(repositoryId, objectId, streamId, offset, length, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (content == null || content.getStream() == null) {
                 throw new CmisRuntimeException("Content stream is null!");
             }
@@ -710,8 +815,17 @@ public class ObjectService {
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
             Boolean allVersions = getBooleanParameter(request, Constants.PARAM_ALL_VERSIONS);
 
+            // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.deleteObject(repositoryId, objectId, allVersions, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             response.setStatus(HttpServletResponse.SC_OK);
             writeEmpty(request, response);
         }
@@ -736,9 +850,17 @@ public class ObjectService {
             Boolean continueOnFailure = getBooleanParameter(request, Constants.PARAM_CONTINUE_ON_FAILURE);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             FailedToDeleteData ftd = service.deleteTree(repositoryId, objectId, allVersions, unfileObjects,
                     continueOnFailure, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             response.setStatus(HttpServletResponse.SC_OK);
 
             if (ftd != null && isNotEmpty(ftd.getIds())) {
@@ -772,8 +894,17 @@ public class ObjectService {
             // execute
             Holder<String> objectIdHolder = new Holder<String>(objectId);
             Holder<String> changeTokenHolder = (changeToken == null ? null : new Holder<String>(changeToken));
+
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.deleteContentStream(repositoryId, objectIdHolder, changeTokenHolder, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
 
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
@@ -816,6 +947,10 @@ public class ObjectService {
             Holder<String> changeTokenHolder = (changeToken == null ? null : new Holder<String>(changeToken));
             ContentStream contentStream = createContentStream(request);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             try {
                 service.setContentStream(repositoryId, objectIdHolder, overwriteFlag, changeTokenHolder, contentStream,
                         null);
@@ -823,6 +958,10 @@ public class ObjectService {
                 closeContentStream(contentStream);
             }
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
 
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
@@ -867,6 +1006,10 @@ public class ObjectService {
             Holder<String> changeTokenHolder = (changeToken == null ? null : new Holder<String>(changeToken));
             ContentStream contentStream = createContentStream(request);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             try {
                 service.appendContentStream(repositoryId, objectIdHolder, changeTokenHolder, contentStream,
                         isLastChunk, null);
@@ -874,6 +1017,10 @@ public class ObjectService {
                 closeContentStream(contentStream);
             }
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
 
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
@@ -915,8 +1062,17 @@ public class ObjectService {
 
             // execute
             Holder<String> objectIdHolder = new Holder<String>(objectId);
+
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.moveObject(repositoryId, objectIdHolder, targetFolderId, sourceFolderId, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
 
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java Fri Jul 11 15:01:05 2014
@@ -61,8 +61,16 @@ public class PolicyService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<ObjectData> policies = service.getAppliedPolicies(repositoryId, objectId, filter, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             JSONArray jsonPolicies = new JSONArray();
             if (policies != null) {
                 TypeCache typeCache = new ServerTypeCacheImpl(repositoryId, service);
@@ -96,8 +104,16 @@ public class PolicyService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.applyPolicy(repositoryId, policyId, objectId, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             ObjectData object = getSimpleObject(service, repositoryId, objectId);
             if (object == null) {
                 throw new CmisRuntimeException("Object is null!");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java Fri Jul 11 15:01:05 2014
@@ -70,10 +70,18 @@ public class RelationshipService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             ObjectList relationships = service.getObjectRelationships(repositoryId, objectId,
                     includeSubRelationshipTypes, relationshipDirection, typeId, renditionFilter,
                     includeAllowableActions, maxItems, skipCount, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (relationships == null) {
                 throw new CmisRuntimeException("Relationships are null!");
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RepositoryService.java Fri Jul 11 15:01:05 2014
@@ -69,8 +69,16 @@ public class RepositoryService {
             assert response != null;
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<RepositoryInfo> infoDataList = service.getRepositoryInfos(null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             JSONObject result = new JSONObject();
             for (RepositoryInfo ri : infoDataList) {
                 String repositoryUrl = compileRepositoryUrl(request, ri.getId()).toString();
@@ -97,8 +105,16 @@ public class RepositoryService {
             assert response != null;
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             RepositoryInfo ri = service.getRepositoryInfo(repositoryId, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             String repositoryUrl = compileRepositoryUrl(request, ri.getId()).toString();
             String rootUrl = compileRootUrl(request, ri.getId()).toString();
 
@@ -173,8 +189,17 @@ public class RepositoryService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             TypeDefinitionList typeList = service.getTypeChildren(repositoryId, typeId, includePropertyDefinitions,
                     maxItems, skipCount, null);
+
+            if (stopAfterService(service)) {
+                return;
+            }
+
             JSONObject jsonTypeList = JSONConverter.convert(typeList, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
@@ -198,9 +223,17 @@ public class RepositoryService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<TypeDefinitionContainer> typeTree = service.getTypeDescendants(repositoryId, typeId, depth,
                     includePropertyDefinitions, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (typeTree == null) {
                 throw new CmisRuntimeException("Type tree is null!");
             }
@@ -232,7 +265,16 @@ public class RepositoryService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             TypeDefinition type = service.getTypeDefinition(repositoryId, typeId, null);
+
+            if (stopAfterService(service)) {
+                return;
+            }
+
             JSONObject jsonType = JSONConverter.convert(type, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
@@ -271,7 +313,16 @@ public class RepositoryService {
             TypeDefinition typeIn = JSONConverter.convertTypeDefinition((Map<String, Object>) typeJson);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             TypeDefinition typeOut = service.createType(repositoryId, typeIn, null);
+
+            if (stopAfterService(service)) {
+                return;
+            }
+
             JSONObject jsonType = JSONConverter.convert(typeOut, dateTimeFormat);
 
             // set headers
@@ -313,7 +364,16 @@ public class RepositoryService {
             TypeDefinition typeIn = JSONConverter.convertTypeDefinition((Map<String, Object>) typeJson);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             TypeDefinition typeOut = service.updateType(repositoryId, typeIn, null);
+
+            if (stopAfterService(service)) {
+                return;
+            }
+
             JSONObject jsonType = JSONConverter.convert(typeOut, dateTimeFormat);
 
             response.setStatus(HttpServletResponse.SC_OK);
@@ -336,8 +396,17 @@ public class RepositoryService {
             // get parameters
             String typeId = getStringParameter(request, CONTROL_TYPE_ID);
 
+            // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.deleteType(repositoryId, typeId, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             response.setStatus(HttpServletResponse.SC_OK);
             writeEmpty(request, response);
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java Fri Jul 11 15:01:05 2014
@@ -67,9 +67,17 @@ public class VersioningService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             Holder<String> checkOutId = new Holder<String>(objectId);
             service.checkOut(repositoryId, checkOutId, null, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             ObjectData object = getSimpleObject(service, repositoryId, checkOutId.getValue());
             if (object == null) {
                 throw new CmisRuntimeException("PWC is null!");
@@ -107,8 +115,16 @@ public class VersioningService {
             String objectId = ((BrowserCallContextImpl) context).getObjectId();
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.cancelCheckOut(repositoryId, objectId, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             response.setStatus(HttpServletResponse.SC_OK);
             writeEmpty(request, response);
         }
@@ -141,6 +157,10 @@ public class VersioningService {
             Holder<String> objectIdHolder = new Holder<String>(objectId);
             ContentStream contentStream = createContentStream(request);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             try {
                 service.checkIn(repositoryId, objectIdHolder, major,
                         createUpdateProperties(cp, typeId, null, Collections.singletonList(objectId), typeCache),
@@ -149,6 +169,10 @@ public class VersioningService {
                 closeContentStream(contentStream);
             }
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             String newObjectId = (objectIdHolder.getValue() == null ? objectId : objectIdHolder.getValue());
 
             ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
@@ -191,9 +215,17 @@ public class VersioningService {
             DateTimeFormat dateTimeFormat = getDateTimeFormatParameter(request);
 
             // execute
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<ObjectData> versions = service.getAllVersions(repositoryId, objectId, null, filter,
                     includeAllowableActions, null);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (versions == null) {
                 throw new CmisRuntimeException("Versions are null!");
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.java Fri Jul 11 15:01:05 2014
@@ -49,6 +49,8 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.apache.chemistry.opencmis.commons.server.CmisService;
 import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
+import org.apache.chemistry.opencmis.commons.server.ProgressControlCmisService;
+import org.apache.chemistry.opencmis.commons.server.ProgressControlCmisService.Progress;
 import org.apache.chemistry.opencmis.server.impl.CallContextImpl;
 import org.apache.chemistry.opencmis.server.impl.CmisRepositoryContextListener;
 import org.apache.chemistry.opencmis.server.impl.ServerVersion;
@@ -146,6 +148,36 @@ public abstract class AbstractService {
     }
 
     /**
+     * Determines if the processing should be stopped before the service method
+     * is called.
+     * 
+     * @return {@code true} if the processing should be stopped, {@code false}
+     *         otherwise
+     */
+    protected boolean stopBeforeService(CmisService service) {
+        if (!(service instanceof ProgressControlCmisService)) {
+            return false;
+        }
+
+        return ((ProgressControlCmisService) service).beforeServiceCall() == Progress.STOP;
+    }
+
+    /**
+     * Determines if the processing should be stopped after the service method
+     * is called.
+     * 
+     * @return {@code true} if the processing should be stopped, {@code false}
+     *         otherwise
+     */
+    protected boolean stopAfterService(CmisService service) {
+        if (!(service instanceof ProgressControlCmisService)) {
+            return false;
+        }
+
+        return ((ProgressControlCmisService) service).beforeServiceCall() == Progress.STOP;
+    }
+
+    /**
      * Closes the service instance.
      */
     protected void closeService(CmisService service) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AclService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AclService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AclService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AclService.java Fri Jul 11 15:01:05 2014
@@ -51,9 +51,17 @@ public class AclService extends Abstract
         try {
             service = getService(wsContext, repositoryId);
 
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
             Acl acl = service.applyAcl(repositoryId, objectId, convert(addAces, null), convert(removeAces, null),
                     convert(AclPropagation.class, aclPropagation), convert(extension));
 
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             if (acl == null) {
                 return null;
             }
@@ -76,7 +84,16 @@ public class AclService extends Abstract
         try {
             service = getService(wsContext, repositoryId);
 
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
             Acl acl = service.getAcl(repositoryId, objectId, onlyBasicPermissions, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             if (acl == null) {
                 return null;
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.java Fri Jul 11 15:01:05 2014
@@ -60,9 +60,17 @@ public class DiscoveryService extends Ab
 
             org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogTokenHolder = convertHolder(changeLogToken);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             ObjectList changesList = service.getContentChanges(repositoryId, changeLogTokenHolder, includeProperties,
                     filter, includePolicyIds, includeAcl, maxItems, convert(extension));
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (objects != null) {
                 objects.value = convert(changesList, cmisVersion);
             }
@@ -84,9 +92,19 @@ public class DiscoveryService extends Ab
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
-            return convert(service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
-                    convert(IncludeRelationships.class, includeRelationships), renditionFilter, maxItems, skipCount,
-                    convert(extension)), cmisVersion);
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            ObjectList serviceResult = service.query(repositoryId, statement, searchAllVersions,
+                    includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
+                    renditionFilter, maxItems, skipCount, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, cmisVersion);
         } catch (Exception e) {
             throw convertException(e);
         } finally {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.java Fri Jul 11 15:01:05 2014
@@ -50,8 +50,16 @@ public class MultiFilingService extends 
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.addObjectToFolder(repositoryId, objectId, folderId, allVersions, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setExtensionValues(extData, extension);
         } catch (Exception e) {
             throw convertException(e);
@@ -68,8 +76,16 @@ public class MultiFilingService extends 
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.removeObjectFromFolder(repositoryId, objectId, folderId, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setExtensionValues(extData, extension);
         } catch (Exception e) {
             throw convertException(e);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/NavigationService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/NavigationService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/NavigationService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/NavigationService.java Fri Jul 11 15:01:05 2014
@@ -29,7 +29,10 @@ import javax.jws.WebService;
 import javax.xml.ws.WebServiceContext;
 import javax.xml.ws.soap.MTOM;
 
+import org.apache.chemistry.opencmis.commons.data.ObjectData;
 import org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer;
+import org.apache.chemistry.opencmis.commons.data.ObjectInFolderList;
+import org.apache.chemistry.opencmis.commons.data.ObjectList;
 import org.apache.chemistry.opencmis.commons.data.ObjectParentData;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
@@ -62,9 +65,19 @@ public class NavigationService extends A
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
-            return convert(service.getCheckedOutDocs(repositoryId, folderId, filter, orderBy, includeAllowableActions,
-                    convert(IncludeRelationships.class, includeRelationships), renditionFilter, maxItems, skipCount,
-                    convert(extension)), cmisVersion);
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            ObjectList serviceResult = service.getCheckedOutDocs(repositoryId, folderId, filter, orderBy,
+                    includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
+                    renditionFilter, maxItems, skipCount, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, cmisVersion);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -82,9 +95,19 @@ public class NavigationService extends A
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
-            return convert(service.getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions,
-                    convert(IncludeRelationships.class, includeRelationships), renditionFilter, includePathSegment,
-                    maxItems, skipCount, convert(extension)), cmisVersion);
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            ObjectInFolderList serviceResult = service.getChildren(repositoryId, folderId, filter, orderBy,
+                    includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
+                    renditionFilter, includePathSegment, maxItems, skipCount, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, cmisVersion);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -103,10 +126,18 @@ public class NavigationService extends A
 
             List<CmisObjectInFolderContainerType> result = new ArrayList<CmisObjectInFolderContainerType>();
 
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
             List<ObjectInFolderContainer> serviceResult = service.getDescendants(repositoryId, folderId, depth, filter,
                     includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
                     renditionFilter, includePathSegment, convert(extension));
 
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             if (serviceResult != null) {
                 for (ObjectInFolderContainer container : serviceResult) {
                     result.add(convert(container, cmisVersion));
@@ -129,7 +160,17 @@ public class NavigationService extends A
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
-            return convert(service.getFolderParent(repositoryId, folderId, filter, convert(extension)), cmisVersion);
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            ObjectData serviceResult = service.getFolderParent(repositoryId, folderId, filter, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, cmisVersion);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -148,10 +189,22 @@ public class NavigationService extends A
 
             List<CmisObjectInFolderContainerType> result = new ArrayList<CmisObjectInFolderContainerType>();
 
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             List<ObjectInFolderContainer> serviceResult = service.getFolderTree(repositoryId, folderId, depth, filter,
                     includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
                     renditionFilter, includePathSegment, convert(extension));
 
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             if (serviceResult != null) {
                 for (ObjectInFolderContainer container : serviceResult) {
                     result.add(convert(container, cmisVersion));
@@ -177,10 +230,18 @@ public class NavigationService extends A
 
             List<CmisObjectParentsType> result = new ArrayList<CmisObjectParentsType>();
 
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
             List<ObjectParentData> serviceResult = service.getObjectParents(repositoryId, objectId, filter,
                     includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
                     renditionFilter, includeRelativePathSegment, convert(extension));
 
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             if (serviceResult != null) {
                 for (ObjectParentData parent : serviceResult) {
                     result.add(convert(parent, cmisVersion));

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectService.java Fri Jul 11 15:01:05 2014
@@ -34,8 +34,12 @@ import javax.xml.ws.Holder;
 import javax.xml.ws.WebServiceContext;
 import javax.xml.ws.soap.MTOM;
 
+import org.apache.chemistry.opencmis.commons.data.AllowableActions;
 import org.apache.chemistry.opencmis.commons.data.BulkUpdateObjectIdAndChangeToken;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.data.FailedToDeleteData;
+import org.apache.chemistry.opencmis.commons.data.ObjectData;
 import org.apache.chemistry.opencmis.commons.data.Properties;
 import org.apache.chemistry.opencmis.commons.data.RenditionData;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
@@ -81,10 +85,18 @@ public class ObjectService extends Abstr
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String id = service.createDocument(repositoryId, convert(properties), folderId,
                     convert(contentStream, false), convert(VersioningState.class, versioningState), policies,
                     convert(addAces, null), convert(removeAces, null), extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (objectId != null) {
                 objectId.value = id;
             }
@@ -107,10 +119,18 @@ public class ObjectService extends Abstr
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String id = service.createDocumentFromSource(repositoryId, sourceId, convert(properties), folderId,
                     convert(VersioningState.class, versioningState), policies, convert(addAces, null),
                     convert(removeAces, null), extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (objectId != null) {
                 objectId.value = id;
             }
@@ -132,9 +152,17 @@ public class ObjectService extends Abstr
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String id = service.createFolder(repositoryId, convert(properties), folderId, policies,
                     convert(addAces, null), convert(removeAces, null), extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (objectId != null) {
                 objectId.value = id;
             }
@@ -156,9 +184,17 @@ public class ObjectService extends Abstr
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String id = service.createPolicy(repositoryId, convert(properties), folderId, policies,
                     convert(addAces, null), convert(removeAces, null), extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (objectId != null) {
                 objectId.value = id;
             }
@@ -180,9 +216,17 @@ public class ObjectService extends Abstr
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String id = service.createRelationship(repositoryId, convert(properties), policies, convert(addAces, null),
                     convert(removeAces, null), extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (objectId != null) {
                 objectId.value = id;
             }
@@ -204,9 +248,17 @@ public class ObjectService extends Abstr
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             String id = service.createItem(repositoryId, convert(properties), folderId, null, convert(addAces, null),
                     convert(removeAces, null), extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (objectId != null) {
                 objectId.value = id;
             }
@@ -229,8 +281,16 @@ public class ObjectService extends Abstr
             org.apache.chemistry.opencmis.commons.spi.Holder<String> changeTokenHolder = convertHolder(changeToken);
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.deleteContentStream(repositoryId, objectIdHolder, changeTokenHolder, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setHolderValue(objectIdHolder, objectId);
             setHolderValue(changeTokenHolder, changeToken);
             setExtensionValues(extData, extension);
@@ -249,8 +309,16 @@ public class ObjectService extends Abstr
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.deleteObject(repositoryId, objectId, allVersions, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setExtensionValues(extData, extension);
         } catch (Exception e) {
             throw convertException(e);
@@ -266,8 +334,18 @@ public class ObjectService extends Abstr
         try {
             service = getService(wsContext, repositoryId);
 
-            return convert(service.deleteTree(repositoryId, folderId, allVersions,
-                    convert(UnfileObject.class, unfileObjects), continueOnFailure, convert(extension)));
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            FailedToDeleteData serviceResult = service.deleteTree(repositoryId, folderId, allVersions,
+                    convert(UnfileObject.class, unfileObjects), continueOnFailure, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -283,7 +361,17 @@ public class ObjectService extends Abstr
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
-            return convert(service.getAllowableActions(repositoryId, objectId, convert(extension)), cmisVersion);
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            AllowableActions serviceResult = service.getAllowableActions(repositoryId, objectId, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, cmisVersion);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -297,9 +385,18 @@ public class ObjectService extends Abstr
         try {
             service = getService(wsContext, repositoryId);
 
-            return convert(
-                    service.getContentStream(repositoryId, objectId, streamId, offset, length, convert(extension)),
-                    true);
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            ContentStream serviceResult = service.getContentStream(repositoryId, objectId, streamId, offset, length,
+                    convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, true);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -316,9 +413,19 @@ public class ObjectService extends Abstr
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
-            return convert(service.getObject(repositoryId, objectId, filter, includeAllowableActions,
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            ObjectData serviceResult = service.getObject(repositoryId, objectId, filter, includeAllowableActions,
                     convert(IncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
-                    includeAcl, convert(extension)), cmisVersion);
+                    includeAcl, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, cmisVersion);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -335,9 +442,19 @@ public class ObjectService extends Abstr
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
-            return convert(service.getObjectByPath(repositoryId, path, filter, includeAllowableActions,
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            ObjectData serviceResult = service.getObjectByPath(repositoryId, path, filter, includeAllowableActions,
                     convert(IncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
-                    includeAcl, convert(extension)), cmisVersion);
+                    includeAcl, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, cmisVersion);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -351,7 +468,17 @@ public class ObjectService extends Abstr
         try {
             service = getService(wsContext, repositoryId);
 
-            return convert(service.getProperties(repositoryId, objectId, filter, convert(extension)));
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            Properties serviceResult = service.getProperties(repositoryId, objectId, filter, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -367,9 +494,17 @@ public class ObjectService extends Abstr
 
             List<CmisRenditionType> result = new ArrayList<CmisRenditionType>();
 
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
             List<RenditionData> renditionList = service.getRenditions(repositoryId, objectId, renditionFilter,
                     maxItems, skipCount, convert(extension));
 
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             if (renditionList != null) {
                 for (RenditionData rendition : renditionList) {
                     result.add(convert(rendition));
@@ -393,8 +528,16 @@ public class ObjectService extends Abstr
             org.apache.chemistry.opencmis.commons.spi.Holder<String> objectIdHolder = convertHolder(objectId);
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.moveObject(repositoryId, objectIdHolder, targetFolderId, sourceFolderId, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setHolderValue(objectIdHolder, objectId);
             setExtensionValues(extData, extension);
         } catch (Exception e) {
@@ -415,9 +558,17 @@ public class ObjectService extends Abstr
             org.apache.chemistry.opencmis.commons.spi.Holder<String> changeTokenHolder = convertHolder(changeToken);
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.setContentStream(repositoryId, objectIdHolder, overwriteFlag, changeTokenHolder,
                     convert(contentStream, false), extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setHolderValue(objectIdHolder, objectId);
             setHolderValue(changeTokenHolder, changeToken);
             setExtensionValues(extData, extension);
@@ -439,9 +590,17 @@ public class ObjectService extends Abstr
             org.apache.chemistry.opencmis.commons.spi.Holder<String> changeTokenHolder = convertHolder(changeToken);
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.appendContentStream(repositoryId, objectIdHolder, changeTokenHolder, convert(contentStream, true),
                     isLastChunk, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setHolderValue(objectIdHolder, objectId);
             setHolderValue(changeTokenHolder, changeToken);
             setExtensionValues(extData, extension);
@@ -462,8 +621,16 @@ public class ObjectService extends Abstr
             org.apache.chemistry.opencmis.commons.spi.Holder<String> changeTokenHolder = convertHolder(changeToken);
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.updateProperties(repositoryId, objectIdHolder, changeTokenHolder, convert(properties), extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setHolderValue(objectIdHolder, objectId);
             setHolderValue(changeTokenHolder, changeToken);
             setExtensionValues(extData, extension);
@@ -503,9 +670,17 @@ public class ObjectService extends Abstr
                 }
             }
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             List<BulkUpdateObjectIdAndChangeToken> result = service.bulkUpdateProperties(repositoryId,
                     objectIdsAndChangeTokens, properties, addSecondaryTypeIds, removeSecondaryTypeIds, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             if (objectIdAndChangeToken != null && result != null) {
                 // TODO: add workaround
                 // see: https://tools.oasis-open.org/issues/browse/CMIS-754

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/PolicyService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/PolicyService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/PolicyService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/PolicyService.java Fri Jul 11 15:01:05 2014
@@ -57,8 +57,16 @@ public class PolicyService extends Abstr
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.applyPolicy(repositoryId, policyId, objectId, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setExtensionValues(extData, extension);
         } catch (Exception e) {
             throw convertException(e);
@@ -75,8 +83,16 @@ public class PolicyService extends Abstr
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
             List<ObjectData> policies = service.getAppliedPolicies(repositoryId, objectId, filter, convert(extension));
 
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             if (policies == null) {
                 return null;
             }
@@ -102,8 +118,16 @@ public class PolicyService extends Abstr
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.removePolicy(repositoryId, policyId, objectId, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setExtensionValues(extData, extension);
         } catch (Exception e) {
             throw convertException(e);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RelationshipService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RelationshipService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RelationshipService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RelationshipService.java Fri Jul 11 15:01:05 2014
@@ -27,6 +27,7 @@ import javax.jws.WebService;
 import javax.xml.ws.WebServiceContext;
 import javax.xml.ws.soap.MTOM;
 
+import org.apache.chemistry.opencmis.commons.data.ObjectList;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
 import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
@@ -55,9 +56,19 @@ public class RelationshipService extends
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
-            return convert(service.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes,
-                    convert(RelationshipDirection.class, relationshipDirection), typeId, filter,
-                    includeAllowableActions, maxItems, skipCount, convert(extension)), cmisVersion);
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            ObjectList serviceResult = service.getObjectRelationships(repositoryId, objectId,
+                    includeSubRelationshipTypes, convert(RelationshipDirection.class, relationshipDirection), typeId,
+                    filter, includeAllowableActions, maxItems, skipCount, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, cmisVersion);
         } catch (Exception e) {
             throw convertException(e);
         } finally {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.java?rev=1609721&r1=1609720&r2=1609721&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.java Fri Jul 11 15:01:05 2014
@@ -35,6 +35,9 @@ import javax.xml.ws.soap.MTOM;
 
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionList;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
@@ -60,8 +63,16 @@ public class RepositoryService extends A
         try {
             service = getService(wsContext, null);
 
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
             List<RepositoryInfo> infoDataList = service.getRepositoryInfos(convert(extension));
 
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             if (infoDataList == null) {
                 return null;
             }
@@ -91,7 +102,17 @@ public class RepositoryService extends A
             service = getService(wsContext, repositoryId);
             cmisVersion = getCmisVersion(wsContext);
 
-            return convert(service.getRepositoryInfo(repositoryId, convert(extension)), cmisVersion);
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            RepositoryInfo serviceResult = service.getRepositoryInfo(repositoryId, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult, cmisVersion);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -106,8 +127,18 @@ public class RepositoryService extends A
         try {
             service = getService(wsContext, repositoryId);
 
-            return convert(service.getTypeChildren(repositoryId, typeId, includePropertyDefinitions, maxItems,
-                    skipCount, convert(extension)));
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            TypeDefinitionList serviceResult = service.getTypeChildren(repositoryId, typeId,
+                    includePropertyDefinitions, maxItems, skipCount, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -121,7 +152,17 @@ public class RepositoryService extends A
         try {
             service = getService(wsContext, repositoryId);
 
-            return convert(service.getTypeDefinition(repositoryId, typeId, convert(extension)));
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            TypeDefinition serviceResult = service.getTypeDefinition(repositoryId, typeId, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
+            return convert(serviceResult);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -135,9 +176,19 @@ public class RepositoryService extends A
         try {
             service = getService(wsContext, repositoryId);
 
+            if (stopBeforeService(service)) {
+                return null;
+            }
+
+            List<TypeDefinitionContainer> serviceResult = service.getTypeDescendants(repositoryId, typeId, depth,
+                    includePropertyDefinitions, convert(extension));
+
+            if (stopAfterService(service)) {
+                return null;
+            }
+
             List<CmisTypeContainer> result = new ArrayList<CmisTypeContainer>();
-            convertTypeContainerList(service.getTypeDescendants(repositoryId, typeId, depth,
-                    includePropertyDefinitions, convert(extension)), result);
+            convertTypeContainerList(serviceResult, result);
 
             return result;
         } catch (Exception e) {
@@ -153,7 +204,17 @@ public class RepositoryService extends A
         try {
             service = getService(wsContext, repositoryId);
 
-            type.value = convert(service.createType(repositoryId, convert(type.value), convert(extension)));
+            if (stopBeforeService(service)) {
+                return;
+            }
+
+            TypeDefinition serviceResult = service.createType(repositoryId, convert(type.value), convert(extension));
+
+            if (stopAfterService(service)) {
+                return;
+            }
+
+            type.value = convert(serviceResult);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -167,7 +228,17 @@ public class RepositoryService extends A
         try {
             service = getService(wsContext, repositoryId);
 
-            type.value = convert(service.updateType(repositoryId, convert(type.value), convert(extension)));
+            if (stopBeforeService(service)) {
+                return;
+            }
+
+            TypeDefinition serviceResult = service.updateType(repositoryId, convert(type.value), convert(extension));
+
+            if (stopAfterService(service)) {
+                return;
+            }
+
+            type.value = convert(serviceResult);
         } catch (Exception e) {
             throw convertException(e);
         } finally {
@@ -184,8 +255,16 @@ public class RepositoryService extends A
 
             ExtensionsData extData = convertExtensionHolder(extension);
 
+            if (stopBeforeService(service)) {
+                return;
+            }
+
             service.deleteType(repositoryId, typeId, extData);
 
+            if (stopAfterService(service)) {
+                return;
+            }
+
             setExtensionValues(extData, extension);
         } catch (Exception e) {
             throw convertException(e);



Mime
View raw message