Esempio n. 1
0
 public DebugPageViewModel(
     INavigationService navigationService,
     ITermsUpdateService termsUpdateService,
     IExposureConfigurationRepository exposureConfigurationRepository,
     IUserDataRepository userDataRepository,
     IExposureDataRepository exposureDataRepository,
     AbsExposureNotificationApiService exposureNotificationApiService,
     AbsExposureDetectionBackgroundService exposureDetectionBackgroundService,
     ICloseApplicationService closeApplicationService,
     IServerConfigurationRepository serverConfigurationRepository,
     ILocalNotificationService localNotificationService,
     ISendEventLogStateRepository sendEventLogStateRepository,
     IEventLogRepository eventLogRepository,
     IEventLogService eventLogService
     ) : base(navigationService)
 {
     Title = "Title:Debug";
     _termsUpdateService = termsUpdateService;
     _exposureConfigurationRepository = exposureConfigurationRepository;
     _userDataRepository                 = userDataRepository;
     _exposureDataRepository             = exposureDataRepository;
     _exposureNotificationApiService     = exposureNotificationApiService;
     _exposureDetectionBackgroundService = exposureDetectionBackgroundService;
     _closeApplicationService            = closeApplicationService;
     _serverConfigurationRepository      = serverConfigurationRepository;
     _localNotificationService           = localNotificationService;
     _sendEventLogStateRepository        = sendEventLogStateRepository;
     _eventLogRepository                 = eventLogRepository;
     _eventLogService = eventLogService;
 }
Esempio n. 2
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="profileLogic"></param>
 /// <param name="messagingLogic"></param>
 /// <param name="logRepo"></param>
 public MessagingController(IUserProfileLogic profileLogic, IMessagingLogic messagingLogic, IEventLogRepository logRepo)
     : base(profileLogic)
 {
     _msgLogic        = messagingLogic;
     userProfileLogic = profileLogic;
     _log             = logRepo;
 }
Esempio n. 3
0
 public PageController(IPageRepository pageRepository, IEventLogRepository logger, ILinkRepository links, IMapper mapper)
 {
     _pages  = pageRepository;
     _logger = logger;
     _links  = links;
     _mapper = mapper;
 }
 public OrderConversionLogicImpl(IOrderHistoryHeaderRepsitory historyRepository, IUnitOfWork unitOfWork, IEventLogRepository logRepo, ICatalogLogic catalogLogic)
 {
     _historyRepo  = historyRepository;
     _uow          = unitOfWork;
     _catalogLogic = catalogLogic;
     _log          = logRepo;
 }
Esempio n. 5
0
 /// <summary>
 /// Download the images for all the files they claim to have
 /// </summary>
 public void DownloadImagesForProducts(IEventLogRepository log)
 {
     index = 0;
     _log  = log;
     Parallel.ForEach(Products, new ParallelOptions {
         MaxDegreeOfParallelism = 16
     }, product =>
     {
         index++;
         if (product.Filenames.Count > 0)
         {
             string best = ChooseBestFilename(product);
             foreach (string filename in product.Filenames)
             {
                 int trial = 0;
                 try
                 {
                     GetItem(best, filename, Constants.IXONE_PRODUCTIMAGE_PREFERREDTYPE);
                 }
                 catch// (Exception ex)
                 {
                     trial++;
                     if (trial == 1)
                     {
                         GetItem(best, filename, Constants.IXONE_PRODUCTIMAGE_BACKUPTYPE);
                     }
                 }
             }
         }
         if (index % 100 == 0)
         {
             _log.WriteInformationLog(string.Format(" Downloaded {0} products from Ix-One", index));
         }
     });
 }
