Class NodePropBundle


  • public class NodePropBundle
    extends Object
    This Class provides a simple structure to hold the nodestate and related propertystate data.
    • 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 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 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.
      • 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