Purged two vestigial arguments from DirectoryNode.lookupChild() interface.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3981 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-09-30 14:49:57 +00:00
parent 5e36db4b45
commit 20bff37610
5 changed files with 19 additions and 24 deletions

View File

@@ -369,7 +369,7 @@ public class AVMRepository
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
} }
DirectoryNode srcDir = (DirectoryNode)sPath.getCurrentNode(); DirectoryNode srcDir = (DirectoryNode)sPath.getCurrentNode();
AVMNode srcNode = srcDir.lookupChild(sPath, srcName, -1, true, false); AVMNode srcNode = srcDir.lookupChild(sPath, srcName, false);
if (srcNode == null) if (srcNode == null)
{ {
throw new AVMNotFoundException("Not found: " + srcName); throw new AVMNotFoundException("Not found: " + srcName);
@@ -387,7 +387,7 @@ public class AVMRepository
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
} }
DirectoryNode dstDir = (DirectoryNode)dPath.getCurrentNode(); DirectoryNode dstDir = (DirectoryNode)dPath.getCurrentNode();
AVMNode dstNode = dstDir.lookupChild(dPath, dstName, -1, true, false); AVMNode dstNode = dstDir.lookupChild(dPath, dstName, false);
if (dstNode != null) if (dstNode != null)
{ {
throw new AVMExistsException("Node exists: " + dstName); throw new AVMExistsException("Node exists: " + dstName);

View File

@@ -186,7 +186,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
} }
DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode();
if (dir.lookupChild(lPath, name, -1, true, false) != null) if (dir.lookupChild(lPath, name, false) != null)
{ {
throw new AVMExistsException("Child exists: " + name); throw new AVMExistsException("Child exists: " + name);
} }
@@ -223,7 +223,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
} }
DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode();
if (dir.lookupChild(lPath, name, -1, true, false) != null) if (dir.lookupChild(lPath, name, false) != null)
{ {
throw new AVMExistsException("Child exists: " + name); throw new AVMExistsException("Child exists: " + name);
} }
@@ -261,7 +261,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
} }
DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode();
if (dir.lookupChild(lPath, name, -1, true, false) != null) if (dir.lookupChild(lPath, name, false) != null)
{ {
throw new AVMExistsException("Child exists: " + name); throw new AVMExistsException("Child exists: " + name);
} }
@@ -291,7 +291,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
} }
DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode();
if (dir.lookupChild(lPath, name, -1, true, false) != null) if (dir.lookupChild(lPath, name, false) != null)
{ {
throw new AVMExistsException("Child exists: " + name); throw new AVMExistsException("Child exists: " + name);
} }
@@ -321,7 +321,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
} }
DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode();
if (dir.lookupChild(lPath, name, -1, true, false) != null) if (dir.lookupChild(lPath, name, false) != null)
{ {
throw new AVMExistsException("Child exists: " + name); throw new AVMExistsException("Child exists: " + name);
} }
@@ -479,7 +479,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
} }
DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode();
if (dir.lookupChild(lPath, name, -1, true, false) == null) if (dir.lookupChild(lPath, name, false) == null)
{ {
throw new AVMNotFoundException("Does not exist: " + name); throw new AVMNotFoundException("Does not exist: " + name);
} }
@@ -612,7 +612,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
// before the end. // before the end.
for (int i = 0; i < pathElements.length - 1; i++) for (int i = 0; i < pathElements.length - 1; i++)
{ {
AVMNode child = dir.lookupChild(result, pathElements[i], version, write, includeDeleted); AVMNode child = dir.lookupChild(result, pathElements[i], includeDeleted);
if (child == null) if (child == null)
{ {
return null; return null;
@@ -627,7 +627,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
dir = (DirectoryNode)result.getCurrentNode(); dir = (DirectoryNode)result.getCurrentNode();
} }
// Now look up the last element. // Now look up the last element.
AVMNode child = dir.lookupChild(result, pathElements[pathElements.length - 1], version, write, AVMNode child = dir.lookupChild(result, pathElements[pathElements.length - 1],
includeDeleted); includeDeleted);
if (child == null) if (child == null)
{ {

View File

@@ -46,11 +46,9 @@ public interface DirectoryNode extends AVMNode
* Lookup a child node. * Lookup a child node.
* @param lPath The Lookup so far. * @param lPath The Lookup so far.
* @param name The name of the child to lookup. * @param name The name of the child to lookup.
* @param version The version to look under. * @param includeDeleted Include deleted nodes or not.
* @param write Whether this is occuring in a write context.
*/ */
public AVMNode lookupChild(Lookup lPath, String name, int version, boolean write, public AVMNode lookupChild(Lookup lPath, String name, boolean includeDeleted);
boolean includeDeleted);
/** /**
* Lookup a child node using an AVMNodeDescriptor as context. * Lookup a child node using an AVMNodeDescriptor as context.

View File

@@ -465,8 +465,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
* @return The child or null if not found. * @return The child or null if not found.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public AVMNode lookupChild(Lookup lPath, String name, int version, boolean write, public AVMNode lookupChild(Lookup lPath, String name, boolean includeDeleted)
boolean includeDeleted)
{ {
ChildEntry entry = AVMDAOs.Instance().fChildEntryDAO.getByNameParent(name, this); ChildEntry entry = AVMDAOs.Instance().fChildEntryDAO.getByNameParent(name, this);
if (entry != null) if (entry != null)
@@ -487,7 +486,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
if (lookup != null) if (lookup != null)
{ {
DirectoryNode dir = (DirectoryNode)lookup.getCurrentNode(); DirectoryNode dir = (DirectoryNode)lookup.getCurrentNode();
AVMNode retVal = dir.lookupChild(lookup, name, -1, false, includeDeleted); AVMNode retVal = dir.lookupChild(lookup, name, includeDeleted);
lPath.setFinalStore(lookup.getFinalStore()); lPath.setFinalStore(lookup.getFinalStore());
return retVal; return retVal;
} }
@@ -529,7 +528,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
if (lookup != null) if (lookup != null)
{ {
DirectoryNode dir = (DirectoryNode)lookup.getCurrentNode(); DirectoryNode dir = (DirectoryNode)lookup.getCurrentNode();
AVMNode child = dir.lookupChild(lookup, name, -1, false, includeDeleted); AVMNode child = dir.lookupChild(lookup, name, includeDeleted);
if (child == null) if (child == null)
{ {
return null; return null;
@@ -563,7 +562,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
} }
else else
{ {
child = lookupChild(lPath, name, -1, false, false); child = lookupChild(lPath, name, false);
} }
AVMNode ghost = new DeletedNodeImpl(lPath.getAVMStore().getAVMRepository().issueID(), AVMNode ghost = new DeletedNodeImpl(lPath.getAVMStore().getAVMRepository().issueID(),
lPath.getAVMStore()); lPath.getAVMStore());
@@ -798,7 +797,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
throw new AVMBadArgumentException("Non primary layered directories cannot be linked."); throw new AVMBadArgumentException("Non primary layered directories cannot be linked.");
} }
// Look for an existing child of that name. // Look for an existing child of that name.
AVMNode existing = lookupChild(lPath, name, -1, false, true); AVMNode existing = lookupChild(lPath, name, true);
if (existing != null) if (existing != null)
{ {
if (existing.getType() != AVMNodeType.DELETED_NODE) if (existing.getType() != AVMNodeType.DELETED_NODE)

View File

@@ -170,13 +170,11 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory
* Lookup a child by name. * Lookup a child by name.
* @param lPath The lookup path so far. * @param lPath The lookup path so far.
* @param name The name to lookup. * @param name The name to lookup.
* @param version The version to look under. * @param includeDeleted Whether to lookup deleted nodes.
* @param write Whether this is in a write context.
* @return The child or null. * @return The child or null.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public AVMNode lookupChild(Lookup lPath, String name, int version, boolean write, public AVMNode lookupChild(Lookup lPath, String name, boolean includeDeleted)
boolean includeDeleted)
{ {
ChildEntry entry = AVMDAOs.Instance().fChildEntryDAO.getByNameParent(name, this); ChildEntry entry = AVMDAOs.Instance().fChildEntryDAO.getByNameParent(name, this);
if (entry == null || if (entry == null ||