public void addChildNodes(final NodeData parentData, final List<NodeData> childItems)
   {
      if (enabled && parentData != null && childItems != null)
      {
         String logInfo = null;
         if (LOG.isDebugEnabled())
         {
            logInfo =
               "parent:   " + parentData.getQPath().getAsString() + "    " + parentData.getIdentifier() + " "
                  + childItems.size();
            LOG.debug(name + ", addChildNodes() >>> " + logInfo);
         }

         String operName = ""; // for debug/trace only

         writeLock.lock();
         try
         {
            // remove parent (no childs)
            operName = "removing parent";
            removeItem(parentData);

            operName = "caching parent";
            putItem(parentData); // put parent in cache

            synchronized (childItems)
            {
               operName = "caching child nodes list";
               nodesCache.put(parentData.getIdentifier(), childItems); // put childs
               // in cache CN

               operName = "caching child nodes";
               // put childs in cache C
               for (ItemData n : childItems)
               {
                  if (LOG.isDebugEnabled())
                  {
                     LOG.debug(name + ", addChildNodes()    " + n.getQPath().getAsString() + "    " + n.getIdentifier()
                        + "  --  " + n);
                  }

                  putItem(n);
               }
            }
         }
         catch (Exception e)
         {
            LOG.error(name + ", Error in addChildNodes() " + operName + ": parent "
               + (parentData != null ? parentData.getQPath().getAsString() : "[null]"), e);
         }
         finally
         {
            writeLock.unlock();
         }

         if (LOG.isDebugEnabled())
         {
            LOG.debug(name + ", addChildNodes() <<< " + logInfo);
         }
      }
   }
public void addChildNodes ( final NodeData parentData , final List < NodeData > childItems ) { if ( enabled && parentData != null && childItems != null ) { String logInfo = null ; if ( LOG . isDebugEnabled ( ) ) { logInfo = "parent:   " + parentData . getQPath ( ) . getAsString ( ) + "    " + parentData . getIdentifier ( ) + " " + childItems . size ( ) ; LOG . debug ( name + ", addChildNodes() >>> " + logInfo ) ; } String operName = "" ; writeLock . lock ( ) ; try { operName = "removing parent" ; removeItem ( parentData ) ; operName = "caching parent" ; putItem ( parentData ) ; synchronized ( childItems ) { operName = "caching child nodes list" ; nodesCache . put ( parentData . getIdentifier ( ) , childItems ) ; operName = "caching child nodes" ; for ( ItemData n : childItems ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( name + ", addChildNodes()    " + n . getQPath ( ) . getAsString ( ) + "    " + n . getIdentifier ( ) + "  --  " + n ) ; } putItem ( n ) ; } } } catch ( Exception e ) { LOG . error ( name + ", Error in addChildNodes() " + operName + ": parent " + ( parentData != null ? parentData . getQPath ( ) . getAsString ( ) : "[null]" ) , e ) ; } finally { writeLock . unlock ( ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( name + ", addChildNodes() <<< " + logInfo ) ; } } }
{@inheritDoc}