org.alfresco.repo.avm
Class PlainDirectoryNodeImpl

java.lang.Object
  extended by org.alfresco.repo.avm.AVMNodeImpl
      extended by org.alfresco.repo.avm.DirectoryNodeImpl
          extended by org.alfresco.repo.avm.PlainDirectoryNodeImpl
All Implemented Interfaces:
AVMNode, DirectoryNode, PlainDirectoryNode

public class PlainDirectoryNodeImpl
extends DirectoryNodeImpl
implements PlainDirectoryNode

A plain directory. No monkey tricks except for possiblyCopy.


Field Summary
 
Fields inherited from class org.alfresco.repo.avm.AVMNodeImpl
DEBUG
 
Constructor Summary
PlainDirectoryNodeImpl()
          Default constructor.
PlainDirectoryNodeImpl(AVMStore store)
          Make up a new directory with nothing in it.
PlainDirectoryNodeImpl(PlainDirectoryNode other, AVMStore store, java.lang.Long parentAcl, ACLCopyMode mode)
          Copy like constructor.
 
Method Summary
 AVMNode copy(org.alfresco.repo.avm.Lookup lPath)
          Copy on write logic.
 java.util.List getDeletedNames()
          Get the names of nodes deleted in this directory.
 AVMNodeDescriptor getDescriptor(org.alfresco.repo.avm.Lookup lPath)
          Get the descriptor for this node.
 AVMNodeDescriptor getDescriptor(org.alfresco.repo.avm.Lookup lPath, java.lang.String name)
          Get the descriptor for this node.
 AVMNodeDescriptor getDescriptor(java.lang.String parentPath, java.lang.String name, java.lang.String parentIndirection, int parentIndirectionVersion)
          Get this node's descriptor.
 java.util.SortedMap getListing(AVMNodeDescriptor dir, boolean includeDeleted)
          Get a listing of from a directory node descriptor.
 java.util.SortedMap getListing(AVMNodeDescriptor dir, java.lang.String childNamePattern, boolean includeDeleted)
          Get a listing of from a directory node descriptor.
 java.util.Map getListing(org.alfresco.repo.avm.Lookup lPath, boolean includeDeleted)
          Get a directory listing.
 java.util.Map getListing(org.alfresco.repo.avm.Lookup lPath, java.lang.String childNamePattern, boolean includeDeleted)
          Get a directory listing.
 java.util.SortedMap getListingDirect(AVMNodeDescriptor dir, boolean includeDeleted)
          Get a listing of the nodes directly contained by a directory.
 java.util.Map getListingDirect(org.alfresco.repo.avm.Lookup lPath, boolean includeDeleted)
          Get a listing of the nodes directly contained by a directory.
 int getType()
          Get the type of this node.
 void link(org.alfresco.repo.avm.Lookup lPath, java.lang.String name, AVMNodeDescriptor toLink)
          Link a node with the given id into this directory.
 AVMNodeDescriptor lookupChild(AVMNodeDescriptor mine, java.lang.String name, boolean includeDeleted)
          Lookup a child using a node descriptor as context.
 org.alfresco.util.Pair lookupChildEntry(org.alfresco.repo.avm.Lookup lPath, java.lang.String name, boolean includeDeleted)
          Lookup a child entry by name.
 void putChild(java.lang.String name, AVMNode node)
          Put a new child node into this directory.
 void removeChild(org.alfresco.repo.avm.Lookup lPath, java.lang.String name)
          Remove a child, no copying.
 void retarget(org.alfresco.repo.avm.Lookup lPath, java.lang.String target)
          Retarget this directory.
 java.lang.String toString(org.alfresco.repo.avm.Lookup lPath)
          Get a diagnostic String representation.
 void turnPrimary(org.alfresco.repo.avm.Lookup lPath)
          Turn this into a primary indirection.
 
Methods inherited from class org.alfresco.repo.avm.DirectoryNodeImpl
directlyContains, link, lookupChild
 
