Class NodePropBundle
- java.lang.Object
-
- 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
Nested Classes Modifier and Type Class Description static class
NodePropBundle.ChildNodeEntry
Helper class for a child node entrystatic class
NodePropBundle.PropertyEntry
Helper class for a property enrty
-
Constructor Summary
Constructors Constructor Description NodePropBundle(NodeId id)
Creates a "new" bundle with the given idNodePropBundle(NodeState state)
Creates a bundle from the given state
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChildNodeEntry(Name name, NodeId id)
Adds a child node entry.void
addProperty(NodePropBundle.PropertyEntry entry)
Adds a new property entryvoid
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 bundleboolean
equals(Object object)
List<NodePropBundle.ChildNodeEntry>
getChildNodeEntries()
Returns the list of the child node entries.NodeId
getId()
Returns the node id of this bundleSet<Name>
getMixinTypeNames()
Returns the mixin type names of this bundle.short
getModCount()
Returns the mod count.Name
getNodeTypeName()
Returns the nodetype name of this bundleNodeId
getParentId()
Returns the parent id of this bundleCollection<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.boolean
hasProperty(Name name)
Checks if this bundle has a propertyboolean
isNew()
Checks if this bundle is new.boolean
isReferenceable()
Checks if this bundle is referenceable.void
markOld()
Marks this bundle as 'not new'.void
removeAllProperties(BLOBStore blobStore)
Removes all property entriesvoid
removeProperty(Name name, BLOBStore blobStore)
Removes the proprty with the given name from this bundle.void
setMixinTypeNames(Set<Name> mixinTypeNames)
Sets the mixin type namesvoid
setModCount(short modCount)
Sets the mod countvoid
setNodeTypeName(Name nodeTypeName)
Sets the node type namevoid
setParentId(NodeId parentId)
Sets the parent idvoid
setReferenceable(boolean referenceable)
Sets the is referenceable flag on this bundlevoid
setSharedSet(Set<NodeId> sharedSet)
Sets the shared set.void
setSize(long size)
Sets the data size of this bundleString
toString()
void
update(NodeState state)
Updates this bundle with values from the given 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 bundle 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()
Returns the mod count.- Returns:
- the mod count.
-
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 stateblobStore
- 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 propertyblobStore
- 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
-
-