org.alfresco.repo.avm
Class AVMNodeImpl

java.lang.Object
  extended by org.alfresco.repo.avm.AVMNodeImpl
All Implemented Interfaces:
AVMNode
Direct Known Subclasses:
DeletedNodeImpl, DirectoryNodeImpl, LayeredFileNodeImpl, PlainFileNodeImpl

public abstract class AVMNodeImpl
extends java.lang.Object
implements AVMNode

Base class for all repository file system like objects.


Field Summary
protected static boolean DEBUG
           
 
Constructor Summary
protected AVMNodeImpl()
          Default constructor.
protected AVMNodeImpl(AVMStore store)
          Constructor used when creating a new concrete subclass instance.
 
Method Summary
 void addAspect(org.alfresco.service.namespace.QName aspectQName)
           
 void addProperties(java.util.Map properties)
          Add properties to those that already exist.
 void changeAncestor(AVMNode ancestor)
          Change the ancestor of this node.
protected  void checkReadOnly()
           
 void copyACLs(Acl otherAcl, Acl parentAcl, ACLCopyMode mode)
           
 void copyACLs(AVMNode other, ACLCopyMode mode)
          Copy ACL from another node.
protected  void copyACLs(AVMNode other, java.lang.Long parentAcl, ACLCopyMode mode)
           
protected  void copyACLs(java.lang.Long otherAcl, java.lang.Long parentAcl, ACLCopyMode mode)
           
protected  void copyAspects(AVMNode other)
          Copy all aspects from another node.
protected  void copyCreationAndOwnerBasicAttributes(AVMNode other)
           
 void copyMetaDataFrom(AVMNode other, java.lang.Long parentAcl)
          Copy out metadata from another node.
protected  void copyProperties(AVMNode other)
          Copy all properties from another node.
 void deleteProperties()
          Delete all properties from this node.
 void deleteProperty(org.alfresco.service.namespace.QName qname)
          Delete a property from this node.
 boolean equals(java.lang.Object obj)
          Equality based on object ids.
 Acl getAcl()
          Get the ACL on this node.
 AVMNode getAncestor()
          Get the ancestor of this node.
 java.util.Set getAspects()
          Get the Aspects that this node has.
 BasicAttributes getBasicAttributes()
          Get the basic attributes.
 java.lang.String getGuid()
          Get the GUID associated with this version.
 long getId()
          Get the id of this node.
 boolean getIsNew()
          Get whether this is a new node.
 boolean getIsRoot()
          Get whether this is a root node.
 AVMNode getMergedFrom()
          Get the node that was merged into this.
 java.util.Map getProperties()
          Get all the properties associated with this node.
 PropertyValue getProperty(org.alfresco.service.namespace.QName qname)
          Get a property by name.
 AVMStore getStoreNew()
          Get the possibly null store we are new in.
 long getVers()
          Get the version (for concurrency control).
 int getVersionID()
          Get the version id of this node.
 int hashCode()
          Get a reasonable hash value.
 void removeAspect(org.alfresco.service.namespace.QName aspectQName)
           
 void setAcl(Acl acl)
          Set the ACL on this node.
 void setAncestor(AVMNode ancestor)
          Set the ancestor of this node.
 void setAspects(java.util.Set aspects)
          Set the aspects on this node.
 void setBasicAttributes(BasicAttributes attrs)
          Set the basic attributes.
 void setGuid(java.lang.String guid)
          Set the GUID associated with this version.
 void setId(long id)
          Set the object id.
 void setIsRoot(boolean isRoot)
          Set whether this node to be a root of a AVMStore
 void setMergedFrom(AVMNode mergedFrom)
          Set the node that was merged into this.
 void setProperties(java.util.Map properties)
          Set a collection of properties on this node.
 void setProperty(org.alfresco.service.namespace.QName qname, PropertyValue value)
          Set a property on a node.
 void setStoreNew(AVMStore store)
          Set the store we are new in.
 void setVers(long vers)
          Set the version (for concurrency control).
 void setVersionID(int versionID)
          Set the versionID for this node.
 java.lang.String toString()
           
 void updateModTime()
          Update the modification time of this node.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.alfresco.repo.avm.AVMNode
