// all dependencies required are passed in. no protected field can be assumed created
 protected abstract ITopologySectionManagerInternal CreateTopologySectionManager(string defaultAlias, NamespaceConfigurations namespaces, INamespacePartitioningStrategy partitioning, AddressingLogic addressing);
 public EndpointOrientedMigrationTopologySectionManager(string defaultNameSpaceAlias, NamespaceConfigurations namespaceConfigurations, string originalEndpointName, PublishersConfiguration publishersConfiguration, INamespacePartitioningStrategy namespacePartitioningStrategy, AddressingLogic addressingLogic, ICreateBrokerSideSubscriptionFilter brokerSideSubscriptionFilterFactory)
 {
     this.namespaceConfigurations             = namespaceConfigurations;
     this.defaultNameSpaceAlias               = defaultNameSpaceAlias;
     this.originalEndpointName                = originalEndpointName;
     this.addressingLogic                     = addressingLogic;
     this.namespacePartitioningStrategy       = namespacePartitioningStrategy;
     this.publishersConfiguration             = publishersConfiguration;
     this.brokerSideSubscriptionFilterFactory = brokerSideSubscriptionFilterFactory;
 }
 public EndpointOrientedMigrationTopologySectionManager(string defaultNameSpaceAlias, NamespaceConfigurations namespaceConfigurations, string originalEndpointName, PublishersConfiguration publishersConfiguration, INamespacePartitioningStrategy namespacePartitioningStrategy, AddressingLogic addressingLogic)
 {
     this.namespaceConfigurations       = namespaceConfigurations;
     this.defaultNameSpaceAlias         = defaultNameSpaceAlias;
     this.originalEndpointName          = originalEndpointName;
     this.addressingLogic               = addressingLogic;
     this.namespacePartitioningStrategy = namespacePartitioningStrategy;
     this.publishersConfiguration       = publishersConfiguration;
 }
        protected override ITopologySectionManagerInternal CreateTopologySectionManager(string defaultAlias, NamespaceConfigurations namespaces, INamespacePartitioningStrategy partitioning, AddressingLogic addressing)
        {
            var conventions                         = Settings.Get <Conventions>();
            var publishersConfiguration             = new PublishersConfiguration(conventions, Settings);
            var endpointName                        = Settings.EndpointName();
            var topicSettings                       = Settings.GetOrCreate <TopologySettings>().TopicSettings;
            var topicCustomizer                     = topicSettings.DescriptionCustomizer;
            var brokerSideSubscriptionFilterFactory = (ICreateBrokerSideSubscriptionFilter)Settings.Get(WellKnownConfigurationKeys.Topology.Addressing.Sanitization.BrokerSideSubscriptionFilterFactoryInstance);

            topicSettings.DescriptionCustomizer = description =>
            {
                // call customer defined one first
                topicCustomizer(description);

                if (description.Path != EndpointOrientedMigrationTopologySectionManager.MigrationTopicName)
                {
                    return;
                }

                description.RequiresDuplicateDetection          = true;
                description.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(60);
            };

            return(new EndpointOrientedMigrationTopologySectionManager(defaultAlias, namespaces, endpointName, publishersConfiguration, partitioning, addressing, brokerSideSubscriptionFilterFactory));
        }
        protected override ITopologySectionManagerInternal CreateTopologySectionManager(string defaultAlias, NamespaceConfigurations @namespaces, INamespacePartitioningStrategy partitioning, AddressingLogic addressing)
        {
            var conventions             = Settings.Get <Conventions>();
            var publishersConfiguration = new PublishersConfiguration(conventions, Settings);
            var endpointName            = Settings.EndpointName();

            return(new EndpointOrientedTopologySectionManager(defaultAlias, namespaces, endpointName, publishersConfiguration, partitioning, addressing));
        }
Exemple #6
0
        protected override ITopologySectionManagerInternal CreateTopologySectionManager(string defaultAlias, NamespaceConfigurations @namespaces, INamespacePartitioningStrategy partitioning, AddressingLogic addressing)
        {
            var conventions                         = Settings.Get <Conventions>();
            var publishersConfiguration             = new PublishersConfiguration(conventions, Settings);
            var endpointName                        = Settings.EndpointName();
            var brokerSideSubscriptionFilterFactory = (ICreateBrokerSideSubscriptionFilter)Settings.Get(WellKnownConfigurationKeys.Topology.Addressing.Sanitization.BrokerSideSubscriptionFilterFactoryInstance);

            return(new EndpointOrientedTopologySectionManager(defaultAlias, namespaces, endpointName, publishersConfiguration, partitioning, addressing, brokerSideSubscriptionFilterFactory));
        }
Exemple #7
0
 public ForwardingTopologySectionManager(string defaultNameSpaceAlias, NamespaceConfigurations namespaceConfigurations, string originalEndpointName, int numberOfEntitiesInBundle, string bundlePrefix, INamespacePartitioningStrategy namespacePartitioningStrategy, AddressingLogic addressingLogic)
 {
     this.bundlePrefix                  = bundlePrefix;
     this.numberOfEntitiesInBundle      = numberOfEntitiesInBundle;
     this.namespaceConfigurations       = namespaceConfigurations;
     this.defaultNameSpaceAlias         = defaultNameSpaceAlias;
     this.addressingLogic               = addressingLogic;
     this.namespacePartitioningStrategy = namespacePartitioningStrategy;
     this.originalEndpointName          = originalEndpointName;
 }
        protected override ITopologySectionManagerInternal CreateTopologySectionManager(string defaultAlias, NamespaceConfigurations namespaces, INamespacePartitioningStrategy partitioning, AddressingLogic addressing)
        {
            var endpointName             = Settings.EndpointName();
            var numberOfEntitiesInBundle = Settings.Get <int>(WellKnownConfigurationKeys.Topology.Bundling.NumberOfEntitiesInBundle);

            bundlePrefix = Settings.Get <string>(WellKnownConfigurationKeys.Topology.Bundling.BundlePrefix);

            topologySectionManager = new ForwardingTopologySectionManager(defaultAlias, namespaces, endpointName, numberOfEntitiesInBundle, bundlePrefix, partitioning, addressing);
            // By design the topology section manager should determine the resources to create without needing information
            // from ASB. When we realized one bundle was enough we had to call out for backward compatibility reasons to query
            // how many bundles there are. This is async but should happen outside the actual section manager. Thus
            // the callback was introduced.
            topologySectionManager.Initialize = async() =>
            {
                if (Interlocked.Exchange(ref initializeSignaled, 1) != 0)
                {
                    return;
                }

                var bundleConfigurations = await NumberOfTopicsInBundleCheck.Run(namespaceManager, namespaceConfigurations, bundlePrefix)
                                           .ConfigureAwait(false);

                topologySectionManager.BundleConfigurations = bundleConfigurations;
            };
            return(topologySectionManager);
        }