Add necessary information to node
@param dsNode The target binary node to add information to
@param descNode The description node associated with the binary node
@param checksums The checksum information
@throws RepositoryException on error
544774
private static void decorateContentNode(final Node dsNode, final Node descNode, final Collection<URI> checksums)
        throws RepositoryException {

        if (dsNode == null) {
            LOGGER.warn("{} node appears to be null!", JCR_CONTENT);
            return;
        }

        if (dsNode.hasProperty(JCR_DATA)) {
            final Property dataProperty = dsNode.getProperty(JCR_DATA);
            final Binary binary = (Binary) dataProperty.getBinary();
            final String dsChecksum = binary.getHexHash();

            checksums.add(ContentDigest.asURI(SHA1.algorithm, dsChecksum));

            final String[] checksumArray = new String[checksums.size()];
            checksums.stream().map(Object::toString).collect(Collectors.toSet()).toArray(checksumArray);

            if (descNode != null) {
                descNode.setProperty(CONTENT_DIGEST, checksumArray);
                descNode.setProperty(CONTENT_SIZE, dataProperty.getLength());
            }

            LOGGER.debug("Decorated data property at path: {}", dataProperty.getPath());
        }
    }
1314270
public NodeDefinitionData[] readNodeDefinitions(NodeData nodeData) throws NodeTypeReadException, RepositoryException
   {
      InternalQName name = null;
      List<NodeDefinitionData> nodeDefinitionDataList;

      List<NodeData> childDefinitions = dataManager.getChildNodesData(nodeData);

      if (childDefinitions.size() > 0)
         name = readMandatoryName(nodeData, null, Constants.JCR_NODETYPENAME);
      else
         return new NodeDefinitionData[0];

      nodeDefinitionDataList = new ArrayList<NodeDefinitionData>();
      for (NodeData childDefinition : childDefinitions)
      {
         if (Constants.NT_CHILDNODEDEFINITION.equals(childDefinition.getPrimaryTypeName()))
         {
            nodeDefinitionDataList.add(nodeDefinitionAccessProvider.read(childDefinition, name));
         }
      }

      return nodeDefinitionDataList.toArray(new NodeDefinitionData[nodeDefinitionDataList.size()]);
   }
1177844
public void setNodeData(byte[] nodeData)
    {
        this.nodeData = (nodeData != null) ? Arrays.copyOf(nodeData, nodeData.length) : null;
    }
334921
public static void registerAndAddMixinType(Session session, Node node, String mixin) throws RepositoryException {
        registerMixinType(session, mixin);
        if (!Arrays.asList(node.getMixinNodeTypes()).contains(mixin)) {
            node.addMixin(mixin);
        }
    }
930384
protected void addParentChildRelation(Document doc, String parentId) throws RepositoryException
   {
      doc.add(new Field(FieldNames.PARENT, parentId, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS,
         Field.TermVector.NO));
      //        NodeState parent = (NodeState) stateProvider.getItemState(parentId);
      //        ChildNodeEntry child = parent.getChildNodeEntry(node.getNodeId());
      //        if (child == null) {
      //            // this can only happen when jackrabbit
      //            // is running in a cluster.
      //            throw new RepositoryException(
      //                    "Missing child node entry for node with id: "
      //                    + node.getNodeId());
      //        }
      InternalQName name = node.getQPath().getName();
      addNodeName(doc, name.getNamespace(), name.getName());
   }
838463
public void addNode(int n)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

    this.addElement(n);
  }
264817
public void buildEnumSummary(XMLNode node, Content summaryContentTree) {
        String enumTableSummary =
                configuration.getText("doclet.Member_Table_Summary",
                configuration.getText("doclet.Enum_Summary"),
                configuration.getText("doclet.enums"));
        String[] enumTableHeader = new String[] {
            configuration.getText("doclet.Enum"),
            configuration.getText("doclet.Description")
        };
        ClassDoc[] enums =
                packageDoc.isIncluded()
                        ? packageDoc.enums()
                        : configuration.classDocCatalog.enums(
                                utils.getPackageName(packageDoc));
        enums = utils.filterOutPrivateClasses(enums, configuration.javafx);
        if (enums.length > 0) {
            packageWriter.addClassesSummary(
                    enums,
                    configuration.getText("doclet.Enum_Summary"),
                    enumTableSummary, enumTableHeader, summaryContentTree);
        }
    }
1019390
public void addNode(NodeT node) {
        node.setOwner(this);
        nodeTable.put(node.key(), node);
    }
1068311
public void add(ImprintNode... nodes) throws HashException {
        notNull(nodes, "Nodes");
        for (ImprintNode node : nodes) {
            add(node);
        }
    }
1358467
public void addNode (int x, int y, int dir)
    {
        _nodes.add(new PathNode(x, y, dir));
    }
1302160
public void addNode(CDKRNode newNode) {
        getGraph().add(newNode);
        getGraphBitSet().set(getGraph().size() - 1);
    }
