Descendants tree collection.
/// The exception that is thrown when a null /// reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. ///
Exemplo n.º 1
0
        public CrawlEventCollection GenerateEvents(DescendantsTreeCollection trees)
        {
            IObjectTree <IMappedObject>       storedTree = trees.StoredTree;
            IObjectTree <IFileSystemInfo>     localTree  = trees.LocalTree;
            IObjectTree <IFileableCmisObject> remoteTree = trees.RemoteTree;
            CrawlEventCollection createdEvents           = new CrawlEventCollection();
            List <IMappedObject> storedObjectsForRemote  = storedTree.ToList();
            List <IMappedObject> storedObjectsForLocal   = new List <IMappedObject>(storedObjectsForRemote);

            Dictionary <string, Tuple <AbstractFolderEvent, AbstractFolderEvent> > eventMap = new Dictionary <string, Tuple <AbstractFolderEvent, AbstractFolderEvent> >();

            createdEvents.creationEvents = this.remoteEventGenerator.CreateEvents(storedObjectsForRemote, remoteTree, eventMap);
            createdEvents.creationEvents.AddRange(this.localEventGenerator.CreateEvents(storedObjectsForLocal, localTree, eventMap));

            createdEvents.mergableEvents = eventMap;

            IMappedObject rootNode = storedTree.Item;

            storedObjectsForLocal.Remove(rootNode);
            storedObjectsForRemote.Remove(rootNode);

            createdEvents.removedLocalObjects  = this.TransformToFileSystemInfoDict(storedObjectsForLocal);
            createdEvents.removedRemoteObjects = this.TransformToFileSystemInfoDict(storedObjectsForRemote);

            return(createdEvents);
        }
Exemplo n.º 2
0
        public CrawlEventCollection GenerateEvents(DescendantsTreeCollection trees) {
            IObjectTree<IMappedObject> storedTree = trees.StoredTree;
            IObjectTree<IFileSystemInfo> localTree = trees.LocalTree;
            IObjectTree<IFileableCmisObject> remoteTree = trees.RemoteTree;
            CrawlEventCollection createdEvents = new CrawlEventCollection();
            List<IMappedObject> storedObjectsForRemote = storedTree.ToList();
            List<IMappedObject> storedObjectsForLocal = new List<IMappedObject>(storedObjectsForRemote);
            ISet<IMappedObject> handledLocalStoredObjects = new HashSet<IMappedObject>();
            ISet<IMappedObject> handledRemoteStoredObjects = new HashSet<IMappedObject>();
            Dictionary<string, Tuple<AbstractFolderEvent, AbstractFolderEvent>> eventMap = new Dictionary<string, Tuple<AbstractFolderEvent, AbstractFolderEvent>>();
            createdEvents.creationEvents = this.remoteEventGenerator.CreateEvents(storedObjectsForRemote, remoteTree, eventMap, handledRemoteStoredObjects);
            createdEvents.creationEvents.AddRange(this.localEventGenerator.CreateEvents(storedObjectsForLocal, localTree, eventMap, handledLocalStoredObjects));

            createdEvents.mergableEvents = eventMap;

            handledLocalStoredObjects.Add(storedTree.Item);
            handledRemoteStoredObjects.Add(storedTree.Item);

            foreach (var handledObject in handledLocalStoredObjects) {
                storedObjectsForLocal.Remove(handledObject);
            }

            foreach (var handledObject in handledRemoteStoredObjects) {
                storedObjectsForRemote.Remove(handledObject);
            }

            this.AddDeletedObjectsToMergableEvents(storedObjectsForLocal, eventMap, true);
            this.AddDeletedObjectsToMergableEvents(storedObjectsForRemote, eventMap, false);

            return createdEvents;
        }
Exemplo n.º 3
0
        public CrawlEventCollection GenerateEvents(DescendantsTreeCollection trees)
        {
            IObjectTree <IMappedObject>       storedTree    = trees.StoredTree;
            IObjectTree <IFileSystemInfo>     localTree     = trees.LocalTree;
            IObjectTree <IFileableCmisObject> remoteTree    = trees.RemoteTree;
            CrawlEventCollection createdEvents              = new CrawlEventCollection();
            List <IMappedObject> storedObjectsForRemote     = storedTree.ToList();
            List <IMappedObject> storedObjectsForLocal      = new List <IMappedObject>(storedObjectsForRemote);
            ISet <IMappedObject> handledLocalStoredObjects  = new HashSet <IMappedObject>();
            ISet <IMappedObject> handledRemoteStoredObjects = new HashSet <IMappedObject>();
            Dictionary <string, Tuple <AbstractFolderEvent, AbstractFolderEvent> > eventMap = new Dictionary <string, Tuple <AbstractFolderEvent, AbstractFolderEvent> >();

            createdEvents.creationEvents = this.remoteEventGenerator.CreateEvents(storedObjectsForRemote, remoteTree, eventMap, handledRemoteStoredObjects);
            createdEvents.creationEvents.AddRange(this.localEventGenerator.CreateEvents(storedObjectsForLocal, localTree, eventMap, handledLocalStoredObjects));

            createdEvents.mergableEvents = eventMap;

            handledLocalStoredObjects.Add(storedTree.Item);
            handledRemoteStoredObjects.Add(storedTree.Item);

            foreach (var handledObject in handledLocalStoredObjects)
            {
                storedObjectsForLocal.Remove(handledObject);
            }

            foreach (var handledObject in handledRemoteStoredObjects)
            {
                storedObjectsForRemote.Remove(handledObject);
            }

            this.AddDeletedObjectsToMergableEvents(storedObjectsForLocal, eventMap, true);
            this.AddDeletedObjectsToMergableEvents(storedObjectsForRemote, eventMap, false);

            return(createdEvents);
        }
Exemplo n.º 4
0
        private void CrawlDescendants()
        {
            DescendantsTreeCollection trees = this.treebuilder.BuildTrees();

            CrawlEventCollection events = this.eventGenerator.GenerateEvents(trees);

            this.notifier.MergeEventsAndAddToQueue(events);
        }
Exemplo n.º 5
0
        private void CrawlDescendants()
        {
            try {
                DescendantsTreeCollection trees = this.treebuilder.BuildTrees();
                if (Logger.IsDebugEnabled)
                {
                    Logger.Debug(string.Format("LocalTree:  {0} Elements", trees.LocalTree.ToList().Count));
                    Logger.Debug(string.Format("RemoteTree: {0} Elements", trees.RemoteTree.ToList().Count));
                    Logger.Debug(string.Format("StoredTree: {0} Elements", trees.StoredTree.ToList().Count));
                }

                CrawlEventCollection events = this.eventGenerator.GenerateEvents(trees);

                this.notifier.MergeEventsAndAddToQueue(events);
            } catch (System.IO.PathTooLongException e) {
                string msg = "Crawl Sync aborted because a local path is too long. Please take a look into the log to figure out the reason.";
                throw new InteractionNeededException(msg, e)
                      {
                          Title = "Local path is too long", Description = msg
                      };
            }
        }