コード例 #1
0
 /// <summary>
 ///     Removes the specified service.
 /// </summary>
 /// <param name="service">The service.</param>
 public void Remove(Identification service)
 {
     SubscriptorEntity subscriptorEntity =
         _repository.FindOne(s => s.Service.Id == service.Id && s.Service.Type == service.Type);
     if (subscriptorEntity != null)
     {
         _repository.Remove(subscriptorEntity);
     }
 }
コード例 #2
0
 /// <summary>
 /// Loads the identification.
 /// </summary>
 /// <returns></returns>
 private PublisherConfigurator LoadIdentification()
 {
     _identification = new Identification
     {
         Id = _publisherConfig.Identification.Id,
         Type = _publisherConfig.Identification.Type
     };
     return this;
 }
コード例 #3
0
        /// <summary>
        /// Toes the subscriptor.
        /// </summary>
        /// <param name="subscriptorEntity">The subscriptor entity.</param>
        /// <param name="processor">The processor.</param>
        /// <returns></returns>
        public static Subscriptor ToSubscriptor(this SubscriptorEntity subscriptorEntity, Identification processor)
        {
            var subscriptor = new Subscriptor
            {
                Service = subscriptorEntity.Service,
                ServiceInputGateway =
                    RouterGatewayFactory.CreateOutputGateway(
                                                          new Uri(subscriptorEntity.InputGateway.Uri),
                                                          (TransportType)subscriptorEntity.InputGateway.Transport),
                ServiceInputControlGateway =
                    AgentGatewayFactory.CreateOutputGateway(processor,
                                                            new Uri(subscriptorEntity.InputControlGateway.Uri),
                                                            (TransportType)subscriptorEntity.InputControlGateway.Transport),
            };

            foreach (var subscriptionTypeMessage in subscriptorEntity.SubcriptionTypes)
            {
                subscriptor.SubcriptionTypes.Add(subscriptionTypeMessage.ToSubscriptorKey());
            }
            return subscriptor;
        }