Esempio n. 6
0
        public static void AuditChanges(DbContext context, object entity, IEventLogRepository log)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            if (log == null)
            {
                throw new ArgumentNullException("log");
            }

            DbEntityEntry entry = context.Entry(entity);

            var entityName   = ObjectContext.GetObjectType(entity.GetType()).Name;
            var auditMessage = string.Format("The instance of '{0}' is '{1}' with the context.", entityName, entry.State);

            log.WriteInformationLog(auditMessage);

            if (entry.State != EntityState.Detached)
            {
                foreach (var propertyName in entry.CurrentValues.PropertyNames)
                {
                    var originalValue = entry.Property(propertyName).OriginalValue;
                    var currentValue  = entry.Property(propertyName).CurrentValue;
                    var modified      = entry.Property(propertyName).IsModified;

                    auditMessage = string.Format("The '{0}' of '{1}' was '{2}' is now '{3}' and modified is {4}.", propertyName, entityName, originalValue, currentValue, modified);
                    log.WriteInformationLog(auditMessage);
                }
            }
        }
        public EventLogControllerTest()
        {
            var mappingConfig = new MapperConfiguration(mc =>
            {
                mc.AddProfile(new AutoMapperProfile());
            });

            _repository = new EventRepository(DbContext, mappingConfig.CreateMapper());
            _service    = new EventLogService(_repository);
            _controller = new EventLogController(_service);
            _context    = new EventContext();
            _testLog    = _service.Salvar(new EventLog()
            {
                EventID     = 0,
                Level       = "ERROR",
                Title       = "development.StaticOperation.Service: <failed>",
                CollectedBy = "yvqnygr3i1xl47wanrg2",
                Log         = "IOException",
                Description = "It is thrown when an input-output operation failed or interrupted",
                Origin      = "app.server.com.br",
                Environment = "Development",
                CreatedDate = new DateTime(2008, 5, 1, 8, 30, 52)
            }
                                          );
        }
Esempio n. 8
0
 public SettingsPageViewModel(
     INavigationService navigationService,
     ILoggerService loggerService,
     IUserDataRepository userDataRepository,
     IExposureDataRepository exposureDataRepository,
     IExposureConfigurationRepository exposureConfigurationRepository,
     ISendEventLogStateRepository sendEventLogStateRepository,
     IEventLogRepository eventLogRepository,
     ILogFileService logFileService,
     AbsExposureNotificationApiService exposureNotificationApiService,
     ICloseApplicationService closeApplicationService,
     IEssentialsService essentialsService
     ) : base(navigationService)
 {
     Title                                = AppResources.SettingsPageTitle;
     AppVer                               = essentialsService.AppVersion;
     this.loggerService                   = loggerService;
     this.userDataRepository              = userDataRepository;
     this.exposureDataRepository          = exposureDataRepository;
     this.exposureConfigurationRepository = exposureConfigurationRepository;
     _sendEventLogStateRepository         = sendEventLogStateRepository;
     _eventLogRepository                  = eventLogRepository;
     this.logFileService                  = logFileService;
     this.exposureNotificationApiService  = exposureNotificationApiService;
     this.closeApplicationService         = closeApplicationService;
 }
Esempio n. 9
0
        protected override void OnStart(string[] args)
        {
            _log = container.Resolve <IEventLogRepository>();
            _log.WriteInformationLog("Service starting");

            InitializeTimer();
        }
Esempio n. 10
0
 public DataMaintainanceBackgroundService(
     ILoggerService loggerService,
     IEventLogRepository eventLogRepository
     ) : base(loggerService, eventLogRepository)
 {
     // do nothing
 }
Esempio n. 11
0
 public EventLogService(
     IEventLogRepository eventLogRepository,
     IMapper mapper)
     : base(mapper)
 {
     _eventLogRepository = eventLogRepository;
 }
 protected AbsDataMaintainanceBackgroundService(
     ILoggerService loggerService,
     IEventLogRepository eventLogRepository)
 {
     LoggerService       = loggerService;
     _eventLogRepository = eventLogRepository;
 }
