|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.core.storage.sql.Children
public class Children
Holds information about the children of a given parent node. The internal state reflects:
Children are stored in no particular order.
When this structure holds information all flushed to the database, then it can safely be GC'ed, so it lives in a memory-sensitive map (softMap), otherwise it's moved to a normal map (hardMap).
This class is not thread-safe and should be used only from a single-threaded session.
Constructor Summary | |
---|---|
Children(HierarchyContext hierContext,
java.lang.String filterKey,
boolean empty,
java.io.Serializable mapKey,
java.util.Map<java.io.Serializable,Children> softMap,
java.util.Map<java.io.Serializable,Children> hardMap)
Constructs a Children cache. |
Method Summary | |
---|---|
void |
addCreated(java.io.Serializable id)
Adds a created child. |
void |
addExisting(java.io.Serializable id)
Adds a known child. |
void |
addExistingComplete(java.util.List<java.io.Serializable> actualExisting)
Adds ids actually read from the backend, and mark this complete. |
void |
flush()
Flushes to database. |
SimpleFragment |
getFragmentByValue(java.io.Serializable value)
Gets a fragment given its name. |
java.util.List<SimpleFragment> |
getFragmentsByValue(java.io.Serializable value)
Gets all the fragments, if the list of children is complete. |
boolean |
isFlushed()
|
void |
remove(java.io.Serializable id)
Removes a known child id. |
void |
setIncomplete()
Marks as incomplete. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Children(HierarchyContext hierContext, java.lang.String filterKey, boolean empty, java.io.Serializable mapKey, java.util.Map<java.io.Serializable,Children> softMap, java.util.Map<java.io.Serializable,Children> hardMap)
It is automatically put in the soft map.
hierContext
- the context from which to fetch hierarchy fragmentsfilterKey
- the key to use to filter on namesempty
- if the new instance is created emptymapKey
- the key to use in the following mapssoftMap
- the soft map, when the children are pristinehardMap
- the hard map, when there are modifications to flushMethod Detail |
---|
public void addExisting(java.io.Serializable id)
id
- the fragment idpublic void addCreated(java.io.Serializable id)
id
- the fragment idpublic void addExistingComplete(java.util.List<java.io.Serializable> actualExisting)
Note that when adding a complete list of ids retrieved from the database, the deleted ids have already been removed in the result set.
actualExisting
- the existing database ids (the list must be
mutable)public void setIncomplete()
Called after a database operation added children with unknown ids (restore of complex properties).
public void remove(java.io.Serializable id)
id
- the id to removepublic void flush()
Puts this in the soft map. Caller must remove from hard map.
public boolean isFlushed()
public SimpleFragment getFragmentByValue(java.io.Serializable value)
Returns null
if there is no such child.
Returns SimpleFragment.UNKNOWN
if there's no info about it.
value
- the name
null
, or SimpleFragment.UNKNOWN
public java.util.List<SimpleFragment> getFragmentsByValue(java.io.Serializable value)
value
- the name to filter on, or null
for all children
null
if the list is not known to be
complete
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |