public static CollectionNameModel CheckName(string collectionName)
        {
            CollectionNameModel result = LogCollectionNameModel.CheckName(collectionName);

            if (result == null)
            {
                result = TraceOrPageIdNameModel.CheckName(collectionName);
            }
            if (result == null)
            {
                result = new OtherNameModel(collectionName);
            }
            return(result);
        }
Example #2
0
 public ProcessEnum Check(CollectionNameModel nameModel)
 {
     if (nameModel is LogCollectionNameModel logNameModel)
     {
         if (ClientNames.AnyX() && !ClientNames.Contains(logNameModel.ClientName))
         {
             return(ProcessEnum.None);
         }
         if (EnvNames.AnyX() && !EnvNames.Contains(logNameModel.EnvName))
         {
             return(ProcessEnum.None);
         }
         if (Preffix != logNameModel.Preffix)
         {
             return(ProcessEnum.None);
         }
         if (logNameModel.Date > RealMaxDate)
         {
             return(ProcessEnum.None);
         }
         return(DropAfterBak ? ProcessEnum.BakAndRemove : ProcessEnum.BakOnly);
     }
     else if (nameModel is TraceOrPageIdNameModel tpNameMode)
     {
         if (!ProcessTraceIdPageId)
         {
             return(ProcessEnum.None);
         }
         if (ClientNames.AnyX() || EnvNames.AnyX())
         {
             return(ProcessEnum.None);
         }
         var modelDate = new DateTime(tpNameMode.Year, tpNameMode.Month, 1);
         if (modelDate < new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1))
         {
             return(ProcessEnum.BakOnly);
         }
         else
         {
             return(ProcessEnum.BakAndRemove);
         }
     }
     else
     {
         return(ProcessEnum.None);
     }
 }
Example #3
0
 public ProcessItem(CollectionNameModel nameModel, ProcessEnum processEnum)
 {
     NameModel   = nameModel;
     ProcessEnum = processEnum;
 }