internal void Add(TrackingErrorCollection errors)
 {
     if (!TrackingErrorCollection.IsNullOrEmpty(errors))
     {
         this.errors.AddRange(errors.errors);
     }
 }
示例#2
0
 public TrackingEventBudget(TrackingErrorCollection errors, TimeSpan timeBudgetAllowed)
 {
     TraceWrapper.SearchLibraryTracer.TraceDebug <double>(this.GetHashCode(), "Time budget: {0} msec", timeBudgetAllowed.TotalMilliseconds);
     this.budgetUsed        = 0U;
     this.errors            = errors;
     this.timeBudgetAllowed = timeBudgetAllowed;
     this.timer             = Stopwatch.StartNew();
 }
示例#3
0
 public DirectoryContext(ClientContext clientContext, OrganizationId organizationId, ITopologyConfigurationSession globalConfigSession, IConfigurationSession tenantConfigSession, IRecipientSession tenantGalSession, TrackingEventBudget trackingBudget, DiagnosticsLevel diagnosticsLevel, TrackingErrorCollection errors, bool suppressIdAllocation)
 {
     this.clientContext       = clientContext;
     this.organizationId      = organizationId;
     this.globalConfigSession = globalConfigSession;
     this.tenantConfigSession = tenantConfigSession;
     this.tenantGalSession    = tenantGalSession;
     this.diagnosticsContext  = new DiagnosticsContext(suppressIdAllocation, diagnosticsLevel);
     this.TrackingBudget      = trackingBudget;
     this.Errors = errors;
     if (!this.TrySetExternalOrgId(organizationId))
     {
         TraceWrapper.SearchLibraryTracer.TraceError(0, "Failed to set ExternalOrgId. Assuming forest wide organization", new object[0]);
     }
 }
 private TrackingFatalException(TrackingErrorCollection errors, ErrorCode errorCode, string target, string exception, string dataFormat, params object[] dataParams) : base(errors.Add(errorCode, target, string.Format(dataFormat, dataParams), exception), null, true)
 {
 }
 public static TrackingFatalException AddAndRaiseETX(TrackingErrorCollection errors, ErrorCode errorCode, string target, string exception)
 {
     throw new TrackingFatalException(errors, errorCode, target, exception, string.Empty, new object[0]);
 }
 public static TrackingFatalException AddAndRaiseETD(TrackingErrorCollection errors, ErrorCode errorCode, string target, string dataFormat, params object[] dataParams)
 {
     throw new TrackingFatalException(errors, errorCode, target, string.Empty, dataFormat, dataParams);
 }
 public static TrackingFatalException AddAndRaiseE(TrackingErrorCollection errors, ErrorCode errorCode)
 {
     throw new TrackingFatalException(errors, errorCode, string.Empty, string.Empty, string.Empty, new object[0]);
 }
 internal static bool IsNullOrEmpty(TrackingErrorCollection trackingErrorCollection)
 {
     return(trackingErrorCollection == null || trackingErrorCollection == TrackingErrorCollection.Empty);
 }
        public static bool TryRead(string server, LogSearchCursor cursor, BitArray fieldsToGet, TrackingErrorCollection errors, out MessageTrackingLogRow logEntry)
        {
            logEntry = null;
            MessageTrackingLogRow messageTrackingLogRow = new MessageTrackingLogRow();

            messageTrackingLogRow.serverFqdn = server;
            for (int i = 0; i < fieldsToGet.Length; i++)
            {
                if (fieldsToGet[i])
                {
                    object    obj = null;
                    Exception ex  = null;
                    try
                    {
                        obj = cursor.GetField(i);
                    }
                    catch (LogSearchException ex2)
                    {
                        ex = ex2;
                        int errorCode = ex2.ErrorCode;
                    }
                    catch (RpcException ex3)
                    {
                        ex = ex3;
                        int errorCode2 = ex3.ErrorCode;
                    }
                    if (ex != null)
                    {
                        TrackingTransientException.AddAndRaiseETX(errors, ErrorCode.LogSearchConnection, server, ex.ToString());
                    }
                    if (obj != null && obj.GetType() != MessageTrackingSchema.MessageTrackingEvent.Fields[i].Type)
                    {
                        throw new InvalidOperationException(string.Format("Schema for column {0} in message-tracking is of sync with tasks", i));
                    }
                    if (!MessageTrackingLogRow.ValidateField(messageTrackingLogRow, i, obj, errors))
                    {
                        return(false);
                    }
                    messageTrackingLogRow.columns[i]      = cursor.GetField(i);
                    messageTrackingLogRow.validColumns[i] = true;
                }
            }
            if (fieldsToGet[8] && (messageTrackingLogRow.EventId == MessageTrackingEvent.EXPAND || messageTrackingLogRow.EventId == MessageTrackingEvent.RESOLVE))
            {
                MessageTrackingLogRow.SmtpAddressValidatorWithNull(messageTrackingLogRow.RelatedRecipientAddress);
            }
            logEntry = messageTrackingLogRow;
            return(true);
        }
 private static bool ValidateField(MessageTrackingLogRow logEntry, int fieldIdx, object value, TrackingErrorCollection errors)
 {
     MessageTrackingLogRow.ValidateMethod validator = MessageTrackingLogRow.GetValidator(logEntry, fieldIdx);
     if (validator != null && !validator(value))
     {
         string text = string.Format("The message-tracking data on server {0} had invalid data in column {1} for this message. Event \"{2}\" will be ignored", logEntry.serverFqdn, fieldIdx, logEntry.EventId.ToString());
         errors.Add(ErrorCode.UnexpectedErrorPermanent, logEntry.ServerHostName, text, string.Empty);
         TraceWrapper.SearchLibraryTracer.TraceError(logEntry.GetHashCode(), text, new object[0]);
         return(false);
     }
     return(true);
 }
示例#11
0
        public static bool TryCreateFromCursor(LogSearchCursor cursor, string server, TrackingErrorCollection errors, out MessageTrackingLogEntry entry)
        {
            entry = null;
            MessageTrackingLogRow messageTrackingLogRow;

            if (MessageTrackingLogRow.TryRead(server, cursor, MessageTrackingLogEntry.allRows, errors, out messageTrackingLogRow))
            {
                entry = new MessageTrackingLogEntry(messageTrackingLogRow);
                return(true);
            }
            return(false);
        }