public void Export(CSession parent, ref CDatabaseConnection conn, List <IDiscoveredObject> sites, List <IDiscoveredObject> DiscoveredServers)
        {
            _DBConn = conn;

            IEnumerable <CSite> _discoveredsites = sites.OfType <CSite>();

            DiscoveredSites = new List <CSite> {
            };
            DiscoveredSites.AddRange(_discoveredsites);
            DiscoveredGroups = new Dictionary <string, CDiscoveredConfig> {
            };
            ExportedEntries  = new List <string> {
            };

            foreach (CService server in DiscoveredServers)
            {
                foreach (CQuery query in server.Session.Queries)
                {
                    for (int i = 0; i < query.Result.Count; i++)
                    {
                        ExportDiscoveredConfig(query.Result[i], server, true);
                    }
                }
                foreach (CDiscoveredConfig group in DiscoveredGroups.Values)
                {
                    ExportDiscoveredConfig(group);
                }
            }

            _DBConn.Close();
            _DBConn.Dispose();
            parent.Progress.Status = new CTaskInfo.State(CTaskInfo.State.Success);
            parent.Completed       = true;
        }
 public void Add(ref CSession writer)
 {
     Completed = false;
     QueuedSessions.Add(writer);
     if (QueuedCount == -1)
     {
         QueuedCount = 1;
     }
     else
     {
         QueuedCount++;
     }
 }
Ejemplo n.º 3
0
        public void Export(List <IDiscoveredObject> DiscoveredSites, List <IDiscoveredObject> DiscoveredServers)
        {
            Core._ReportURI = @"http://127.0.0.1:8182/";

            if (_DBConn == null)
            {
                _DBConn = InitializeDB();
            }

            string uid = CFunctions.GenerateUID();

            CSession exporter = new CSession(ref _DBConn, DiscoveredSites, DiscoveredServers, uid);

            SessionInfo.Add(exporter.Progress);
            SessionManager.Add(ref exporter);
        }