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

java.lang.Object
  extended by org.apache.jackrabbit.core.persistence.bundle.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(QName name, NodeId id)
          Adds a child node entry.
 void addProperty(NodePropBundle.PropertyEntry entry)
          Adds a new property entry
 void addProperty(PropertyState state)
          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
 PropertyState createPropertyState(PersistenceManager pMgr, QName name)
          Creates a property state from the values of this bundle
 List getChildNodeEntries()
          Returns the list of the child node entries.
 NodeId getId()
          Returns the node id of this bundle
 Set getMixinTypeNames()
          Returns the mixin type names of this bundle.
 short getModCount()
          Retrusn the mod clount.
 NodeDefId getNodeDefId()
          Returns the node def id of this bundle.
 QName getNodeTypeName()
          Returns the nodetype name of this bundle
 NodeId getParentId()
          Returns the parent id of this bundle
 Collection getPropertyEntries()
          Returns a collection of property entries.
 NodePropBundle.PropertyEntry getPropertyEntry(QName name)
          Returns the property entry with the given name.
 Set getPropertyNames()
          Returns a set of the property names.
 long getSize()
          Returns the approx.
 boolean hasProperty(QName 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()
          Removes all property entries
 void removeProperty(QName name)
          Removes the proprty with the given name from this bundle.
 void setMixinTypeNames(Set mixinTypeNames)
          Sets the mixin type names
 void setModCount(short modCount)
          Sets the mod count
 void setNodeDefId(NodeDefId nodeDefId)
          Sets the node def id.
 void setNodeTypeName(QName 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 setSize(long size)
          Sets the data size of this bundle
 void update(NodeState state)
          Updates this bundle with values from the given state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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

createPropertyState

public PropertyState createPropertyState(PersistenceManager pMgr,
                                         QName name)
Creates a property state from the values of this bundle

Parameters:
pMgr - the persistence manager
name - the name of the new property
Returns:
the new property state

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 QName getNodeTypeName()
Returns the nodetype name of this bundle

Returns:
the nodetype name of this bundle

setNodeTypeName

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

Parameters:
nodeTypeName - the nodetype name

getMixinTypeNames

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

Returns:
the mixin type names of this bundle.

setMixinTypeNames

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

Parameters:
mixinTypeNames - the mixin type names

getNodeDefId

public NodeDefId getNodeDefId()
Returns the node def id of this bundle.

Returns:
the node def id.

setNodeDefId

public void setNodeDefId(NodeDefId nodeDefId)
Sets the node def id.

Parameters:
nodeDefId - the node def id.

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 getChildNodeEntries()
Returns the list of the child node entries.

Returns:
the list of the child node entries.

addChildNodeEntry

public void addChildNodeEntry(QName 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)
Creates a property entry from the given state and adds it.

Parameters:
state - the property state

hasProperty

public boolean hasProperty(QName 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 getPropertyNames()
Returns a set of the property names.

Returns:
a set of the property names.

getPropertyEntries

public Collection getPropertyEntries()
Returns a collection of property entries.

Returns:
a collection of property entries.

getPropertyEntry

public NodePropBundle.PropertyEntry getPropertyEntry(QName 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()
Removes all property entries


removeProperty

public void removeProperty(QName name)
Removes the proprty with the given name from this bundle.

Parameters:
name - the name of the property

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


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