Opc.Ua.Com.Server.ComNamespaceMapper.GetLocalIntegerIdMapping C# (CSharp) Method

GetLocalIntegerIdMapping() public method

Gets the integer mapping for a remote node id.
public GetLocalIntegerIdMapping ( string mappingType, NodeId remoteId ) : uint
mappingType string Type of the mapping.
remoteId NodeId The remote node id.
return uint
        public uint GetLocalIntegerIdMapping(string mappingType, NodeId remoteId)
        {
            lock (m_lock)
            {
                // check if no mappings defined.
                if (m_mappingSets == null)
                {
                    return 0;
                }

                if (mappingType == null)
                {
                    mappingType = String.Empty;
                }

                // check for an existing mapping.
                NodeIdMappingSet mappingSet = null;

                if (!m_mappingSets.TryGetValue(mappingType, out mappingSet))
                {
                    return 0;
                }

                // search for a existing integer id.
                NodeId localId = GetLocalNodeId(remoteId);

                if (mappingSet.Mappings != null)
                {
                    for (int ii = 0; ii < mappingSet.Mappings.Count; ii++)
                    {
                        NodeIdMapping mapping = mappingSet.Mappings[ii];

                        if (localId == mapping.NodeId)
                        {
                            return mapping.IntegerId;
                        }
                    }
                }

                // not found.
                return 0;
            }
        }