Ejemplo n.º 1
0
 public static void UpdateActivity(IndexingActivity activity)
 {
     using (var context = new IndexingDataContext())
     {
         context.CommandTimeout = RepositoryConfiguration.SqlCommandTimeout;
         context.IndexingActivities.Attach(activity, true);
         context.SubmitChanges();
     }
 }
Ejemplo n.º 2
0
        public static void RegisterActivity(IndexingActivity activity)
        {
            var transaction = DataProvider.GetCurrentTransaction();

            using (var context = transaction == null ? new IndexingDataContext() : new IndexingDataContext(transaction))
            {
                context.CommandTimeout = RepositoryConfiguration.SqlCommandTimeout;
                context.IndexingActivities.InsertOnSubmit(activity);
                context.SubmitChanges();
            }
        }
Ejemplo n.º 3
0
        public static void ExecuteActivity(IndexingActivity activity, bool waitForComplete, bool distribute)
        {
            var lucAct = activity.CreateLuceneActivity();

            if (distribute)
            {
                lucAct.Distribute();
            }
            lucAct.InternalExecute();
            if (waitForComplete)
            {
                lucAct.WaitForComplete();
            }
        }
Ejemplo n.º 4
0
        internal static LuceneIndexingActivity CreateLucActivity(IndexingActivity activity)
        {
            switch (activity.ActivityType)
            {
            case IndexingActivityType.AddDocument:
                return(LuceneIndexingActivity.CreateFromIndexingActivity <AddDocumentActivity>(activity));

            case IndexingActivityType.AddTree:
                return(LuceneIndexingActivity.CreateFromIndexingActivity <AddTreeActivity>(activity));

            case IndexingActivityType.UpdateDocument:
                return(LuceneIndexingActivity.CreateFromIndexingActivity <UpdateDocumentActivity>(activity));

            case  IndexingActivityType.RemoveTree:
                return(LuceneIndexingActivity.CreateFromIndexingActivity <RemoveTreeActivity>(activity));

            case IndexingActivityType.RemoveDocument:
                return(LuceneIndexingActivity.CreateFromIndexingActivity <RemoveDocumentActivity>(activity));
            }
            throw new ArgumentException("Invalid ActivityType value", activity.ActivityType.ToString());
        }
Ejemplo n.º 5
0
        public static void ExecuteActivityDirect(IndexingActivity activity)
        {
            var lucAct = activity.CreateLuceneActivity();

            lucAct.Execute();
        }
Ejemplo n.º 6
0
 partial void DeleteIndexingActivity(IndexingActivity instance);
Ejemplo n.º 7
0
 partial void UpdateIndexingActivity(IndexingActivity instance);
Ejemplo n.º 8
0
 partial void InsertIndexingActivity(IndexingActivity instance);
Ejemplo n.º 9
0
 private static void ExecuteActivity(IndexingActivity activity)
 {
     IndexingActivityManager.RegisterActivity(activity);
     IndexingActivityManager.ExecuteActivity(activity, true, true);
 }