コード例 #1
0
ファイル: SoapNodeManager.cs プロジェクト: chris-tomich/Glyma
        public INode FindNode(Guid nodeId)
        {
            INode proxyNode;

            if (ProxyNodes.ContainsKey(nodeId))
            {
                proxyNode = ProxyNodes[nodeId];
            }
            else
            {
                SoapNode soapNode = new SoapNode(MapManager);
                soapNode.PreInitialiseNode(nodeId);

                ProxyNodes.Add(soapNode.Id, soapNode);
                proxyNode = soapNode;
            }

            return(proxyNode);
        }
コード例 #2
0
ファイル: SoapNodeManager.cs プロジェクト: chris-tomich/Glyma
        public INode FindNode(ServerObjects.Node serviceNode)
        {
            INode node;

            if (ProxyNodes.ContainsKey(serviceNode.NodeUid))
            {
                node = ProxyNodes[serviceNode.NodeUid];

                SoapNode soapNode = node as SoapNode;

                /// Not all the nodes that are stored in the NodeManager are SoapNodes, some are FacadeNodes. In this scenario we want to check if they have an inner SoapNode and use that instead.
                if (soapNode == null)
                {
                    if (node is FacadeNode)
                    {
                        FacadeNode facadeNode = node as FacadeNode;
                        soapNode = facadeNode.BaseNode as SoapNode;
                    }
                }

                if (soapNode != null)
                {
                    soapNode.UpdateNode(serviceNode);
                }
            }
            else
            {
                SoapNode soapNode = new SoapNode(MapManager);
                soapNode.UpdateNode(serviceNode);

                ProxyNodes.Add(soapNode.Id, soapNode);

                node = soapNode;
            }

            if (!ServiceNodes.ContainsKey(serviceNode.NodeUid))
            {
                ServiceNodes.Add(serviceNode.NodeUid, serviceNode);
            }

            return(node);
        }
コード例 #3
0
ファイル: SoapNodeManager.cs プロジェクト: chris-tomich/Glyma
        public void UpgradeFacade(TransactionFramework.ISoapTransactionLink transactionLink, ServerObjects.Node serviceNode)
        {
            if (InProcessNodes.ContainsKey(transactionLink))
            {
                FacadeNode facadeNode = InProcessNodes[transactionLink];
                InProcess.InProcessNode inProcessNode = facadeNode.BaseNode as InProcess.InProcessNode;

                if (inProcessNode != null)
                {
                    SoapNode soapNode = new SoapNode(inProcessNode, serviceNode);

                    facadeNode.BaseNode = soapNode;

                    InProcessNodes.Remove(transactionLink);
                    ProxyNodes[facadeNode.Id] = facadeNode;

                    /// TODO: Need to consider a better way to do this. I don't like that there is a need to call this afterwards and maybe it should be done when creating the SoapNode. I don't like it because it doesn't have to be done everytime a new SoapNode is created e.g. if the SoapNode is created from a Service.NO as opposed to a returned call like here.
                    soapNode.ProcessDelayedActions();
                }
            }
        }
コード例 #4
0
ファイル: SoapNodeManager.cs プロジェクト: chris-tomich/Glyma
        public INode FindNode(Guid nodeId)
        {
            INode proxyNode;

            if (ProxyNodes.ContainsKey(nodeId))
            {
                proxyNode = ProxyNodes[nodeId];
            }
            else
            {
                SoapNode soapNode = new SoapNode(MapManager);
                soapNode.PreInitialiseNode(nodeId);

                ProxyNodes.Add(soapNode.Id, soapNode);
                proxyNode = soapNode;
            }

            return proxyNode;
        }
コード例 #5
0
ファイル: SoapNodeManager.cs プロジェクト: chris-tomich/Glyma
        public void UpgradeFacade(TransactionFramework.ISoapTransactionLink transactionLink, ServerObjects.Node serviceNode)
        {
            if (InProcessNodes.ContainsKey(transactionLink))
            {
                FacadeNode facadeNode = InProcessNodes[transactionLink];
                InProcess.InProcessNode inProcessNode = facadeNode.BaseNode as InProcess.InProcessNode;

                if (inProcessNode != null)
                {
                    SoapNode soapNode = new SoapNode(inProcessNode, serviceNode);

                    facadeNode.BaseNode = soapNode;

                    InProcessNodes.Remove(transactionLink);
                    ProxyNodes[facadeNode.Id] = facadeNode;

                    /// TODO: Need to consider a better way to do this. I don't like that there is a need to call this afterwards and maybe it should be done when creating the SoapNode. I don't like it because it doesn't have to be done everytime a new SoapNode is created e.g. if the SoapNode is created from a Service.NO as opposed to a returned call like here.
                    soapNode.ProcessDelayedActions();
                }
            }
        }
コード例 #6
0
ファイル: SoapNodeManager.cs プロジェクト: chris-tomich/Glyma
        public INode FindNode(ServerObjects.Node serviceNode)
        {
            INode node;

            if (ProxyNodes.ContainsKey(serviceNode.NodeUid))
            {
                node = ProxyNodes[serviceNode.NodeUid];

                SoapNode soapNode = node as SoapNode;

                /// Not all the nodes that are stored in the NodeManager are SoapNodes, some are FacadeNodes. In this scenario we want to check if they have an inner SoapNode and use that instead.
                if (soapNode == null)
                {
                    if (node is FacadeNode)
                    {
                        FacadeNode facadeNode = node as FacadeNode;
                        soapNode = facadeNode.BaseNode as SoapNode;
                    }
                }

                if (soapNode != null)
                {
                    soapNode.UpdateNode(serviceNode);
                }
            }
            else
            {
                SoapNode soapNode = new SoapNode(MapManager);
                soapNode.UpdateNode(serviceNode);

                ProxyNodes.Add(soapNode.Id, soapNode);

                node = soapNode;
            }

            if (!ServiceNodes.ContainsKey(serviceNode.NodeUid))
            {
                ServiceNodes.Add(serviceNode.NodeUid, serviceNode);
            }

            return node;
        }