You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2012/09/24 13:26:51 UTC
svn commit: r1389300 - in
/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime:
AbstractCmisObject.java AbstractFilableCmisObject.java DocumentImpl.java
Author: fmui
Date: Mon Sep 24 11:26:50 2012
New Revision: 1389300
URL: http://svn.apache.org/viewvc?rev=1389300&view=rev
Log:
OpenCMIS client: remove objects from the cache if we know that they are not valid anymore
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java?rev=1389300&r1=1389299&r2=1389300&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java Mon Sep 24 11:26:50 2012
@@ -319,6 +319,9 @@ public abstract class AbstractCmisObject
getObjectFactory().convertProperties(properties, this.objectType, updatebility), null);
newObjectId = objectIdHolder.getValue();
+
+ // remove the object from the cache, it has been changed
+ getSession().removeObjectFromCache(objectId);
} finally {
readUnlock();
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java?rev=1389300&r1=1389299&r2=1389300&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java Mon Sep 24 11:26:50 2012
@@ -142,6 +142,9 @@ public abstract class AbstractFilableCmi
getBinding().getObjectService().moveObject(getRepositoryId(), objectIdHolder, targetFolderId.getId(),
sourceFolderId.getId(), null);
+ // invalidate path cache
+ getSession().removeObjectFromCache(objectId);
+
if (objectIdHolder.getValue() == null) {
return null;
}
@@ -163,6 +166,9 @@ public abstract class AbstractFilableCmi
getBinding().getMultiFilingService().addObjectToFolder(getRepositoryId(), objectId, folderId.getId(),
allVersions, null);
+
+ // invalidate path cache
+ getSession().removeObjectFromCache(objectId);
}
public void removeFromFolder(ObjectId folderId) {
@@ -174,5 +180,8 @@ public abstract class AbstractFilableCmi
getBinding().getMultiFilingService()
.removeObjectFromFolder(getRepositoryId(), objectId, folderId.getId(), null);
+
+ // invalidate path cache
+ getSession().removeObjectFromCache(objectId);
}
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java?rev=1389300&r1=1389299&r2=1389300&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java Mon Sep 24 11:26:50 2012
@@ -225,6 +225,10 @@ public class DocumentImpl extends Abstra
readUnlock();
}
+ // remove original version from cache, the path and a few versioning
+ // properties are not valid anymore
+ getSession().removeObjectFromCache(this);
+
if (newObjectId == null) {
return null;
}
@@ -236,6 +240,9 @@ public class DocumentImpl extends Abstra
String objectId = getObjectId();
getBinding().getVersioningService().cancelCheckOut(getRepositoryId(), objectId, null);
+
+ // remove PWC from cache, it doesn't exist anymore
+ getSession().removeObjectFromCache(this);
}
public ObjectId checkIn(boolean major, Map<String, ?> properties, ContentStream contentStream,
@@ -262,12 +269,14 @@ public class DocumentImpl extends Abstra
readUnlock();
}
+ // remove PWC from cache, it doesn't exist anymore
+ getSession().removeObjectFromCache(this);
+
if (newObjectId == null) {
return null;
}
return getSession().createObjectId(newObjectId);
-
}
public List<Document> getAllVersions() {