Esempio n. 1
0
        public void Add(CalendarItemBase calendarItem)
        {
            GlobalObjectId globalObjectId = null;

            if (calendarItem == null)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "[MeetingOrganizerInfo.Add] calendarItem is null.");
                return;
            }
            AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "[MeetingOrganizerInfo.Add] Process CalendarItem and add an entry to Cache");
            string text = string.Empty;

            try
            {
                text = calendarItem.Session.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString();
            }
            catch (NullReferenceException)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "[MeetingOrganizerInfo.Add] nullReference Exception when reading PrimarySmtpAddress");
            }
            AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, this, "[MeetingOrganizerInfo.Add] PrimarySmtpAddress:{0}", text);
            try
            {
                globalObjectId = this.MakeCleanId(calendarItem.GlobalObjectId);
            }
            catch (CorruptDataException arg)
            {
                AirSyncDiagnostics.TraceDebug <string, string, CorruptDataException>(ExTraceGlobals.RequestsTracer, this, "[MeetingOrganizerInfo.Add] calendarItem does NOT have a global object id.  Subject: '{0}', Mailbox: '{1}', Exception: '{2}'", calendarItem.Subject, text, arg);
                return;
            }
            catch (NotInBagPropertyErrorException arg2)
            {
                AirSyncDiagnostics.TraceDebug <string, string, NotInBagPropertyErrorException>(ExTraceGlobals.RequestsTracer, this, "[MeetingOrganizerInfo.Add] calendarItem does NOT have a global object id.  Subject: '{0}', Mailbox: '{1}', Exception: '{2}'", calendarItem.Subject, text, arg2);
                return;
            }
            if (globalObjectId != null && globalObjectId.Uid != null)
            {
                AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, this, "[MeetingOrganizerInfo.Add] Found CleanId & Uid:{0}", globalObjectId.Uid);
                MeetingOrganizerEntry meetingOrganizerEntry = null;
                bool flag = false;
                lock (this.instanceLock)
                {
                    this.map.TryGetValue(globalObjectId.Uid, out meetingOrganizerEntry);
                }
                if (meetingOrganizerEntry == null)
                {
                    AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "[MeetingOrganizerInfo.Add] Entry not found in Dictionary");
                    meetingOrganizerEntry = ((MeetingOrganizerInfo.OnCacheMissForTest != null) ? MeetingOrganizerInfo.OnCacheMissForTest(globalObjectId) : this.BuildFromCalendarItem(globalObjectId, calendarItem));
                    if (meetingOrganizerEntry != null)
                    {
                        if (meetingOrganizerEntry.CleanGlobalObjectId == null || meetingOrganizerEntry.CleanGlobalObjectId.Uid == null)
                        {
                            Command.CurrentCommand.ProtocolLogger.AppendValue(ProtocolLoggerData.Error, "Add_NullUID");
                        }
                        else if (meetingOrganizerEntry.IsOrganizer != null)
                        {
                            this.Add(meetingOrganizerEntry);
                        }
                    }
                }
                else
                {
                    flag = true;
                }
                if (Command.CurrentCommand != null)
                {
                    Command.CurrentCommand.ProtocolLogger.SetValue(ProtocolLoggerData.MeetingOrganizerLookup, flag.ToString());
                }
                return;
            }
            AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.RequestsTracer, this, "[MeetingOrganizerInfo.Add] cleanId is missing Uid. Tell someone to go find it.  Subject: '{0}', Mailbox: '{1}'", calendarItem.Subject, text);
        }
Esempio n. 2
0
        public MeetingOrganizerEntry GetEntry(GlobalObjectId globalObjectId)
        {
            if (globalObjectId == null)
            {
                return(null);
            }
            GlobalObjectId        globalObjectId2       = this.MakeCleanId(globalObjectId);
            MeetingOrganizerEntry meetingOrganizerEntry = null;
            bool flag = false;

            lock (this.instanceLock)
            {
                this.map.TryGetValue(globalObjectId2.Uid, out meetingOrganizerEntry);
            }
            if (meetingOrganizerEntry == null)
            {
                meetingOrganizerEntry = ((MeetingOrganizerInfo.OnCacheMissForTest != null) ? MeetingOrganizerInfo.OnCacheMissForTest(globalObjectId) : this.ReadFromStore(globalObjectId));
                if (meetingOrganizerEntry != null)
                {
                    if (meetingOrganizerEntry.CleanGlobalObjectId.Uid == null)
                    {
                        Command.CurrentCommand.ProtocolLogger.AppendValue(ProtocolLoggerData.Error, "Get_NullUID");
                    }
                    else if (meetingOrganizerEntry.IsOrganizer != null)
                    {
                        this.Add(meetingOrganizerEntry);
                    }
                }
            }
            else
            {
                flag = true;
            }
            if (Command.CurrentCommand != null)
            {
                Command.CurrentCommand.ProtocolLogger.SetValue(ProtocolLoggerData.MeetingOrganizerLookup, flag.ToString());
            }
            return(meetingOrganizerEntry);
        }