gov.va.medora.mdo.dao.MultiSourceQuery.disconnectRemoteSites C# (CSharp) Method

disconnectRemoteSites() public method

public disconnectRemoteSites ( ) : IndexedHashtable
return IndexedHashtable
        public IndexedHashtable disconnectRemoteSites()
        {
            int lth = cxnTable.Count - 1;
            if (lth <= 0)
            {
                return null;
            }
            QueryThread[] queries = new QueryThread[lth];
            Thread[] threads = new Thread[lth];
            for (int i = 0; i < lth; i++)
            {
                queries[i] = new QueryThread(cxnTable.GetValue(i+1), "disconnect", new Object[0]);
                threads[i] = new Thread(new ThreadStart(queries[i].execute));
                threads[i].Start();
            }
            IndexedHashtable result = new IndexedHashtable(lth);
            for (int i = 0; i < lth; i++)
            {
                string key = (string)cxnTable.GetKey(i + 1);
                threads[i].Join();
                if (queries[i].isExceptionResult())
                {
                    result.Add(key, queries[i].Result);
                }
                else
                {
                    result.Add(key, "OK");
                }
            }
            for (int i = 0; i < result.Count; i++)
            {
                cxnTable.Remove(result.GetKey(i));
            }
            return result;
        }