Exemple #1
0
        public EndpointBuilder(IEndpointConfig config)
        {
            this.builderConfig = config;

            if (string.IsNullOrEmpty(config.EndpointName))
            {
                throw new ArgumentException("EndpointName cannot be empty.");
            }

            if (string.IsNullOrEmpty(config.BrokerConnectionString))
            {
                throw new ArgumentException("BrokerConnectionString cannot be empty.");
            }

            configuration = new EndpointConfiguration(config.EndpointName);

            configuration.SendFailedMessagesTo("error");
            configuration.AuditProcessedMessagesTo("audit");

            if (Debugger.IsAttached)
            {
                configuration.EnableInstallers();
            }

            ConfigureConventions();
            ConfigureSerialization();
            transport = ConfigureTransport();
        }
        public ISource GetSource(IEndpointConfig config)
        {
            var source = _sourceResolver.GetSource(config);

            if (source is IContentStorageSource)
            {
                return(_loggingContentStorageSourceFactory(source as IContentStorageSource));
            }

            return(_loggingSourceFactory(source));
        }
Exemple #3
0
 public RouteConfig(IEndpointConfig sourceConfig, IEndpointConfig destinationConfig, int contentCountLimit, int connectionCountLimit, bool forceAllContents, bool skipDestinationCheck, bool parallelGetLists, DateTimeOffset?hashCheckMoment)
 {
     SourceConfig         = sourceConfig;
     DestinationConfig    = destinationConfig;
     ContentCountLimit    = contentCountLimit;
     ConnectionCountLimit = connectionCountLimit;
     ForceAllContents     = forceAllContents;
     SkipDestinationCheck = skipDestinationCheck;
     ParallelGetLists     = parallelGetLists;
     HashCheckMoment      = hashCheckMoment;
 }
Exemple #4
0
        public IDestination GetDestination(IEndpointConfig config)
        {
            if (!CanResolve(config))
            {
                throw new ArgumentException("Missing destination config");
            }

            var cfg = config as IContentStorageEndpointConfig;

            var contentStorageServiceURL = _contentStorageServiceProvider.GetURL(cfg.ContainerName);

            return(_contentStorageDestinationFactory(_contentStorageServiceProvider.GetContainerName(cfg.ContainerName), cfg.AuthenticationToken, contentStorageServiceURL));
        }
Exemple #5
0
        public ISource GetSource(IEndpointConfig config)
        {
            if (!CanResolve(config))
            {
                throw new ArgumentException("Missing source config");
            }

            var cfg = config as IFileSystemEndpointConfig;

            var fileSystemContainer = _fileSystemContainerProvider.GetContainer(cfg.DirectoryName);

            return(_fileSystemSourceFactory(cfg.DirectoryName, fileSystemContainer));
        }
        public IDestination GetDestination(IEndpointConfig config)
        {
            if (!CanResolve(config))
            {
                throw new ArgumentException("Missing destination config");
            }

            var cfg = config as IFileSystemEndpointConfig;

            var fileSystemContainer = _fileSystemContainerProvider.GetContainer(cfg.DirectoryName);

            return(_fileSystemDestinationFactory(cfg.DirectoryName, fileSystemContainer));
        }
Exemple #7
0
 private static void EnsureEndpointConfigInvariants(IEndpointConfig endpointConfig)
 {
     if (endpointConfig == null)
     {
         throw new ArgumentNullException(nameof(endpointConfig));
     }
     if (string.IsNullOrWhiteSpace(endpointConfig.ConnectionString))
     {
         throw new ArgumentException($"{nameof(endpointConfig.ConnectionString)} cannot be null or whitespace");
     }
     if (string.IsNullOrWhiteSpace(endpointConfig.EntityPath))
     {
         throw new ArgumentException($"{nameof(endpointConfig.EntityPath)} cannot be null or whitespace");
     }
 }
 public bool CanResolve(IEndpointConfig config)
 {
     return(_sourceResolver.CanResolve(config));
 }
Exemple #9
0
 public bool CanResolve(IEndpointConfig config)
 {
     return(config is IContentStorageEndpointConfig);
 }
 public ISourceResolver GetResolver(IEndpointConfig config)
 {
     return(_eventualSourceEndpointResolvers.Where(x => x.CanResolve(config)).Single());
 }
Exemple #11
0
 public IDestinationResolver GetResolver(IEndpointConfig config)
 {
     return(_eventualDestinationEndpointResolvers.Where(x => x.CanResolve(config)).Single());
 }
Exemple #12
0
 public bool CanResolve(IEndpointConfig config)
 {
     return(config is IFileSystemEndpointConfig);
 }
Exemple #13
0
 public IMessageSender CreateMessageSender(IEndpointConfig config, RetryPolicy policy = null)
 {
     return(new MessageSender(config.ConnectionString, config.EntityPath, policy ?? DefaultRetryPolicy));
 }
        public IDestination GetDestination(IEndpointConfig config)
        {
            var Destination = _DestinationResolver.GetDestination(config);

            return(_loggingDestinationFactory(Destination));
        }
 public bool CanResolve(IEndpointConfig config)
 {
     return(_DestinationResolver.CanResolve(config));
 }