org.apache.jackrabbit.core.persistence.util
Class NodePropBundle

java.lang.Object
  extended by org.apache.jackrabbit.core.persistence.util.NodePropBundle

public class NodePropBundle
extends Object

This Class provides a simple structure to hold the nodestate and related propertystate data.


Nested Class Summary
static class NodePropBundle.ChildNodeEntry
          Helper class for a child node entry
static class NodePropBundle.PropertyEntry
          Helper class for a property enrty
 
Constructor Summary
NodePropBundle(NodeId id)
          Creates a "new" bundle with the given id
NodePropBundle(NodeState state)
          Creates a bundle from the given state
 
Method Summary
 void addChildNodeEntry(Name name, NodeId id)
          Adds a child node entry.
 void addProperty(NodePropBundle.PropertyEntry entry)
          Adds a new property entry
 void addProperty(PropertyState state, BLOBStore blobStore)
          Creates a property entry from the given state and adds it.
 NodeState createNodeState(PersistenceManager pMgr)
          Creates a node state from the values of this bundle
 boolean equals(Object object)
           
 List<NodePropBundle.ChildNodeEntry> getChildNodeEntries()
          Returns the list of the child node entries.
 NodeId getId()
          Returns the node id of this bundle
 Set<Name> getMixinTypeNames()
          Returns the mixin type names of this bundle.
 short getModCount()
          Retrusn the mod clount.
 Name getNodeTypeName()
          Returns the nodetype name of this bundle
 NodeId getParentId()
          Returns the parent id of this bundle
 Collection<NodePropBundle.PropertyEntry> getPropertyEntries()
          Returns a collection of property entries.
 NodePropBundle.PropertyEntry getPropertyEntry(Name name)
          Returns the property entry with the given name.
 Set<Name> getPropertyNames()
          Returns a set of the property names.
 Set<NodeId> getSharedSet()
          Sets the shared set of this bundle.
 long getSize()
          Returns the approx. size of this bundle.
 boolean hasProperty(Name name)
          Checks if this bundle has a property
 boolean isNew()
          Checks if this bundle is new.
 boolean isReferenceable()
          Checks if this bundle is referenceable.
 void markOld()
          Marks this bunlde as 'not new'.
 void removeAllProperties(BLOBStore blobStore)
          Removes all property entries
 void removeProperty(Name name, BLOBStore blobStore)
          Removes the proprty with the given name from this bundle.
 void setMixinTypeNames(Set<Name> mixinTypeNames)
          Sets the mixin type names
 void setModCount(short modCount)
          Sets the mod count
 void setNodeTypeName(Name nodeTypeName)
          Sets the node type name
 void setParentId(NodeId parentId)
          Sets the parent id
 void setReferenceable(boolean referenceable)
          Sets the is referenceable flag on this bundle
 void setSharedSet(Set<NodeId> sharedSet)
          Sets the shared set.
 void setSize(long size)
          Sets the data size of this bundle
 String toString()
           
 void update(NodeState state)
          Updates this bundle with values from the given state.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodePropBundle

public NodePropBundle(NodeId id)
Creates a "new" bundle with the given id

Parameters:
id - the node id

NodePropBundle

public NodePropBundle(NodeState state)
Creates a bundle from the given state

Parameters:
state - the node state
Method Detail

update

public void update(NodeState state)
Updates this bundle with values from the given state.

Parameters:
state - the node state

createNodeState

public NodeState createNodeState(PersistenceManager pMgr)
Creates a node state from the values of this bundle

Parameters:
pMgr - the persistence manager
Returns:
the new nodestate

isNew

public boolean isNew()
Checks if this bundle is new.

Returns:
true if this bundle is new; false otherwise.

markOld

public void markOld()
Marks this bunlde as 'not new'.


getId

public NodeId getId()
Returns the node id of this bundle

Returns:
the node id of this bundle

getParentId

public NodeId getParentId()
Returns the parent id of this bundle

Returns:
the parent id of this bundle

setParentId

public void setParentId(NodeId parentId)
Sets the parent id

Parameters:
parentId - the parent id

getNodeTypeName

public Name getNodeTypeName()
Returns the nodetype name of this bundle

Returns:
the nodetype name of this bundle

setNodeTypeName

public void setNodeTypeName(Name nodeTypeName)
Sets the node type name

Parameters:
nodeTypeName - the nodetype name

getMixinTypeNames

public Set<Name> getMixinTypeNames()
Returns the mixin type names of this bundle.

Returns:
the mixin type names of this bundle.

setMixinTypeNames

public void setMixinTypeNames(Set<Name> mixinTypeNames)
Sets the mixin type names

Parameters:
mixinTypeNames - the mixin type names

isReferenceable

public boolean isReferenceable()
Checks if this bundle is referenceable.

Returns:
true if this bundle is referenceable; false otherwise.

setReferenceable

public void setReferenceable(boolean referenceable)
Sets the is referenceable flag on this bundle

Parameters:
referenceable - the ref. flag

getModCount

public short getModCount()
Retrusn the mod clount.

Returns:
the mod clount.

setModCount

public void setModCount(short modCount)
Sets the mod count

Parameters:
modCount - the mod count

getChildNodeEntries

public List<NodePropBundle.ChildNodeEntry> getChildNodeEntries()
Returns the list of the child node entries.

Returns:
the list of the child node entries.

addChildNodeEntry

public void addChildNodeEntry(Name name,
                              NodeId id)
Adds a child node entry.

Parameters:
name - the name of the entry.
id - the id of the entry

addProperty

public void addProperty(NodePropBundle.PropertyEntry entry)
Adds a new property entry

Parameters:
entry - the enrty to add

addProperty

public void addProperty(PropertyState state,
                        BLOBStore blobStore)
Creates a property entry from the given state and adds it.

Parameters:
state - the property state
blobStore - BLOB store from where to delete previous property value

hasProperty

public boolean hasProperty(Name name)
Checks if this bundle has a property

Parameters:
name - the name of the property
Returns:
true if the property exists; false otherwise.

getPropertyNames

public Set<Name> getPropertyNames()
Returns a set of the property names.

Returns:
a set of the property names.

getPropertyEntries

public Collection<NodePropBundle.PropertyEntry> getPropertyEntries()
Returns a collection of property entries.

Returns:
a collection of property entries.

getPropertyEntry

public NodePropBundle.PropertyEntry getPropertyEntry(Name name)
Returns the property entry with the given name.

Parameters:
name - the name of the property entry
Returns:
the desired property entry or null

removeAllProperties

public void removeAllProperties(BLOBStore blobStore)
Removes all property entries

Parameters:
blobStore - BLOB store from where to delete property values

removeProperty

public void removeProperty(Name name,
                           BLOBStore blobStore)
Removes the proprty with the given name from this bundle.

Parameters:
name - the name of the property
blobStore - BLOB store from where to delete the property value

getSharedSet

public Set<NodeId> getSharedSet()
Sets the shared set of this bundle.

Returns:
the shared set of this bundle.

setSharedSet

public void setSharedSet(Set<NodeId> sharedSet)
Sets the shared set.

Parameters:
sharedSet - shared set

getSize

public long getSize()
Returns the approx. size of this bundle.

Returns:
the approx. size of this bundle.

setSize

public void setSize(long size)
Sets the data size of this bundle

Parameters:
size - the data size

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.