/// <summary>
        ///
        /// </summary>
        /// <param name="explorer"></param>
        /// <param name="port"></param>
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.SendPort port)
        {
            if (port != null)
            {
                this.QualifiedName = String.Empty;
                // Basic properties
                this.trackingType         = (TrackingType)Enum.Parse(typeof(TrackingType), ((int)port.Tracking).ToString());
                this.priority             = port.Priority;
                this.twoWay               = port.IsTwoWay;
                this.dynamic              = port.IsDynamic;
                this.sendPipeline         = port.SendPipeline.FullName;
                this.ApplicationName      = port.Application.Name;
                this.RouteFailedMessage   = port.RouteFailedMessage;
                this.StopSendingOnFailure = port.StopSendingOnFailure;
                this.CustomDescription    = port.Description;

                // Encryption Certificates
                if (port.EncryptionCert != null)
                {
                    this.encryptionCert = new EncryptionCert(port.EncryptionCert);
                }

                // Receive pipeline if two way
                if (this.twoWay)
                {
                    this.receivePipeline = port.ReceivePipeline.FullName;
                }

                // Primary transport
                if (port.PrimaryTransport != null)
                {
                    this.primaryTransport = new TransportInfo(port.PrimaryTransport, true);
                }

                // Secondary transport
                if (port.SecondaryTransport != null && port.SecondaryTransport.Address.Length > 0)
                {
                    this.secondaryTransport = new TransportInfo(port.SecondaryTransport, false);
                }

                // Filters
                if (port.Filter != string.Empty)
                {
                    this.FilterGroups = BizTalkInstallation.CreateFilterGroups(port.Filter);
                }
            }
        }
        /// <summary>
        ///
        /// </summary>
        internal override void FixReferences(BizTalkCore.BtsCatalogExplorer explorer)
        {
            TraceManager.SmartTrace.TraceIn(explorer);

            BizTalkCore.SendPort port = explorer.SendPorts[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.SendPorts.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.SendPorts.Add(this.NameIdPair);
                            this.inboundMaps.Add(t.NameIdPair);
                        }
                    }
                }

                // Primary Transport
                if (this.primaryTransport != null)
                {
                    Protocol p = this.Application.ParentInstallation.ProtocolTypes[this.primaryTransport.Type] as Protocol;

                    if (p != null)
                    {
                        p.SendPorts.Add(this.NameIdPair);

                        foreach (NameIdPair handler in p.SendHandlers)
                        {
                            Host h = this.Application.ParentInstallation.Hosts[handler.Name] as Host;

                            if (h != null)
                            {
                                h.HostedSendPorts.Add(this.NameIdPair);
                            }
                        }
                    }
                }

                TraceManager.SmartTrace.TraceOut();
                return;
            }
        }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        internal override void FixReferences(BizTalkCore.BtsCatalogExplorer explorer)
        {
            TraceManager.SmartTrace.TraceIn(explorer);

            BizTalkCore.SendPort port = explorer.SendPorts[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.SendPorts.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.SendPorts.Add(this.NameIdPair);
                            this.inboundMaps.Add(t.NameIdPair);
                        }
                    }
                }

                // Primary Transport CD 20140328
                if (this.primaryTransport != null)
                {
                    Protocol p = this.Application.ParentInstallation.ProtocolTypes[this.primaryTransport.Type] as Protocol;

                    if (p != null)
                    {
                        p.SendPorts.Add(this.NameIdPair);

                        Host h = this.Application.ParentInstallation.Hosts[port.PrimaryTransport.SendHandler.Name] as Host;

                        if (h != null)
                        {
                            h.HostedSendPorts.Add(this.NameIdPair);
                            // Added to document the Send Handler CD 20140328
                            // Amended for Secondary Transport Handler CD 20140403
                            this.PrimaryTransport.SendHandler = h.NameIdPair;
                        }

                        // Secondary Transport
                        if (this.secondaryTransport != null)
                        {
                            Protocol p2 = this.Application.ParentInstallation.ProtocolTypes[this.secondaryTransport.Type] as Protocol;

                            if (p2 != null)
                            {
                                if (p2 != p)
                                {
                                    p2.SendPorts.Add(this.NameIdPair);
                                }

                                Host h2 = this.Application.ParentInstallation.Hosts[port.SecondaryTransport.SendHandler.Name] as Host;

                                if (h2 != null & h2 != h)
                                {
                                    h2.HostedSendPorts.Add(this.NameIdPair);
                                    this.SecondaryTransport.SendHandler = h2.NameIdPair;
                                }
                            }
                        }
                    }
                }

                TraceManager.SmartTrace.TraceOut();
                return;
            }
        }
예제 #4
0
        //public NameIdPair SendHandler
        //{
        //    get { return this.sendHandler; }
        //    set { this.sendHandler = value; }
        //}

        #endregion

        #region Load

        /// <summary>
        ///
        /// </summary>
        /// <param name="explorer"></param>
        /// <param name="port"></param>
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.SendPort port)
        {
            if (port != null)
            {
                this.QualifiedName = String.Empty;
                // Basic properties
                this.trackingType = (TrackingType)Enum.Parse(typeof(TrackingType), ((int)port.Tracking).ToString());
                this.priority     = port.Priority;
                this.twoWay       = port.IsTwoWay;
                this.dynamic      = port.IsDynamic;
                //this.sendPipeline = port.SendPipeline.FullName;

                // Fix so to have link for Send Pipeline  CD 20140404
                Pipeline pl = this.Application.ParentInstallation.Pipelines[port.SendPipeline.FullName] as Pipeline;
                if (pl != null)
                {
                    if (pl.Name == port.SendPipeline.FullName)  // Actually check that a match was found.
                    {
                        this.sendPipeline = pl.NameIdPair;
                    }
                    else
                    {
                        this.sendPipeline = new NameIdPair(port.SendPipeline.FullName, "");
                    }
                }

                this.ApplicationName      = port.Application.Name;
                this.RouteFailedMessage   = port.RouteFailedMessage;
                this.StopSendingOnFailure = port.StopSendingOnFailure;
                this.CustomDescription    = port.Description;

                // Encryption Certificates
                if (port.EncryptionCert != null)
                {
                    this.encryptionCert = new EncryptionCert(port.EncryptionCert);
                }

                // Receive pipeline if two way
                if (this.twoWay)
                {
                    //this.receivePipeline = port.ReceivePipeline.FullName; CD 20140405
                    Pipeline rpl = this.Application.ParentInstallation.Pipelines[port.ReceivePipeline.FullName] as Pipeline;
                    if (rpl != null)
                    {
                        if (rpl.Name == port.ReceivePipeline.FullName)  // Actually check that a match was found.
                        {
                            this.ReceivePipeline = rpl.NameIdPair;
                        }
                        else
                        {
                            this.ReceivePipeline = new NameIdPair(port.ReceivePipeline.FullName, "");
                        }
                    }
                }

                // Primary transport
                if (port.PrimaryTransport != null)
                {
                    this.primaryTransport = new TransportInfo(port.PrimaryTransport, true);
                }

                // Secondary transport
                if (port.SecondaryTransport != null && port.SecondaryTransport.Address.Length > 0)
                {
                    this.secondaryTransport = new TransportInfo(port.SecondaryTransport, false);
                }

                // Filters
                if (port.Filter != string.Empty)
                {
                    this.FilterGroups = BizTalkInstallation.CreateFilterGroups(port.Filter);
                }
            }
        }