public PublisherChannelBuilder(
     IPublisherRegistry publisherRegistry, 
     ISerialiser serialiser, 
     ITaskRepeater taskRepeater,
     MessageCacheFactory messageCacheFactory, 
     ISubscriberSendChannelBuilder subscriberChannelBuilder, 
     ISystemTime systemTime, 
     ChangeStore changeStore,
     ICheckpointStrategy checkPointStrategy)
 {
     Contract.Requires(publisherRegistry != null);
     Contract.Requires(serialiser != null);
     Contract.Requires(taskRepeater != null);
     Contract.Requires(messageCacheFactory != null);
     Contract.Requires(subscriberChannelBuilder != null);
     Contract.Requires(systemTime != null);
     Contract.Requires(changeStore != null);
     Contract.Requires(checkPointStrategy != null);
     
     this.publisherRegistry = publisherRegistry;
     this.serialiser = serialiser;
     this.taskRepeater = taskRepeater;
     this.messageCacheFactory = messageCacheFactory;
     this.subscriberChannelBuilder = subscriberChannelBuilder;
     this.systemTime = systemTime;
     this.changeStore = changeStore;
     this.checkPointStrategy = checkPointStrategy;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create certificate request
 /// </summary>
 /// <param name="applications"></param>
 /// <param name="publishers"></param>
 /// <param name="supervisors"></param>
 /// <param name="endpoints"></param>
 /// <param name="groups"></param>
 public EntityInfoResolver(IApplicationRegistry applications, IPublisherRegistry publishers,
                           ISupervisorRegistry supervisors, IEndpointRegistry endpoints, IGroupRepository groups)
 {
     _applications = applications ?? throw new ArgumentNullException(nameof(applications));
     _publishers   = publishers ?? throw new ArgumentNullException(nameof(publishers));
     _supervisors  = supervisors ?? throw new ArgumentNullException(nameof(supervisors));
     _endpoints    = endpoints ?? throw new ArgumentNullException(nameof(endpoints));
     _groups       = groups ?? throw new ArgumentNullException(nameof(groups));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Find publisher.
 /// </summary>
 /// <param name="service"></param>
 /// <param name="publisherId"></param>
 /// <param name="ct"></param>
 /// <returns></returns>
 public static async Task <PublisherModel> FindPublisherAsync(
     this IPublisherRegistry service, string publisherId,
     CancellationToken ct = default)
 {
     try {
         return(await service.GetPublisherAsync(publisherId, false, ct));
     }
     catch (ResourceNotFoundException) {
         return(null);
     }
 }
Ejemplo n.º 4
0
        public IPublishingTag Build(IPublisherRegistry registry)
        {
            var serializerFactory = new AmqpSerializerFactory(this.Serializers);
            var messageBuilder    = new AmqpMessageBuilder(serializerFactory, this.propertyBuilder, this.router);

            List <IPublishingTag> tags =
                this.publishers
                .Select(createPublisher => createPublisher(messageBuilder, this.ConnectionFactory, registry))
                .ToList();

            return(new CompositePublishingTag(Guid.NewGuid().ToString(), tags));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Returns all publisher ids from the registry
        /// </summary>
        /// <param name="service"></param>
        /// <param name="onlyServerState"></param>
        /// <param name="ct"></param>
        /// <returns></returns>
        public static async Task <List <string> > ListAllPublisherIdsAsync(
            this IPublisherRegistry service, bool onlyServerState = false,
            CancellationToken ct = default)
        {
            var publishers = new List <string>();
            var result     = await service.ListPublishersAsync(null, onlyServerState, null, ct);

            publishers.AddRange(result.Items.Select(s => s.Id));
            while (result.ContinuationToken != null)
            {
                result = await service.ListPublishersAsync(result.ContinuationToken,
                                                           onlyServerState, null, ct);

                publishers.AddRange(result.Items.Select(s => s.Id));
            }
            return(publishers);
        }
 SubscriptionRequestReceiveChannelBuilder(
     MessageReceiver messageReceiver, 
     AcknowledgementSender acknowledgementSender, 
     IPublisherRegistry publisherRegistry, 
     ServerAddressRegistry serverAddressRegistry, 
     AuthenticationSessionCache authenticationSessionCache, 
     AuthenticatedServerRegistry authenticatedServerRegistry)
 {
     Contract.Requires(messageReceiver != null);
     Contract.Requires(acknowledgementSender != null);
     Contract.Requires(publisherRegistry != null);
     Contract.Requires(serverAddressRegistry != null);
     Contract.Requires(authenticationSessionCache != null);
     Contract.Requires(authenticatedServerRegistry != null);
     
     this.messageReceiver = messageReceiver;
     this.acknowledgementSender = acknowledgementSender;
     this.publisherRegistry = publisherRegistry;
     this.serverAddressRegistry = serverAddressRegistry;
     this.authenticationSessionCache = authenticationSessionCache;
     this.authenticatedServerRegistry = authenticatedServerRegistry;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Create controller for publisher services
 /// </summary>
 /// <param name="publishers"></param>
 /// <param name="events"></param>
 public PublishersController(IPublisherRegistry publishers,
                             IGroupRegistration events)
 {
     _publishers = publishers;
     _events     = events;
 }
 /// <summary>
 /// Create controller for publisher services
 /// </summary>
 /// <param name="publishers"></param>
 public PublishersController(IPublisherRegistry publishers)
 {
     _publishers = publishers;
 }