copy, getDescriptor, getDescriptor, getDescriptor, getType, toString
 

Field Detail

DEBUG

protected static final boolean DEBUG
Constructor Detail

AVMNodeImpl

protected AVMNodeImpl()
Default constructor.


AVMNodeImpl

protected AVMNodeImpl(AVMStore store)
Constructor used when creating a new concrete subclass instance.

Parameters:
store - The AVMStore that owns this.
Method Detail

setAncestor

public void setAncestor(AVMNode ancestor)
Set the ancestor of this node.

Specified by:
setAncestor in interface AVMNode
Parameters:
ancestor - The ancestor to set.

changeAncestor

public void changeAncestor(AVMNode ancestor)
Change the ancestor of this node.

Specified by:
changeAncestor in interface AVMNode
Parameters:
ancestor - The new ancestor to give it.

getAncestor

public AVMNode getAncestor()
Get the ancestor of this node.

Specified by:
getAncestor in interface AVMNode
Returns:
The ancestor of this node.

setMergedFrom

public void setMergedFrom(AVMNode mergedFrom)
Set the node that was merged into this.

Specified by:
setMergedFrom in interface AVMNode
Parameters:
mergedFrom - The node that was merged into this.

getMergedFrom

public AVMNode getMergedFrom()
Get the node that was merged into this.

Specified by:
getMergedFrom in interface AVMNode
Returns:
The node that was merged into this.

equals

public boolean equals(java.lang.Object obj)
Equality based on object ids.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The thing to compare against.
Returns:
Equality.

hashCode

public int hashCode()
Get a reasonable hash value.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.

setId

public void setId(long id)
Set the object id.

Parameters:
id - The id to set.

getId

public long getId()
Get the id of this node.

Specified by:
getId in interface AVMNode
Returns:
The object id.

setVersionID

public void setVersionID(int versionID)
Set the versionID for this node.

Specified by:
setVersionID in interface AVMNode
Parameters:
versionID - The id to set.

getVersionID

public int getVersionID()
Get the version id of this node.

Specified by:
getVersionID in interface AVMNode
Returns:
The version id.

setBasicAttributes

public void setBasicAttributes(BasicAttributes attrs)
Set the basic attributes.

Parameters:
attrs -

getBasicAttributes

public BasicAttributes getBasicAttributes()
Get the basic attributes.

Specified by:
getBasicAttributes in interface AVMNode
Returns:
The basic attributes.

getIsNew

public boolean getIsNew()
Get whether this is a new node.

Specified by:
getIsNew in interface AVMNode
Returns:
Whether this is new.

setVers

public void setVers(long vers)
Set the version (for concurrency control).

Parameters:
The - version for optimistic locks.

getVers

public long getVers()
Get the version (for concurrency control).

Returns:
vers The version for optimistic locks.

getIsRoot

public boolean getIsRoot()
Get whether this is a root node.

Specified by:
getIsRoot in interface AVMNode
Returns:
Whether this is a root node.

setIsRoot

public void setIsRoot(boolean isRoot)
Description copied from interface: AVMNode
Set whether this node to be a root of a AVMStore

Specified by:
setIsRoot in interface AVMNode
Parameters:
isRoot -

updateModTime

public void updateModTime()
Description copied from interface: AVMNode
Update the modification time of this node.

Specified by:
updateModTime in interface AVMNode

copyProperties

protected void copyProperties(AVMNode other)
Copy all properties from another node.

Parameters:
other - The other node.

copyAspects

protected void copyAspects(AVMNode other)
Copy all aspects from another node.

Parameters:
other - The other node.

copyCreationAndOwnerBasicAttributes

protected void copyCreationAndOwnerBasicAttributes(AVMNode other)

copyACLs

