public OutfitEngineProcessor(IStyleRuleRepository styleRuleRepository,
                                     IClosetRepository closetRepository,
                                     IOutfitUpdaterService outfitUpdaterService,
                                     IIndexCreationService outfitIndexingService)
        {
            Check.Require(styleRuleRepository != null, "styleRuleRepository may not be null");
            Check.Require(closetRepository != null, "closetRepository may not be null");
            Check.Require(outfitUpdaterService != null, "outfitUpdaterService may not be null");
            Check.Require(outfitIndexingService != null, "outfitIndexingService may not be null");

            _styleRuleRepository   = styleRuleRepository;
            _closetRepository      = closetRepository;
            _outfitUpdaterService  = outfitUpdaterService;
            _outfitIndexingService = outfitIndexingService;
        }
Exemple #2
0
        /// <summary>
        /// Updates all feeds.
        /// Normally executed on weekends.
        /// </summary>
        /// <remarks>
        /// Example of usage:
        /// FashionAde.OutfitUpdaterExecutor.exe host username password file1 file2 ...  fileN
        /// FashionAde.OutfitUpdaterExecutor.exe /download aftp.linksynergy.com jfennell2753 KftEapMS 24895_2389515_mp.txt.gz 13816_2389515_mp.txt.gz
        /// FashionAde.OutfitUpdaterExecutor.exe /download datatransfer.cj.com 2805067 CyWm5fUc /outgoing/productcatalog/52470/Zappos_com-Product_Catalog_1.txt.gz
        /// FashionAde.OutfitUpdaterExecutor.exe /execute
        /// </remarks>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            log4net.Config.XmlConfigurator.Configure();

            // Create container
            IWindsorContainer container = new WindsorContainer();

            // Add the Services to the Container
            ComponentRegistrar.AddApplicationServicesTo(container);

            // Create the container
            ServiceLocatorInitializer.Init(container);

            // Initialize NHibernate
            NHibernateInitializer.Instance().InitializeNHibernateOnce(
                InitializeNHibernateSession);

            try {
                if (args.Length > 4 && args[0].ToLower() == Download)
                {
                    // Download Files From Ftp
                    string host     = args[1];    // "aftp.linksynergy.com";
                    string userName = args[2];    // "jfennell2753";
                    string password = args[3];    // "KftEapMS";

                    for (var i = 4; i < args.Length; i++)
                    {
                        string sourceFile = args[i];
                        DownloadFile(host, userName, password, sourceFile);
                    }
                }
                else if (args.Length == 1 && args[0].ToLower() == Execute)
                {
                    // Start executing the updater
                    new OutfitUpdaterReference.OutfitUpdaterServiceClient().UpdateFeeds();
                }
                else if (args.Length == 1 && args[0].ToLower() == CreateIndexes)
                {
                    IIndexCreationService ics = ServiceLocator.Current.GetInstance <IIndexCreationService>();
                    ics.CreateIndexes();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }