示例#1
0
        internal async Task ImportUpdateCompletedAsync(string catalogName, ImportUpdateCompletedEventType eventType, bool resourceIncluded)
        {
            var data = new ImportUpdateCompletedData
            {
                CatalogName       = catalogName,
                EventType         = eventType,
                ResourcesIncluded = resourceIncluded
            };

            await ExecuteWithinLockAsync(
                () =>
                _httpClient.PostWithAsyncStatusCheck(_config.Endpoints.ImportUpdateCompleted, data)
                );
        }
示例#2
0
        public bool ImportUpdateCompleted(ImportUpdateCompletedData data)
        {
            if (_config.RunInRiverEventsHandlers)
            {
                IEnumerable <IInRiverEventsHandler> eventsHandlers = ServiceLocator.Current.GetAllInstances <IInRiverEventsHandler>();
                foreach (IInRiverEventsHandler handler in eventsHandlers)
                {
                    handler.ImportUpdateCompleted(data.CatalogName, data.EventType, data.ResourcesIncluded);
                }

                _logger.Debug($"*** ImportUpdateCompleted events with parameters CatalogName={data.CatalogName}, EventType={data.EventType}, ResourcesIncluded={data.ResourcesIncluded}");
            }

            return(true);
        }
        internal void ImportUpdateCompleted(string catalogName, ImportUpdateCompletedEventType eventType, bool resourceIncluded)
        {
            lock (EpiLockObject.Instance)
            {
                try
                {
                    var data = new ImportUpdateCompletedData
                    {
                        CatalogName       = catalogName,
                        EventType         = eventType,
                        ResourcesIncluded = resourceIncluded
                    };

                    string result = _httpClient.PostWithAsyncStatusCheck(_config.Endpoints.ImportUpdateCompleted, data);
                    IntegrationLogger.Write(LogLevel.Debug, $"ImportUpdateCompleted returned: {result}");
                }
                catch (Exception exception)
                {
                    IntegrationLogger.Write(LogLevel.Error, $"Failed to fire import update completed for catalog {catalogName}.", exception);
                    throw;
                }
            }
        }
示例#4
0
 public bool ImportUpdateCompleted(string catalogName, ImportUpdateCompletedEventType eventType, bool resourceIncluded, Configuration config)
 {
     lock (SingletonEPiLock.Instance)
     {
         try
         {
             RestEndpoint <ImportUpdateCompletedData> endpoint = new RestEndpoint <ImportUpdateCompletedData>(config.Settings, "ImportUpdateCompleted", this._context);
             ImportUpdateCompletedData data = new ImportUpdateCompletedData
             {
                 CatalogName       = catalogName,
                 EventType         = eventType,
                 ResourcesIncluded = resourceIncluded
             };
             string result = endpoint.Post(data);
             _context.Log(LogLevel.Debug, string.Format("ImportUpdateCompleted returned: {0}", result));
             return(true);
         }
         catch (Exception exception)
         {
             _context.Log(LogLevel.Error, string.Format("Failed to fire import update completed for catalog {0}.", catalogName), exception);
             return(false);
         }
     }
 }
 public bool ImportUpdateCompleted(ImportUpdateCompletedData data)
 {
     return(_catalogImporter.ImportUpdateCompleted(data));
 }