public void copyACLs(AVMNode other,
                     ACLCopyMode mode)
Description copied from interface: AVMNode
Copy ACL from another node.

Specified by:
copyACLs in interface AVMNode

copyACLs

public void copyACLs(Acl otherAcl,
                     Acl parentAcl,
                     ACLCopyMode mode)
Specified by:
copyACLs in interface AVMNode

copyACLs

protected void copyACLs(AVMNode other,
                        java.lang.Long parentAcl,
                        ACLCopyMode mode)

copyACLs

protected void copyACLs(java.lang.Long otherAcl,
                        java.lang.Long parentAcl,
                        ACLCopyMode mode)

copyMetaDataFrom

public void copyMetaDataFrom(AVMNode other,
                             java.lang.Long parentAcl)
Copy out metadata from another node.

Specified by:
copyMetaDataFrom in interface AVMNode
Parameters:
other - The other node.

setProperty

public void setProperty(org.alfresco.service.namespace.QName qname,
                        PropertyValue value)
Set a property on a node. Overwrite it if it exists.

Specified by:
setProperty in interface AVMNode
Parameters:
name - The name of the property.
value - The value to set.

addProperties

public void addProperties(java.util.Map properties)
Description copied from interface: AVMNode
Add properties to those that already exist.

Specified by:
addProperties in interface AVMNode
Parameters:
properties - The properties to add.

setProperties

public void setProperties(java.util.Map properties)
Set a collection of properties on this node.

Specified by:
setProperties in interface AVMNode
Parameters:
properties - The Map of QNames to PropertyValues.

getProperty

public PropertyValue getProperty(org.alfresco.service.namespace.QName qname)
Get a property by name.

Specified by:
getProperty in interface AVMNode
Parameters:
name - The name of the property.
Returns:
The PropertyValue or null if non-existent.

getProperties

public java.util.Map getProperties()
Get all the properties associated with this node.

Specified by:
getProperties in interface AVMNode
Returns:
A Map of QNames to PropertyValues.

deleteProperty

public void deleteProperty(org.alfresco.service.namespace.QName qname)
Delete a property from this node.

Specified by:
deleteProperty in interface AVMNode
Parameters:
name - The name of the property.

deleteProperties

public void deleteProperties()
Delete all properties from this node.

Specified by:
deleteProperties in interface AVMNode

setAcl

public void setAcl(Acl acl)
Set the ACL on this node.

Specified by:
setAcl in interface AVMNode
Parameters:
acl - The ACL to set.

getAcl

public Acl getAcl()
Get the ACL on this node.

Specified by:
getAcl in interface AVMNode
Returns:
The ACL on this node.

setStoreNew

public void setStoreNew(AVMStore store)
Set the store we are new in.

Specified by:
setStoreNew in interface AVMNode
Parameters:
store - The store we are new in.

getStoreNew

public AVMStore getStoreNew()
Get the possibly null store we are new in.

Specified by:
getStoreNew in interface AVMNode
Returns:
The store we are new in.

checkReadOnly

protected void checkReadOnly()

getGuid

public java.lang.String getGuid()
Description copied from interface: AVMNode
Get the GUID associated with this version.

Specified by:
getGuid in interface AVMNode
Returns:
The GUID.

setGuid

public void setGuid(java.lang.String guid)
Description copied from interface: AVMNode
Set the GUID associated with this version.

Specified by:
setGuid in interface AVMNode

getAspects

public java.util.Set getAspects()
Description copied from interface: AVMNode
Get the Aspects that this node has.

Specified by:
getAspects in interface AVMNode
Returns:
A Set of Aspects IDs.

setAspects

public void setAspects(java.util.Set aspects)
Set the aspects on this node.

Parameters:
aspects -

addAspect

public void addAspect(org.alfresco.service.namespace.QName aspectQName)
Specified by:
addAspect in interface AVMNode

removeAspect

public void removeAspect(org.alfresco.service.namespace.QName aspectQName)
Specified by:
removeAspect in interface AVMNode

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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