818988
@Override
    public boolean add(RedisClusterNode redisClusterNode) {

        synchronized (partitions) {
            LettuceAssert.notNull(redisClusterNode, "RedisClusterNode must not be null");

            boolean add = getPartitions().add(redisClusterNode);
            updateCache();
            return add;
        }
    }
690595
public void addMessageDataDesc(MessageDataParent messageDataDesc)
    {
        if (m_messageDataDescChildren == null)
            m_messageDataDescChildren = new HashMap<String,MessageDataDesc>();
        if (messageDataDesc != null)
        {
            m_messageDataDescChildren.put(((MessageDataDesc)messageDataDesc).getKey(), (MessageDataDesc)messageDataDesc);
            ((MessageDataDesc)messageDataDesc).setMessageDataParent(this);
        }
    }
65201
public void merge(String parity, String source, String codecId, 
      int[] checksums) throws IOException {
    checkOpen();
    try {
      namenode.merge(parity, source, codecId, checksums);
    } catch (RemoteException re) {
      throw re.unwrapRemoteException(AccessControlException.class,
                                     NSQuotaExceededException.class,
                                     DSQuotaExceededException.class);
    }
  }
1210242
void putBranchNode(int lineNumber, int branchNumber, Node block) {
    Preconditions.checkArgument(
        lineNumber > 0, "Expected non-zero positive integer as line number: %s", lineNumber);
    Preconditions.checkArgument(
        branchNumber > 0, "Expected non-zero positive integer as branch number: %s", branchNumber);

    branchNodes.put(BranchIndexPair.of(lineNumber - 1, branchNumber - 1), block);
  }
322043
public static void addSoftEvidence(Network bn, String nodeName,
            HashMap<String, Double> softEvidence) throws ShanksException {
        String auxNodeName = softEvidenceNodePrefix + nodeName;
        int targetNode = bn.getNode(nodeName);
        boolean found = false;
        int[] children = bn.getChildren(targetNode);
        for (int child : children) {
            if (bn.getNodeName(child).equals(auxNodeName)) {
                if (bn.getOutcomeCount(child) == 2
                        && bn.getOutcomeId(child, 0).equals(triggerState)) {
                    found = true;
                    break;
                }
            }
        }
        if (!found) {
            // Create soft-evidence node
            bn.addNode(NodeType.Cpt, auxNodeName);
            bn.setNodeName(auxNodeName, auxNodeName);
            int node = bn.getNode(auxNodeName);
            bn.setOutcomeId(node, 0, triggerState);
            bn.setOutcomeId(node, 1, "NON" + triggerState);
            // bn.insertOutcome(auxNode, 0, triggerState);
            // bn.insertOutcome(auxNode, 1, "NON" + triggerState);
            double[] cpt = bn.getNodeDefinition(auxNodeName);
            for (int i = 0; i < cpt.length; i++) {
                cpt[i] = (float) 0.5;
            }

            bn.addArc(targetNode, bn.getNode(auxNodeName));
            cpt = bn.getNodeDefinition(auxNodeName);
            for (int i = 0; i < cpt.length; i++) {
                cpt[i] = (float) 0.5;
            }
        }
        ShanksAgentBayesianReasoningCapability
                .updateSoftEvidenceAuxiliaryNodeCPT(bn, nodeName, softEvidence);
        ShanksAgentBayesianReasoningCapability.addEvidence(bn,
                softEvidenceNodePrefix + nodeName, triggerState);

    }
