Get the Node version (node#ver) of a JID. Returns a String or null if
EntiyCapsManager does not have any information.

@param jid
the user (Full JID)
@return the node version (node#ver) or null
352863
public static String getNodeVersionByJid(Jid jid) {
        NodeVerHash nvh = JID_TO_NODEVER_CACHE.lookup(jid);
        if (nvh != null) {
            return nvh.nodeVer;
        } else {
            return null;
        }
    }
957632
public String getNewSessionIdIfNodeFromSessionIdUnavailable( @Nonnull final String sessionId ) {
		if ( isEncodeNodeIdInSessionId() ) {
	        final String nodeId = _sessionIdFormat.extractMemcachedId( sessionId );
	        final String newNodeId = _nodeIdService.getNewNodeIdIfUnavailable( nodeId );
	        if ( newNodeId != null ) {
	            return _sessionIdFormat.createNewSessionId( sessionId, newNodeId);
	        }
		}
		return null;
	}
1047470
private Node getNode(Object entity, ObjectGraph graph, NodeState initialNodeState)
    {
        if (entity == null)
        {
            return null;
        }
        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(pd.getKunderaMetadata(),
                entity.getClass());

        // entity metadata could be null.
        if (entityMetadata == null)
        {
            throw new IllegalArgumentException(
                    "Entity object is invalid, operation failed. Please check previous log message for details");
        }

        Object id = PropertyAccessorHelper.getId(entity, entityMetadata);
        // Generate and set Id if @GeneratedValue present.
        if (((Field) entityMetadata.getIdAttribute().getJavaMember()).isAnnotationPresent(GeneratedValue.class))
        {
            if (!isIdSet(id))
            {
                id = idGenerator.generateAndSetId(entity, entityMetadata, pd, pd.getKunderaMetadata());
            }
        }

        if (!validator.isValidEntityObject(entity, entityMetadata))
        {
            throw new IllegalArgumentException(
                    "Entity object is invalid, operation failed. Please check previous log message for details");
        }

        // id = PropertyAccessorHelper.getId(entity, entityMetadata);

        String nodeId = ObjectGraphUtils.getNodeId(id, entity.getClass());
        Node node = graph.getNode(nodeId);

        // If this node is already there in graph (may happen for bidirectional
        // relationship, do nothing and return null)
        if (node != null)
        {
            if (node.isGraphCompleted())
            {
                return node;
            }
            return null;
        }

        // Construct this Node first, if one not already there in Persistence
        // Cache
        Node nodeInPersistenceCache = persistenceCache.getMainCache().getNodeFromCache(nodeId, pd);

        // Make a deep copy of entity data

        if (nodeInPersistenceCache == null)
        {
            node = new Node(nodeId, entity, initialNodeState, persistenceCache, id, pd);
        }
        else
        {
            node = nodeInPersistenceCache;
            node.setPersistenceCache(persistenceCache);

            // Determine whether this node is dirty based on comparison between
            // Node data and entity data
            // If dirty, set the entity data into node and mark it as dirty
            if (!DeepEquals.deepEquals(node.getData(), entity))
            {
                node.setDirty(true);
            }
            else if (node.isProcessed())
            {
                node.setDirty(false);
            }

            node.setData(entity);

            // If node is NOT in managed state, its data needs to be
            // replaced with the one provided in entity object
        }

        // Put this node into object graph
        graph.addNode(nodeId, node);

        // Iterate over relations and construct children nodes
        for (Relation relation : entityMetadata.getRelations())
        {
            if (relation != null)
            {
                // Child Object set in this entity
                Object childObject = PropertyAccessorHelper.getObject(entity, relation.getProperty());

                if (childObject != null && !ProxyHelper.isProxy(childObject))
                {
                    EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(pd.getKunderaMetadata(),
                            PropertyAccessorHelper.getGenericClass(relation.getProperty()));

                    if (metadata != null && relation.isJoinedByPrimaryKey())
                    {
                        PropertyAccessorHelper.setId(childObject, metadata,
                                PropertyAccessorHelper.getId(entity, entityMetadata));
                    }
                    // This child object could be either an entity(1-1 or M-1)
                    // or a
                    // collection/ Map of entities(1-M or M-M)
                    if (Collection.class.isAssignableFrom(childObject.getClass()))
                    {
                        // For each entity in the collection, construct a child
                        // node and add to graph
                        Collection childrenObjects = (Collection) childObject;

                        if (childrenObjects != null && !ProxyHelper.isProxyCollection(childrenObjects))

                            for (Object childObj : childrenObjects)
                            {
                                if (childObj != null)
                                {
                                    addChildNodesToGraph(graph, node, relation, childObj,
                                            metadata != null ? getChildNodeState(metadata, childObj) : initialNodeState);
                                }
                            }
                    }
                    else if (Map.class.isAssignableFrom(childObject.getClass()))
                    {
                        Map childrenObjects = (Map) childObject;
                        if (childrenObjects != null && !ProxyHelper.isProxyCollection(childrenObjects))
                        {
                            for (Map.Entry entry : (Set<Map.Entry>) childrenObjects.entrySet())
                            {
                                addChildNodesToGraph(graph, node, relation, entry,
                                        metadata != null ? getChildNodeState(metadata, entry) : initialNodeState);
                            }
                        }
                    }
                    else
                    {
                        // Construct child node and add to graph
                        addChildNodesToGraph(graph, node, relation, childObject,
                                metadata != null ? getChildNodeState(metadata, childObject) : initialNodeState);
                    }
                }
            }
        }

        // Means compelte graph is build.
        node.setGraphCompleted(true);
        return node;
    }
822098
@Override
	public int getVersion(final Object iPojo) {
		checkOpeness();
		final ODocument record = getRecordByUserObject(iPojo, false);
		if (record != null)
			return record.getVersion();

		return OObjectSerializerHelper.getObjectVersion(iPojo);
	}
1226110
public int getServerMajorVersion() {
    try {
      StringTokenizer versionTokens = new StringTokenizer(queryExecutor.getServerVersion(), "."); // aaXbb.ccYdd
      return integerPart(versionTokens.nextToken()); // return X
    } catch (NoSuchElementException e) {
      return 0;
    }
  }
1040535
public DatanodeDescriptor getDatanode(DatanodeID nodeID) throws IOException {
    UnregisteredDatanodeException e = null;
    DatanodeDescriptor node = datanodeMap.get(nodeID.getStorageID());
    if (node == null) {
      return null;
    }
    if (!node.getName().equals(nodeID.getName())) {
      e = new UnregisteredDatanodeException(nodeID, node);
      NameNode.stateChangeLog.fatal("BLOCK* NameSystem.getDatanode: "
        + e.getLocalizedMessage());
      throw e;
    }
    return node;
  }
1280519
@CheckForNull
    public Node getNode() {
        Jenkins j = Jenkins.getInstanceOrNull(); // TODO confirm safe to assume non-null and use getInstance()
        if (j == null) {
            return null;
        }
        if (nodeName == null) {
            return j;
        }
        return j.getNode(nodeName);
    }
518444
protected NodeData getBaseVersionData(final NodeData node, final SessionImpl session) throws RepositoryException
   {

      NodeTypeDataManager ntManager = session.getWorkspace().getNodeTypesHolder();
      if (ntManager.isNodeType(Constants.MIX_VERSIONABLE, node.getPrimaryTypeName(), node.getMixinTypeNames()))
      {

         SessionDataManager dmanager = session.getTransientNodesManager();

         PropertyData bvProperty =
            (PropertyData)dmanager.getItemData(node, new QPathEntry(Constants.JCR_BASEVERSION, 0), ItemType.PROPERTY);

         return (NodeData)dmanager.getItemData(ValueDataUtil.getString(bvProperty.getValues().get(0)));
      }

      return null; // non versionable
   }
1112759
public Node getNode() {
        if (node == null) {
            if (resource != null) {
                node = resource.adaptTo(Node.class);
            }
        }
        return node;
    }
1304276
public Version getVersion(String rawVersion)
    {
        Version version = this.versions.get(rawVersion);

        if (version == null) {
            version = new DefaultVersion(rawVersion);

            this.versions.put(rawVersion, version);
        }

        return version;
    }
1191684
public Node getDOM()
    {
        Object root = m_message.getRawData();
        try {
            String strSOAPPackage = (String)((TrxMessageHeader)this.getMessage().getMessageHeader()).get(SOAPMessageTransport.SOAP_PACKAGE);

            Node node = null;            
            DocumentBuilder db = Util.getDocumentBuilder();
            Document doc = db.newDocument();            
            
            Marshaller m = JaxbContexts.getJAXBContexts().getMarshaller(strSOAPPackage);
            if (m == null)
                return null;
            synchronized(m)
            {   // Since the marshaller is shared (may want to tweek this for multi-cpu implementations)
                m.marshal( root, doc );
            }
            node = doc.getDocumentElement();

            if (node != null)
                return node;
        } catch (JAXBException ex)   {
            ex.printStackTrace();
        } catch (java.lang.IllegalArgumentException ex)   {
            ex.printStackTrace();
        }
        return super.getDOM();
    }
1145478
public void identifyNode(int nodeId) throws SerialInterfaceException {
		SerialMessage newMessage = new SerialMessage(nodeId, SerialMessage.SerialMessageClass.IdentifyNode, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.IdentifyNode, SerialMessage.SerialMessagePriority.High);
    	byte[] newPayload = { (byte) nodeId };
    	newMessage.setMessagePayload(newPayload);
    	this.enqueue(newMessage);
	}
1200457
public String getClusterId(final String nodeId)
    {
        if (nodeId == null)
        {
            return null;
        }
        int dot = nodeId.lastIndexOf('.');
        return (dot > 0) ? nodeId.substring(0, dot) : nodeId;
    }
648780
public int getParent(int nodeHandle)
  {

    int identity = makeNodeIdentity(nodeHandle);

    if (identity > 0)
      return makeNodeHandle(_parent(identity));
    else
      return DTM.NULL;
  }
176000
public static String getNamespace(JsonNode node) {
		JsonNode nodeNs = obj(node).get(ID_NAMESPACE);
		return (nodeNs != null) ? nodeNs.asText() : null;
	}
273150
public ProtocolVersion getVersion() 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getVersion");
    
    // The ProtocolVersion to be returned
    ProtocolVersion version = ProtocolVersion.UNKNOWN;
    // Get the MetaData out of the connection
    ConnectionMetaData connMetaData = connection.getMetaData();
    
    // If the MetaData is non-null we can retrieve a version.
    if(connMetaData != null)
      version = connMetaData.getProtocolVersion();
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getVersion", version);
  
    return version;
  }
1284354
@SuppressWarnings("unchecked")
	private Node<K, V> getNodeCache(final int nodeid) {
		final boolean isLeaf = Node.isLeaf(nodeid);
		boolean responseFromCache = true;
		Node<K, V> node = (isLeaf ? dirtyLeafNodes : dirtyInternalNodes).get(nodeid);
		if (node == null) {
			node = (isLeaf ? cacheLeafNodes : cacheInternalNodes).get(nodeid);
			if (node == null) {
				if (log.isDebugEnabled())
					log.debug("diskread node id=" + nodeid);
				node = getNodeFromStore(nodeid);
				responseFromCache = false;
				(node.isLeaf() ? cacheLeafNodes : cacheInternalNodes).put(nodeid, node);
			}
		}
		if (enableIOStats) {
			if (responseFromCache) {
				getIOStat(nodeid).incCacheRead();
			}
		}
		return node;
	}