コード例 #1
0
 /// <summary>
 /// Assigns the heart beat.
 /// </summary>
 /// <param name="serviceInfoEntity">The heart beat heartBeatEntity.</param>
 public void ModifyServiceQueues(ServiceInfoEntity serviceInfoEntity)
 {
     if (!IdentitySpec.Instance.IsSatisfiedBy(serviceInfoEntity.Identification))
     {
         return;
     }
     SaveQueueInfo(serviceInfoEntity);
 }
コード例 #2
0
        /// <summary>
        /// Updates the heartBeatEntity.
        /// </summary>
        /// <param name="monitoringEntity">The health heartBeatEntity.</param>
        /// <param name="serviceInfo">The service info.</param>
        /// <param name="updateValues">The update values.</param>
        private static void UpdateEntity(ServiceInfoEntity serviceInfo, MonitoringEntity monitoringEntity, Action <ServiceInfoEntity> updateValues)
        {
            if (serviceInfo == null)
            {
                return;
            }

            updateValues(serviceInfo);
            serviceInfo.UtcTimeTakenSample = monitoringEntity.UtcTimeTakenSample;
            serviceInfo.BusIdentification  = monitoringEntity.BusIdentification;
            serviceInfo.Identification     = monitoringEntity.Identification;
            serviceInfo.Type = monitoringEntity.Type;
        }
コード例 #3
0
        /// <summary>
        /// Saves the queue info.
        /// </summary>
        /// <param name="serviceInfoEntity">The service info entity.</param>
        private void SaveQueueInfo(ServiceInfoEntity serviceInfoEntity)
        {
            var repository  = GetReopsitory(serviceInfoEntity);
            var serviceInfo = GetServiceInfo(serviceInfoEntity.Identification, repository);

            UpdateEntity(serviceInfo, serviceInfoEntity,
                         (s =>
            {
                s.InputControlQueue = serviceInfoEntity.InputControlQueue;
                s.InputControlQueueTransport = serviceInfoEntity.InputControlQueueTransport;
                s.InputProcessorQueue = serviceInfoEntity.InputProcessorQueue;
                s.InputProcessorQueueTransport = serviceInfoEntity.InputProcessorQueueTransport;
            }));

            Save(serviceInfo, repository, bd =>
            {
                bd.SetValue(be => be.InputControlQueue, serviceInfoEntity.InputControlQueue);
                bd.SetValue(be => be.InputControlQueueTransport, serviceInfoEntity.InputControlQueueTransport);
                bd.SetValue(be => be.InputProcessorQueue, serviceInfoEntity.InputProcessorQueue);
                bd.SetValue(be => be.InputProcessorQueueTransport, serviceInfoEntity.InputProcessorQueueTransport);
            });
        }
コード例 #4
0
        /// <summary>
        /// Saves the heartBeatEntity.
        /// </summary>
        /// <param name="serviceInfoEntity">The service info heartBeatEntity.</param>
        /// <param name="repository">The repository.</param>
        /// <param name="updateAction">The update action.</param>
        private static void Save(
            ServiceInfoEntity serviceInfoEntity,
            IServiceInfoRepository repository,
            Action <IModifierExpression <ServiceInfoEntity, ObjectId> > updateAction)
        {
            if (serviceInfoEntity == null)
            {
                return;
            }

            if (serviceInfoEntity.Id == ObjectId.Empty)
            {
                repository.Save(serviceInfoEntity);
            }
            else
            {
                repository.Update(serviceInfoEntity.Id, bd =>
                {
                    updateAction(bd);
                    SetValueMonitoring(bd, serviceInfoEntity);
                });
            }
        }
コード例 #5
0
 /// <summary>
 /// Sets the value monitoring.
 /// </summary>
 /// <param name="bd">The bd.</param>
 /// <param name="serviceInfo">The service info.</param>
 private static void SetValueMonitoring(IModifierExpression <ServiceInfoEntity, ObjectId> bd, ServiceInfoEntity serviceInfo)
 {
     bd.SetValue(be => be.BusIdentification, serviceInfo.BusIdentification);
     bd.SetValue(be => be.Type, serviceInfo.Type);
     bd.SetValue(be => be.UtcTimeTakenSample, serviceInfo.UtcTimeTakenSample);
 }