Methods inherited from class org.alfresco.repo.avm.AVMNodeImpl
addAspect, addProperties, changeAncestor, checkReadOnly, copyACLs, copyACLs, copyACLs, copyACLs, copyAspects, copyCreationAndOwnerBasicAttributes, copyMetaDataFrom, copyProperties, deleteProperties, deleteProperty, equals, getAcl, getAncestor, getAspects, getBasicAttributes, getGuid, getId, getIsNew, getIsRoot, getMergedFrom, getProperties, getProperty, getStoreNew, getVers, getVersionID, hashCode, removeAspect, setAcl, setAncestor, setAspects, setBasicAttributes, setGuid, setId, setIsRoot, setMergedFrom, setProperties, setProperty, setStoreNew, setVers, setVersionID, toString, updateModTime
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.alfresco.repo.avm.DirectoryNode
directlyContains, link, lookupChild, setIsRoot
 
Methods inherited from interface org.alfresco.repo.avm.AVMNode
addAspect, addProperties, changeAncestor, copyACLs, copyACLs, copyMetaDataFrom, deleteProperties, deleteProperty, getAcl, getAncestor, getAspects, getBasicAttributes, getGuid, getId, getIsNew, getIsRoot, getMergedFrom, getProperties, getProperty, getStoreNew, getVersionID, removeAspect, setAcl, setAncestor, setGuid, setMergedFrom, setProperties, setProperty, setStoreNew, setVersionID, updateModTime
 

Constructor Detail

PlainDirectoryNodeImpl

public PlainDirectoryNodeImpl(AVMStore store)
Make up a new directory with nothing in it.

Parameters:
store -

PlainDirectoryNodeImpl

public PlainDirectoryNodeImpl()
Default constructor.


PlainDirectoryNodeImpl

public PlainDirectoryNodeImpl(PlainDirectoryNode other,
                              AVMStore store,
                              java.lang.Long parentAcl,
                              ACLCopyMode mode)
Copy like constructor.

Parameters:
other - The other directory.
repos - The AVMStore Object that will own us.
Method Detail

getListing

public java.util.Map getListing(org.alfresco.repo.avm.Lookup lPath,
                                boolean includeDeleted)
Get a directory listing.

Specified by:
getListing in interface DirectoryNode
Parameters:
lPath - The lookup path.
Returns:
The listing.

getListing

public java.util.Map getListing(org.alfresco.repo.avm.Lookup lPath,
                                java.lang.String childNamePattern,
                                boolean includeDeleted)
Get a directory listing.

Specified by:
getListing in interface DirectoryNode
Parameters:
lPath - The lookup path.
childNamePattern - A child name pattern.
includeDeleted - Include deleted nodes.
Returns:
The listing.

getListingDirect

public java.util.Map getListingDirect(org.alfresco.repo.avm.Lookup lPath,
                                      boolean includeDeleted)
Get a listing of the nodes directly contained by a directory.

Specified by:
getListingDirect in interface DirectoryNode
Parameters:
lPath - The Lookup to this directory.
Returns:
A Map of names to nodes.

getListingDirect

public java.util.SortedMap getListingDirect(AVMNodeDescriptor dir,
                                            boolean includeDeleted)
Get a listing of the nodes directly contained by a directory.

Specified by:
getListingDirect in interface DirectoryNode
Parameters:
dir - The node's descriptor.
includeDeleted - Whether to include deleted nodes.
Returns:
A Map of Strings to descriptors.

getListing

public java.util.SortedMap getListing(AVMNodeDescriptor dir,
                                      boolean includeDeleted)
Get a listing of from a directory node descriptor.

Specified by:
getListing in interface DirectoryNode
Parameters:
dir - The directory node descriptor.
Returns:
A Map of names to node descriptors.

getListing

public java.util.SortedMap getListing(AVMNodeDescriptor dir,
                                      java.lang.String childNamePattern,
                                      boolean includeDeleted)
Get a listing of from a directory node descriptor.

Specified by:
getListing in interface DirectoryNode
Parameters:
dir - The directory node descriptor.
childNamePattern - - pattern to match for child names - may be null
includeDeleted - = include deleted children
Returns:
A Map of names to node descriptors.