コード例 #4
0
ファイル: ServiceInfoService.cs プロジェクト: petxo/HermEsb
 /// <summary>
 /// Gets the or create service info.
 /// </summary>
 /// <param name="serviceIdentification">The service identification.</param>
 /// <param name="repository">The repository.</param>
 /// <returns></returns>
 private static ServiceInfoEntity GetOrCreateServiceInfo(Identification serviceIdentification, IServiceInfoRepository repository)
 {
     return repository.FindOne(new { Identification = new { serviceIdentification.Id, serviceIdentification.Type } }) ??
         new ServiceInfoEntity
         {
             Identification = new Identification
             {
                 Id = serviceIdentification.Id,
                 Type = serviceIdentification.Type
             }
         };
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ControlProcessorConfigurator"/> class.
 /// </summary>
 /// <param name="HermEsbServiceConfig">The HermEsb service config.</param>
 /// <param name="identification">The identification.</param>
 public ControlProcessorConfigurator(HermEsbServiceConfig HermEsbServiceConfig, Identification identification)
 {
     _HermEsbServiceConfig = HermEsbServiceConfig;
     _identification = identification;
 }
コード例 #6
0
ファイル: MonitorConfigurator.cs プロジェクト: petxo/HermEsb
 /// <summary>
 /// Initializes a new instance of the <see cref="MonitorConfigurator"/> class.
 /// </summary>
 /// <param name="monitorConfig">The monitor config.</param>
 /// <param name="identification">The identification.</param>
 public MonitorConfigurator(MonitorConfig monitorConfig, Identification identification)
 {
     _monitorConfig = monitorConfig;
     _identification = identification;
     _assemblies = new List<string>();
 }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RouterProcessorConfigurator"/> class.
 /// </summary>
 /// <param name="hermEsbConfig">The HermEsb bus config.</param>
 /// <param name="identification">The identification.</param>
 public RouterProcessorConfigurator(HermEsbConfig hermEsbConfig, Identification identification)
 {
     _hermEsbConfig = hermEsbConfig;
     _identification = identification;
 }
コード例 #8
0
ファイル: ServiceInfoService.cs プロジェクト: petxo/HermEsb
        /// <summary>
        /// Gets the service info.
        /// </summary>
        /// <param name="serviceIdentification">The service info heartBeatEntity.</param>
        /// <param name="repository">The repository.</param>
        /// <returns></returns>
        private ServiceInfoEntity GetServiceInfo(Identification serviceIdentification, IServiceInfoRepository repository)
        {
            var infoEntity = repository.FindOne(new {Identification = new {serviceIdentification.Id, serviceIdentification.Type}});
            if (infoEntity == null)
            {
                InvokeServiceNotExist(new ServiceInfoEventHandlerArgs());
            }

            return infoEntity;
        }
コード例 #9
0
ファイル: Identification.cs プロジェクト: petxo/HermEsb
 /// <summary>
 /// Equalses the specified other.
 /// </summary>
 /// <param name="other">The other.</param>
 /// <returns></returns>
 public bool Equals(Identification other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Id, Id) && Equals(other.Type, Type);
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceProcessorConfigurator"/> class.
 /// </summary>
 /// <param name="serviceProcessorConfig">The service processor config.</param>
 /// <param name="identification">The identification.</param>
 public ServiceProcessorConfigurator(ServiceProcessorConfig serviceProcessorConfig, Identification identification)
 {
     _serviceProcessorConfig = serviceProcessorConfig;
     _identification = identification;
 }
コード例 #11
0
ファイル: Identification.cs プロジェクト: petxo/HermEsb
 /// <summary>
 /// Initializes the <see cref="Identification"/> class.
 /// </summary>
 static Identification()
 {
     Empty = new Identification();
 }
コード例 #12
0
ファイル: ServiceConfigurator.cs プロジェクト: petxo/HermEsb
        /// <summary>
        /// Loads the identification.
        /// </summary>
        /// <returns></returns>
        private ServiceConfigurator LoadIdentification()
        {
            _identification = new Identification
                                  {
                                      Id = _HermEsbServiceConfig.Identification.Id,
                                      Type = _HermEsbServiceConfig.Identification.Type
                                  };

            return this;
        }
コード例 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PublisherConfigurator"/> class.
 /// </summary>
 /// <param name="publisherConfig">The publisher config.</param>
 /// <param name="identification">The identification.</param>
 public ErrorHandlingControllerConfigurator(ErrorHandlingControllerConfig publisherConfig, Identification identification)
 {
     _errorHandlingControllerConfig = publisherConfig;
     _identification = identification;
 }
コード例 #14
0
ファイル: ServiceInfoService.cs プロジェクト: petxo/HermEsb
 /// <summary>
 /// Determines whether the specified identification is bus.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="type">The type.</param>
 /// <returns>
 /// 	<c>true</c> if the specified identification is bus; otherwise, <c>false</c>.
 /// </returns>
 private static bool IsBus(Identification identification, ProcessorType type)
 {
     return IdentitySpec.Instance.IsSatisfiedBy(identification) &&
            BusTypeSpec.Instance.IsSatisfiedBy(type);
 }
コード例 #15
0
ファイル: Identification.cs プロジェクト: yashhotline/HermEsb
 /// <summary>
 /// Initializes the <see cref="Identification"/> class.
 /// </summary>
 static Identification()
 {
     Empty = new Identification();
 }
コード例 #16
0
ファイル: ServiceInfoService.cs プロジェクト: petxo/HermEsb
 /// <summary>
 /// Gets the reopsitory.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="type">The type.</param>
 /// <returns></returns>
 private IServiceInfoRepository GetReopsitory(Identification identification, ProcessorType type)
 {
     return IsBus(identification, type) ? _busRepository : _serviceRepository;
 }
コード例 #17
0
ファイル: BusConfigurator.cs プロジェクト: petxo/HermEsb
 /// <summary>
 ///     Loads the identification.
 /// </summary>
 /// <returns></returns>
 private BusConfigurator LoadIdentification()
 {
     LoggerManager.Instance.Debug("Cargando la identificacion");
     _identification = new Identification
         {
             Id = _hermEsbConfig.Identification.Id,
             Type = _hermEsbConfig.Identification.Type
         };
     return this;
 }
コード例 #18
0
ファイル: ServiceInfoService.cs プロジェクト: petxo/HermEsb
 /// <summary>
 /// Modifies the output messages.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="type">The type.</param>
 /// <param name="messageTypes">The message types.</param>
 public void ModifyOutputMessages(Identification identification, ProcessorType type, IEnumerable<MessageType> messageTypes)
 {
     var repository = GetReopsitory(identification, type);
     var serviceInfo = GetServiceInfo(identification, repository);
     Save(serviceInfo, repository, (bd => bd.SetValue(be => be.OutputTypes, messageTypes)));
 }
コード例 #19
0
        /// <summary>
        ///     Gets the subscriptors.
        /// </summary>
        /// <returns></returns>
        public IList<Subscriptor> GetSubscriptors(Identification identification)
        {
            IEnumerable<SubscriptorEntity> subscriptorEntities = _repository.Find(new {});

            return subscriptorEntities.Select(s => s.ToSubscriptor(identification)).ToList();
        }