Esempio n. 13
0
        /// <summary>
        /// OnException in GlobalExceptionFilterAttribute
        /// </summary>
        /// <param name="actionExecutedContext"></param>
        public override void OnException(HttpActionExecutedContext actionExecutedContext)
        {
            eventLogRepository = GlobalConfiguration.Configuration.DependencyResolver.GetService(typeof(IEventLogRepository)) as IEventLogRepository;

            var errorMessage = string.Empty;

            errorMessage = GenerateDetailedErrorMessage(actionExecutedContext);

            if (string.IsNullOrEmpty(errorMessage))
            {
                errorMessage = "Unhandled API Exception";
            }

            eventLogRepository.WriteErrorLog(errorMessage, actionExecutedContext.Exception);

            if (actionExecutedContext.Exception.GetType().Name == typeof(InvalidApiKeyException).Name || actionExecutedContext.Exception.GetType().Name == typeof(NoApiKeyProvidedException).Name)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.BadRequest)
                {
                    Content = new StringContent("API Key Invalid or Missing")
                });
            }
            else
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.BadRequest)
                {
                    Content = new StringContent("An unhandled exception has occured")
                });
            }
        }
Esempio n. 14
0
        public SpecialOrderLogicImpl(IUnitOfWork unitOfWork, IEventLogRepository log, IGenericQueueRepository queue,
                                     IGenericSubscriptionQueueRepository genericSubscriptionQueue,
                                     IOrderHistoryDetailRepository detailRepo, IOrderHistoryHeaderRepsitory headerRepo,
                                     ICustomerRepository customerRepository, IMessageTemplateLogic messageTemplateLogic,
                                     IDsrLogic dsrLogic, IUserProfileLogic userProfileLogic,
                                     IUserMessagingPreferenceRepository userMessagingPreferenceRepository,
                                     IUserPushNotificationDeviceRepository userPushNotificationDeviceRepository,
                                     Func <Channel, IMessageProvider> messageProviderFactory)
        {
            _unitOfWork = unitOfWork;
            _log        = log;
            _queue      = queue;
            _genericSubscriptionQueue = genericSubscriptionQueue;
            _keepListening            = true;
            _headerRepo           = headerRepo;
            _detailRepo           = detailRepo;
            _customerRepository   = customerRepository;
            _messageTemplateLogic = messageTemplateLogic;
            _dsrLogic             = dsrLogic;
            _userProfileLogic     = userProfileLogic;
            _userMessagingPreferenceRepository    = userMessagingPreferenceRepository;
            _userPushNotificationDeviceRepository = userPushNotificationDeviceRepository;
            _messageProviderFactory = messageProviderFactory;

            // subscribe to event to receive message through subscription
            _genericSubscriptionQueue.MessageReceived += GenericSubscriptionQueue_MessageReceived;
        }
 public TemplatePropertyController(ITemplatePropertyRepository repo,
                                   IMapper mapper, UserManager <User> userManager, IEventLogRepository eventLogRepo)
 {
     _mapper       = mapper;
     _repo         = repo;
     _userManager  = userManager;
     _eventLogRepo = eventLogRepo;
 }
Esempio n. 16
0
        public GenericSubscriptionQueueRepositoryImpl(IEventLogRepository logger)
        {
            _processing        = false;
            _restartProcessing = false;
            _shutdown          = false;

            _logger = logger;
        }
Esempio n. 17
0
 public ReportLogic(ICatalogRepository catalogRepository, IReportRepository reportRepository, IEventLogRepository eventLogRepository,
                    ICatalogLogic catalogLogic)
 {
     _catalogLogic      = catalogLogic;
     _catalogRepository = catalogRepository;
     _log = eventLogRepository;
     _reportRepository = reportRepository;
 }
Esempio n. 18
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="listServiceRepository"></param>
 /// <param name="profileLogic"></param>
 /// <param name="logRepo"></param>
 public ItemNoteController(IListLogic listServiceRepository, IUserProfileLogic profileLogic, INotesListLogic notesLogic,
                           IEventLogRepository logRepo, IListService listService) : base(profileLogic)
 {
     this.listServiceRepository = listServiceRepository;
     _notesLogic  = notesLogic;
     _listService = listService;
     _log         = logRepo;
 }