getDeletedNames

public java.util.List getDeletedNames()
Get the names of nodes deleted in this directory.

Specified by:
getDeletedNames in interface DirectoryNode
Returns:
A List of names.

lookupChildEntry

public org.alfresco.util.Pair lookupChildEntry(org.alfresco.repo.avm.Lookup lPath,
                                               java.lang.String name,
                                               boolean includeDeleted)
Lookup a child entry by name.

Specified by:
lookupChildEntry in interface DirectoryNode
Parameters:
lPath - The lookup path so far.
name - The name to lookup.
includeDeleted - Whether to lookup deleted nodes.
Returns:
The child entry or null.

lookupChild

public AVMNodeDescriptor lookupChild(AVMNodeDescriptor mine,
                                     java.lang.String name,
                                     boolean includeDeleted)
Lookup a child using a node descriptor as context.

Specified by:
lookupChild in interface DirectoryNode
Parameters:
mine - The node descriptor for this.
name - The name of the child to lookup.
Returns:
A node descriptor for the child.

removeChild

public void removeChild(org.alfresco.repo.avm.Lookup lPath,
                        java.lang.String name)
Remove a child, no copying.

Specified by:
removeChild in interface DirectoryNode
Parameters:
lPath - The path by which this was found.
name - The name of the child to remove.

putChild

public void putChild(java.lang.String name,
                     AVMNode node)
Put a new child node into this directory. No copy.

Specified by:
putChild in interface DirectoryNode
Parameters:
name - The name of the child.
node - The node to add.

copy

public AVMNode copy(org.alfresco.repo.avm.Lookup lPath)
Copy on write logic.

Specified by:
copy in interface AVMNode
Parameters:
lPath - The lookup path.
Returns:
A brand new copied version.

getType

public int getType()
Get the type of this node.

Specified by:
getType in interface AVMNode
Returns:
The type of this node.

toString

public java.lang.String toString(org.alfresco.repo.avm.Lookup lPath)
Get a diagnostic String representation.

Specified by:
toString in interface AVMNode
Parameters:
lPath - The Lookup.
Returns:
A diagnostic String representation.

turnPrimary

public void turnPrimary(org.alfresco.repo.avm.Lookup lPath)
Turn this into a primary indirection. This must be in a layered context.

Specified by:
turnPrimary in interface DirectoryNode
Parameters:
lPath - The Lookup.

retarget

public void retarget(org.alfresco.repo.avm.Lookup lPath,
                     java.lang.String target)
Retarget this directory. lPath must be in a layered context.

Specified by:
retarget in interface DirectoryNode
Parameters:
lPath - The Lookup.
target - The target path.

getDescriptor

public AVMNodeDescriptor getDescriptor(org.alfresco.repo.avm.Lookup lPath,
                                       java.lang.String name)
Get the descriptor for this node.

Specified by:
getDescriptor in interface AVMNode
Parameters:
lPath - The Lookup.
name - The name of this node in this context.
Returns:
A descriptor.

getDescriptor

public AVMNodeDescriptor getDescriptor(org.alfresco.repo.avm.Lookup lPath)
Get the descriptor for this node.

Specified by:
getDescriptor in interface AVMNode
Parameters:
lPath - The Lookup.
Returns:
A descriptor.

getDescriptor

public AVMNodeDescriptor getDescriptor(java.lang.String parentPath,
                                       java.lang.String name,
                                       java.lang.String parentIndirection,
                                       int parentIndirectionVersion)
Get this node's descriptor.

Specified by:
getDescriptor in interface AVMNode
Parameters:
parentPath - The parent path.
name - The name that we were looked up under.
parentIndirection - The parent indirection.
parentIndirectionVersion - The indirection version of the parent.
Returns:
This node's node descriptor

link

public void link(org.alfresco.repo.avm.Lookup lPath,
                 java.lang.String name,
                 AVMNodeDescriptor toLink)
Link a node with the given id into this directory.

Specified by:
link in interface DirectoryNode
Parameters:
lPath - The Lookup for this directory.
name - The name to give the node.
toLink - The node to link in.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.