Merged DEV to HEAD

51987: Nodes that have been moved to deleted stores (protocol='deleted') now report themselves as deleted
          - This change is not part of any fixes but is a correction to logic anyway
          - CLOUD-1685, CLOUD-1827 and CLOUD-1828
   51990: Post-commit cache checks after definitive locking
   51991: Added toString() method to user cache entries for useful debugging (CLOUD-1685, CLOUD-1827 and CLOUD-1828)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@52005 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2013-07-02 16:15:00 +00:00
parent d54e65080a
commit ab68f2d503
3 changed files with 19 additions and 1 deletions

View File

@@ -664,6 +664,10 @@ public class CacheTest extends TestCase
txn.commit();
// Check post-commit values
assertEquals("Definitive change not written through.", DEFINITIVE_ONE, backingCache.get(DEFINITIVE_ONE));
assertEquals("Definitive change not written through.", DEFINITIVE_TWO, backingCache.get(DEFINITIVE_TWO));
assertEquals("Definitive change not written through.", null, backingCache.get(DEFINITIVE_THREE));
}
finally
{

View File

@@ -22,6 +22,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.domain.qname.QNameDAO;
import org.alfresco.repo.security.permissions.PermissionCheckValue;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.Pair;
@@ -192,6 +193,13 @@ public class NodeEntity implements Node, PermissionCheckValue
@Override
public boolean getDeleted(QNameDAO qnameDAO)
{
// First check if it belongs to the 'deleted' stores
if (store.getProtocol().equals(StoreRef.PROTOCOL_DELETED))
{
// The store has been deleted
return true;
}
// Now check the type
Pair<Long, QName> deletedTypeQNamePair = qnameDAO.getQName(ContentModel.TYPE_DELETED);
return deletedTypeQNamePair != null &&
deletedTypeQNamePair.getFirst().equals(typeQNameId);

View File

@@ -800,5 +800,11 @@ public class RepositoryAuthenticationDao implements MutableAuthenticationDao, In
this.userDetails = userDetails;
this.credentialExpiryDate = credentialExpiryDate;
}
@Override
public String toString()
{
return "CacheEntry [nodeRef=" + nodeRef + ", userDetails=" + userDetails + "]";
}
}
}