Ejemplo n.º 1
0
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.ReceivePort port)
        {
            TraceManager.SmartTrace.TraceIn(explorer);

            if (port != null)
            {
                this.QualifiedName       = String.Empty;
                this.authenticationType  = (AuthenticationType)Enum.Parse(typeof(AuthenticationType), ((int)port.Authentication).ToString());
                this.trackingType        = (TrackingType)Enum.Parse(typeof(TrackingType), ((int)port.Tracking).ToString());
                this.ApplicationName     = port.Application.Name;
                this.twoWay              = port.IsTwoWay;
                this.routeFailedMessages = port.RouteFailedMessage;
                this.CustomDescription   = port.Description;

                foreach (BizTalkCore.ReceiveLocation location in port.ReceiveLocations)
                {
                    ReceiveLocation rl = new ReceiveLocation(location.Name);
                    rl.Load(explorer, location);
                    rl.ParentPort = this.NameIdPair;
                    this.receiveLocations.Add(rl);
                }
            }

            TraceManager.SmartTrace.TraceOut();
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="explorer"></param>
        internal override void FixReferences(Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer explorer)
        {
            TraceManager.SmartTrace.TraceIn(explorer);

            BizTalkCore.ReceivePort port = explorer.ReceivePorts[this.Name];

            if (port != null)
            {
                // Outbound Transforms
                if (port.OutboundTransforms != null)
                {
                    foreach (BizTalkCore.Transform transform in port.OutboundTransforms)
                    {
                        Transform t = this.Application.Maps[transform.FullName] as Transform;

                        if (t != null)
                        {
                            t.ReceivePorts.Add(this.NameIdPair);
                            this.outboundMaps.Add(t.NameIdPair);
                        }
                    }
                }

                // Inbound Transforms
                if (port.InboundTransforms != null)
                {
                    foreach (BizTalkCore.Transform transform in port.InboundTransforms)
                    {
                        Transform t = this.Application.Maps[transform.FullName] as Transform;

                        if (t != null)
                        {
                            t.ReceivePorts.Add(this.NameIdPair);
                            this.inboundMaps.Add(t.NameIdPair);
                        }
                    }
                }

                // Locations
                try
                {
                    foreach (ReceiveLocation location in this.receiveLocations)
                    {
                        NameIdPair nameIdPair = new NameIdPair(location.Name, this.Id);

                        Pipeline pl = this.Application.ParentInstallation.Pipelines[location.ReceivePipeline.Name] as Pipeline;

                        if (pl != null)
                        {
                            //Colin Dijkgraaf 20141010
                            //location.ReceivePipeline = pl.NameIdPair;
                            //pl.ReceiveLocations.Add(nameIdPair);
                            if (pl.Name == location.ReceivePipeline.Name)  // Actually check that a match was found.
                            {
                                location.ReceivePipeline = pl.NameIdPair;
                                pl.ReceiveLocations.Add(nameIdPair);
                            }
                        }

                        if (this.twoWay)
                        {
                            pl = this.Application.ParentInstallation.Pipelines[location.SendPipeline.Name] as Pipeline;

                            if (pl != null)
                            {
                                //Colin Dijkgraaf 20141010
                                //location.SendPipeline = pl.NameIdPair;
                                if (pl.Name == location.SendPipeline.Name)  // Actually check that a match was found.
                                {
                                    location.SendPipeline = pl.NameIdPair;
                                }
                            }
                        }

                        Protocol p = this.Application.ParentInstallation.ProtocolTypes[location.TransportProtocol] as Protocol;

                        if (p != null)
                        {
                            p.ReceiveLocations.Add(nameIdPair);

                            //foreach (NameIdPair handler in p.ReceiveHandlers)CD 20140402
                            //{
                            //Host h = this.Application.ParentInstallation.Hosts[handler.Name] as Host;
                            Host h = this.Application.ParentInstallation.Hosts[port.PrimaryReceiveLocation.ReceiveHandler.Name] as Host;

                            if (h != null)
                            {
                                h.HostedReceiveLocations.Add(nameIdPair);
                                location.ReceiveHandler = h.NameIdPair;
                            }
                            //}
                        }
                    }
                }
                catch (Exception ex)
                {
                    TraceManager.SmartTrace.TraceError(ex);
                }

                TraceManager.SmartTrace.TraceOut();
                return;
            }
        }