57351
public void addVersion(NodeData versionableNodeData, String uuid, SessionChangesLog changesLog)
      throws RepositoryException
   {
      checkValid();

      NodeTypeDataManager ntManager = session.getWorkspace().getNodeTypesHolder();

      boolean isPrivilegeable =
         ntManager.isNodeType(Constants.EXO_PRIVILEGEABLE, versionableNodeData.getPrimaryTypeName(),
            versionableNodeData.getMixinTypeNames());

      boolean isOwneable =
         ntManager.isNodeType(Constants.EXO_OWNEABLE, versionableNodeData.getPrimaryTypeName(), versionableNodeData
            .getMixinTypeNames());

      List<InternalQName> mixinsList = new ArrayList<InternalQName>();
      mixinsList.add(Constants.MIX_REFERENCEABLE);

      Set<AccessControlEntry> accessList = new HashSet<AccessControlEntry>();
      accessList.addAll(nodeData().getACL().getPermissionEntries());

      String owner = nodeData().getACL().getOwner();

      if (isPrivilegeable)
      {
         accessList.addAll(versionableNodeData.getACL().getPermissionEntries());
         mixinsList.add(Constants.EXO_PRIVILEGEABLE);
      }

      if (isOwneable)
      {
         owner = versionableNodeData.getACL().getOwner();
         mixinsList.add(Constants.EXO_OWNEABLE);
      }

      AccessControlList acl = new AccessControlList(owner, new ArrayList<AccessControlEntry>(accessList));
      InternalQName[] mixins = mixinsList.toArray(new InternalQName[mixinsList.size()]);

      // nt:version
      NodeData versionData =
         TransientNodeData.createNodeData(nodeData(), new InternalQName(null, nextVersionName()), Constants.NT_VERSION,
            mixins, uuid, acl);
      changesLog.add(ItemState.createAddedState(versionData));

      // jcr:primaryType
      TransientPropertyData propData =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_PRIMARYTYPE, PropertyType.NAME, false,
            new TransientValueData(Constants.NT_VERSION));
      changesLog.add(ItemState.createAddedState(propData));

      // jcr:mixinTypes
      List<ValueData> mixValues = new ArrayList<ValueData>();
      for (InternalQName mixin : mixins)
      {
         mixValues.add(new TransientValueData(mixin));
      }
      TransientPropertyData exoMixinTypes =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_MIXINTYPES, PropertyType.NAME, true,
            mixValues);
      changesLog.add(ItemState.createAddedState(exoMixinTypes));

      // exo:owner
      if (isOwneable)
      {
         TransientPropertyData exoOwner =
            TransientPropertyData.createPropertyData(versionData, Constants.EXO_OWNER, PropertyType.STRING, false,
               new TransientValueData(acl.getOwner()));
         changesLog.add(ItemState.createAddedState(exoOwner));
      }

      // exo:permissions
      if (isPrivilegeable)
      {
         List<ValueData> permsValues = new ArrayList<ValueData>();
         for (AccessControlEntry entry : acl.getPermissionEntries())
         {
            permsValues.add(new TransientValueData(entry));
         }

         TransientPropertyData exoPerms =
            TransientPropertyData.createPropertyData(versionData, Constants.EXO_PERMISSIONS,
               ExtendedPropertyType.PERMISSION, true, permsValues);
         changesLog.add(ItemState.createAddedState(exoPerms));
      }

      // jcr:uuid
      propData =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_UUID, PropertyType.STRING, false,
            new TransientValueData(uuid));
      changesLog.add(ItemState.createAddedState(propData));

      // jcr:created
      propData =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_CREATED, PropertyType.DATE, false,
            new TransientValueData(session.getTransientNodesManager().getWorkspaceDataManager().getCurrentTime()));
      changesLog.add(ItemState.createAddedState(propData));

      // A reference to V is added to the jcr:successors property of
      // each of the versions identified in Vs jcr:predecessors property.
      List<ValueData> predecessors =
         ((PropertyData)dataManager.getItemData(versionableNodeData, new QPathEntry(Constants.JCR_PREDECESSORS, 0),
            ItemType.PROPERTY)).getValues();
      List<ValueData> predecessorsNew = new ArrayList<ValueData>();
      for (ValueData predecessorValue : predecessors)
      {
         VersionImpl predecessor =
            (VersionImpl)dataManager.getItemByIdentifier(ValueDataUtil.getString(predecessorValue), false, false);
         predecessor.addSuccessor(versionData.getIdentifier(), changesLog);

         try
         {
            predecessorsNew.add(ValueDataUtil.createTransientCopy(predecessorValue));
         }
         catch (IOException e)
         {
            throw new RepositoryException(e.getMessage(), e);
         }
      }

      // jcr:predecessors
      propData =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_PREDECESSORS, PropertyType.REFERENCE,
            true, predecessorsNew);
      changesLog.add(ItemState.createAddedState(propData));

      // jcr:frozenNode
      NodeData frozenData =
         TransientNodeData.createNodeData(versionData, Constants.JCR_FROZENNODE, Constants.NT_FROZENNODE);
      changesLog.add(ItemState.createAddedState(frozenData));

      propData =
         TransientPropertyData.createPropertyData(frozenData, Constants.JCR_PRIMARYTYPE, PropertyType.NAME, false,
            new TransientValueData(Constants.NT_FROZENNODE));
      changesLog.add(ItemState.createAddedState(propData));

      propData =
         TransientPropertyData.createPropertyData(frozenData, Constants.JCR_MIXINTYPES, PropertyType.NAME, true,
            new TransientValueData(Constants.MIX_REFERENCEABLE));
      changesLog.add(ItemState.createAddedState(propData));

      propData =
         TransientPropertyData.createPropertyData(frozenData, Constants.JCR_UUID, PropertyType.STRING, false,
            new TransientValueData(frozenData.getIdentifier()));
      changesLog.add(ItemState.createAddedState(propData));

      FrozenNodeInitializer visitor =
         new FrozenNodeInitializer(frozenData, session.getTransientNodesManager(), session.getWorkspace()
            .getNodeTypesHolder(), changesLog, session.getValueFactory());

      if (LOG.isDebugEnabled())
      {
         LOG.debug("Before frozen visitor: " + changesLog.dump());
      }

      versionableNodeData.accept(visitor);

   }