コード例 #1
0
 /// <summary>
 /// Constructs an instance of the <see cref="MessagingObject"/> class with its name and type.
 /// </summary>
 /// <param name="name">The name of the messaging object.</param>
 /// <param name="type">The type of the messaging object.</param>
 protected MessagingObject(string name, MessagingObjectType type)
     : this(type)
 {
     Name = name ?? throw new ArgumentNullException(nameof(name));
 }
コード例 #2
0
        /// <summary>
        /// Walks the target model and finds the messaging object with the matching key.
        /// </summary>
        /// <param name="target">The target model.</param>
        /// <param name="key">The messaging object's key.</param>
        /// <param name="stageType">The current stage object's type.</param>
        /// <returns>A messaging object matching the key.</returns>
        private static MessagingObject FindMessagingObject(this AzureIntegrationServicesMigrationTarget target, string key, MessagingObjectType stageType)
        {
            var mos = new List <MessagingObject>();

            foreach (var application in target.MessageBus.Applications)
            {
                // Alternate between endpoints and channels.
                if (stageType == MessagingObjectType.Channel)
                {
                    mos.AddRange(application.Intermediaries.Where(c => c.InputChannelKeyRefs != null && c.InputChannelKeyRefs.Contains(key) && !c.Activator));
                    mos.AddRange(application.Endpoints.Where(c => c.InputChannelKeyRef == key));
                }
                else
                {
                    mos.AddRange(application.Channels.Where(c => c.Key == key));
                }
            }
            return(mos.FirstOrDefault());
        }
コード例 #3
0
 /// <summary>
 /// Constructs an instance of the <see cref="MessagingObject"/> class with its type.
 /// </summary>
 /// <param name="type">The type of the messaging object.</param>
 protected MessagingObject(MessagingObjectType type)
     : base()
 {
     Type = type;
 }