Class Node

java.lang.Object
org.nuxeo.ecm.core.storage.sql.Node
All Implemented Interfaces:
StateAccessor

public class Node extends Object implements StateAccessor
A Node implementation. The actual data is stored in contained objects that are Fragments.
  • Field Details

    • hierFragment

      protected final SimpleFragment hierFragment
      The hierarchy/main fragment.
    • fragments

      protected final org.nuxeo.ecm.core.storage.sql.FragmentsMap fragments
      Fragment information for each additional mixin or inherited fragment.
    • path

      protected String path
      Path, only for immediate consumption after construction (will be reset to null afterwards).
  • Constructor Details

    • Node

      protected Node(PersistenceContext context, org.nuxeo.ecm.core.storage.sql.FragmentGroup fragmentGroup, String path)
      Creates a Node.
      Parameters:
      context - the persistence context
      fragmentGroup - the group of fragments for the node
      path - the path, if known at construction time
  • Method Details

    • getId

      public Serializable getId()
      Gets the node unique id, usually a Long or a String.
      Returns:
      the node id
    • getName

      public String getName()
    • getPos

      public Long getPos()
    • getPrimaryType

      public String getPrimaryType()
    • getParentId

      public Serializable getParentId()
    • getPath

      public String getPath()
      Gets the path that was assigned at Node construction time. Then it's reset to null. Should only be used once.
      Returns:
      the path, or null for unknown
    • getHierFragment

      protected SimpleFragment getHierFragment()
    • isVersion

      public boolean isVersion()
    • isProxy

      public boolean isProxy()
    • isRecord

      public boolean isRecord()
    • isFlexibleRecord

      public boolean isFlexibleRecord()
      Since:
      2023.1
    • getMixinTypes

      public String[] getMixinTypes()
      Gets the instance mixins. Mixins from the type are not returned.

      Never returns null.

    • getRetainedProperties

      public String[] getRetainedProperties()
      Gets the retained properties.

      Never returns null.

      Since:
      2021.32
    • setRetainedProperties

      public void setRetainedProperties(String[] retainedProps)
      Sets the retained properties.
      Parameters:
      retainedProps - the retained properties.
      Since:
      2021.32
    • getAllMixinTypes

      public Set<String> getAllMixinTypes()
      Gets the mixins. Includes mixins from the type. Returns a fresh set.
    • hasMixinType

      public boolean hasMixinType(String mixin)
      Checks the mixins. Includes mixins from the type.
    • clearCache

      protected void clearCache()
      Clears the properties cache, used when removing mixins.
    • getSimpleProperty

      public SimpleProperty getSimpleProperty(String name)
      Gets a simple property from the node, given its name.
      Parameters:
      name - the property name
      Returns:
      the property
      Throws:
      PropertyNotFoundException - if the name is invalid
    • makeSimpleProperty

      protected SimpleProperty makeSimpleProperty(String name, ModelProperty propertyInfo)
    • getCollectionProperty

      public CollectionProperty getCollectionProperty(String name)
      Gets a collection property from the node, given its name.
      Parameters:
      name - the property name
      Returns:
      the property
      Throws:
      PropertyNotFoundException - if the name is invalid
    • makeCollectionProperty

      protected CollectionProperty makeCollectionProperty(String name, ModelProperty propertyInfo)
    • getPropertyInfo

      protected ModelProperty getPropertyInfo(String name)
    • setSimpleProperty

      public void setSimpleProperty(String name, Object value)
    • setCollectionProperty

      public void setCollectionProperty(String name, Object[] value)
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSingle

      public Object getSingle(String name) throws PropertyException
      Description copied from interface: StateAccessor
      Gets a single value.
      Specified by:
      getSingle in interface StateAccessor
      Parameters:
      name - the name
      Returns:
      the value
      Throws:
      PropertyException
    • getArray

      public Object[] getArray(String name) throws PropertyException
      Description copied from interface: StateAccessor
      Gets an array value.
      Specified by:
      getArray in interface StateAccessor
      Parameters:
      name - the name
      Returns:
      the value
      Throws:
      PropertyException
    • setSingle

      public void setSingle(String name, Object value) throws PropertyException
      Description copied from interface: StateAccessor
      Sets a single value.
      Specified by:
      setSingle in interface StateAccessor
      Parameters:
      name - the name
      value - the value
      Throws:
      PropertyException
    • setArray

      public void setArray(String name, Object[] value) throws PropertyException
      Description copied from interface: StateAccessor
      Sets an array value.
      Specified by:
      setArray in interface StateAccessor
      Parameters:
      name - the name
      value - the value
      Throws:
      PropertyException