Esempio n. 1
0
        internal static bool Synchronize()
        {
            log.Info("Uruchomiono program z opcją \"synchronize\"");
            if (!IisIntegration.CheckBeforeSynchronization)
            {
                return(false);
            }

            UpdatePermanentList();
            List <EntityIpDomain> compareList = Lists.Zip(GetListFromFile(permanentFileName), Ims.GetList());

            List <EntityIpDomain> iisList   = IisIntegration.GetIpSecurityPropertyArray(IisIntegration.METABASE, MethodName.Get, MethodArgument.IPSecurity, Member.IPGrant);
            List <EntityIpDomain> compToIms = Lists.GetDifference(compareList, iisList);
            List <EntityIpDomain> imsToComp = Lists.GetDifference(iisList, compareList);

            if ((compToIms.Count > 0) || (imsToComp.Count > 0))
            {
                IisIntegration.UpdateIpSecurityPropertyArray(IisIntegration.METABASE, MethodName.Get, MethodArgument.IPSecurity, Member.IPGrant, compareList);
                string ErrorDescription = string.Format("Dodane do IMS adresy: {0}. Usunięte w IMS adresy: {1}", Lists.ToString(compToIms), Lists.ToString(imsToComp));
                Console.WriteLine(ErrorDescription);
                log.Info(ErrorDescription);
            }
            log.Info("Zakończono synchronizację.");

            return(true);
        }
Esempio n. 2
0
        private static void UpdatePermanentList()
        {
            List <EntityIpDomain> permanentList = GetListFromFile(permanentFileName);
            List <EntityIpDomain> diffList      = Lists.RemoveNotUnique(permanentList, Ims.GetList());

            ExportToFile(permanentFileName, diffList, false);
        }