Esempio n. 19
0
 public MonitorController(IMonitorRepository monitor,
                          IMonitorConditionRepository monitorcondition,
                          IEventLogRepository eventLog)
 {
     MonitorRepository          = monitor;
     MonitorConditionRepository = monitorcondition;
     LogRepository = eventLog;
 }
Esempio n. 20
0
 public HomeController(IConfigRepository config, IEventLogRepository logger, IMapper mapper,
                       SignInManager <User> signInManager,
                       ILinkRepository link)
 {
     _mapper = mapper;
     _logger = logger;
     _config = config;
 }
Esempio n. 21
0
 public AlbumController(IEventLogRepository logger,
                        IPhotoRepository photoRepository,
                        IGalleryRepository gallery,
                        IHostingEnvironment hosting)
 {
     _logger  = logger;
     _gallery = gallery;
 }
Esempio n. 22
0
 public DataMaintainanceBackgroundService(
     ILoggerService loggerService,
     IEventLogRepository eventLogRepository,
     IDateTimeUtility dateTimeUtility
     ) : base(loggerService, eventLogRepository)
 {
     _dateTimeUtility = dateTimeUtility;
 }
 public CategoriesImportLogicImpl(IStagingRepository stagingRepository,
                                  IElasticSearchRepository esRepository,
                                  IEventLogRepository eventLogRepository)
 {
     _stagingRepository       = stagingRepository;
     _elasticSearchRepository = esRepository;
     _eventLog = eventLogRepository;
 }
Esempio n. 24
0
        public EmailClientImpl(IEventLogRepository log)
        {
            this.serviceEmailAddress = Configuration.ServiceEmailAddress;
            this.smtpHostName        = Configuration.SMTPHostName;
            this.smtpSendPort        = Configuration.SMTPSendPort;

            _log = log;
        }
Esempio n. 25
0
 public OrderController(DataContext context, IMapper mapper, IOrderRepository repo,
                        UserManager <User> userManager, IEventLogRepository eventLogRepo)
 {
     _repo         = repo;
     _mapper       = mapper;
     _userManager  = userManager;
     _eventLogRepo = eventLogRepo;
 }
Esempio n. 26
0
 public UserFeedbackLogicImpl(
     IUserFeedbackRepository userFeedbackRepo,
     IEventLogRepository eventLog
     )
 {
     _userFeedbackRepo = userFeedbackRepo;
     _eventLog         = eventLog;
 }
 public HouseBrandsImportLogicImpl(IStagingRepository stagingRepository,
                                   IElasticSearchRepository elasticSearchRepository,
                                   IEventLogRepository eventLogRespository)
 {
     _stagingRepository       = stagingRepository;
     _elasticSearchRepository = elasticSearchRepository;
     _eventLog = eventLogRespository;
 }
Esempio n. 28
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="cacheRepository"></param>
 /// <param name="profileLogic"></param>
 /// <param name="elRepo"></param>
 public CacheController(ICacheRefreshRepository cacheRepository, IUserProfileLogic profileLogic, IEventLogRepository elRepo,
                        IListService listService, ICacheListLogic cacheListLogic) : base(profileLogic)
 {
     this.cacheRepository = cacheRepository;
     _listService         = listService;
     _cacheListLogic      = cacheListLogic;
     this._elRepo         = elRepo;
 }
Esempio n. 29
0
 public InfraController(IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
                        ILogger <InfraController> logger, IEventLogRepository eventLogRepository, ICoreProfilerRepository coreProfilerRepository)
 {
     this._actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;
     _logger                 = logger;
     _eventLogRepository     = eventLogRepository;
     _coreProfilerRepository = coreProfilerRepository;
 }
Esempio n. 30
0
 public UnitTypeController(IUnitTypeRepository repo,
                           IMapper mapper, UserManager <User> userManager, IEventLogRepository eventLogRepo)
 {
     _mapper       = mapper;
     _repo         = repo;
     _userManager  = userManager;
     _eventLogRepo = eventLogRepo;
 }