Exemple #1
0
            public override void Save(IConfigurable instance)
            {
                MailboxAuditLogSearch mailboxAuditLogSearch  = (MailboxAuditLogSearch)instance;
                MailboxAuditLogSearch mailboxAuditLogSearch2 = new MailboxAuditLogSearch();

                mailboxAuditLogSearch2.Identity             = (AuditLogSearchId)mailboxAuditLogSearch.Identity;
                mailboxAuditLogSearch2.Name                 = mailboxAuditLogSearch.Name;
                mailboxAuditLogSearch2.StartDateUtc         = new DateTime?(mailboxAuditLogSearch.StartDateUtc.Value);
                mailboxAuditLogSearch2.EndDateUtc           = new DateTime?(mailboxAuditLogSearch.EndDateUtc.Value);
                mailboxAuditLogSearch2.StatusMailRecipients = NewAuditLogSearchBase <MailboxAuditLogSearch> .GetMultiValuedSmptAddressAsStrings(mailboxAuditLogSearch.StatusMailRecipients);

                mailboxAuditLogSearch2.CreatedBy   = mailboxAuditLogSearch.CreatedBy;
                mailboxAuditLogSearch2.CreatedByEx = mailboxAuditLogSearch.CreatedByEx;
                mailboxAuditLogSearch2.Mailboxes   = mailboxAuditLogSearch.Mailboxes;
                mailboxAuditLogSearch2.LogonTypes  = mailboxAuditLogSearch.LogonTypes;
                mailboxAuditLogSearch2.Operations  = mailboxAuditLogSearch.Operations;
                mailboxAuditLogSearch2.ShowDetails = new bool?(mailboxAuditLogSearch.ShowDetails);
                if (mailboxAuditLogSearch.ExternalAccess != null)
                {
                    mailboxAuditLogSearch2.ExternalAccess = (mailboxAuditLogSearch.ExternalAccess.Value ? bool.TrueString : bool.FalseString);
                }
                base.Save(mailboxAuditLogSearch2);
                AuditQueuesOpticsLogData auditQueuesOpticsLogData = new AuditQueuesOpticsLogData
                {
                    QueueType      = AuditQueueType.AsyncMailboxSearch,
                    EventType      = QueueEventType.Queue,
                    CorrelationId  = mailboxAuditLogSearch2.Identity.Guid.ToString(),
                    OrganizationId = this.organizationId,
                    QueueLength    = ((this.defaultFolder != null) ? (this.defaultFolder.TotalCount + 1) : 1)
                };

                auditQueuesOpticsLogData.Log();
                instance.ResetChangeTracking();
            }
Exemple #2
0
        protected override void InternalValidate()
        {
            if (NewMailboxAuditLogSearch.MailboxAuditLogSearchRequestThreshold == null)
            {
                int?num = NewAuditLogSearchBase <MailboxAuditLogSearch> .ReadIntegerAppSetting("AsyncMailboxAuditLogSearchRequestThreshold");

                if (num == null || num < 1)
                {
                    NewMailboxAuditLogSearch.MailboxAuditLogSearchRequestThreshold = new int?(50);
                }
                else
                {
                    NewMailboxAuditLogSearch.MailboxAuditLogSearchRequestThreshold = num;
                }
            }
            NewMailboxAuditLogSearch.SearchDataProvider searchDataProvider = (NewMailboxAuditLogSearch.SearchDataProvider)base.DataSession;
            if (searchDataProvider.GetAuditLogSearchCount() >= NewMailboxAuditLogSearch.MailboxAuditLogSearchRequestThreshold.Value)
            {
                base.WriteError(new InvalidOperationException(Strings.CannotCreateAuditLogSearchDueToSearchQuota), ErrorCategory.QuotaExceeded, null);
            }
            base.InternalValidate();
        }
            public override IConfigurable Read <T>(ObjectId identity)
            {
                AuditLogSearchId auditLogSearchId = identity as AuditLogSearchId;

                if (auditLogSearchId != null)
                {
                    SearchFilter filter = new SearchFilter.IsEqualTo(AuditLogSearchBaseEwsSchema.Identity.StorePropertyDefinition, auditLogSearchId.Guid.ToString());
                    using (IEnumerator <AdminAuditLogSearch> enumerator = this.FindInFolder <AdminAuditLogSearch>(filter, this.GetDefaultFolder()).GetEnumerator())
                    {
                        if (enumerator.MoveNext())
                        {
                            AdminAuditLogSearch adminAuditLogSearch  = enumerator.Current;
                            AdminAuditLogSearch adminAuditLogSearch2 = new AdminAuditLogSearch();
                            adminAuditLogSearch2.SetId(adminAuditLogSearch.Identity);
                            adminAuditLogSearch2.Name                 = adminAuditLogSearch.Name;
                            adminAuditLogSearch2.StartDateUtc         = new DateTime?(adminAuditLogSearch.StartDateUtc.Value);
                            adminAuditLogSearch2.EndDateUtc           = new DateTime?(adminAuditLogSearch.EndDateUtc.Value);
                            adminAuditLogSearch2.StatusMailRecipients = NewAuditLogSearchBase <AdminAuditLogSearch> .GetMultiValuedStringsAsSmptAddresses(adminAuditLogSearch.StatusMailRecipients);

                            adminAuditLogSearch2.CreatedBy   = adminAuditLogSearch.CreatedBy;
                            adminAuditLogSearch2.CreatedByEx = adminAuditLogSearch.CreatedByEx;
                            adminAuditLogSearch2.Cmdlets     = adminAuditLogSearch.Cmdlets;
                            adminAuditLogSearch2.Parameters  = adminAuditLogSearch.Parameters;
                            adminAuditLogSearch2.ObjectIds   = adminAuditLogSearch.ObjectIds;
                            bool value;
                            if (!string.IsNullOrEmpty(adminAuditLogSearch.ExternalAccess) && bool.TryParse(adminAuditLogSearch.ExternalAccess, out value))
                            {
                                adminAuditLogSearch2.ExternalAccess = new bool?(value);
                            }
                            adminAuditLogSearch2.UserIds       = adminAuditLogSearch.UserIds;
                            adminAuditLogSearch2.ResolvedUsers = adminAuditLogSearch.ResolvedUsers;
                            return(adminAuditLogSearch2);
                        }
                    }
                }
                return(null);
            }
Exemple #4
0
            public override IConfigurable Read <T>(ObjectId identity)
            {
                AuditLogSearchId auditLogSearchId = identity as AuditLogSearchId;

                if (auditLogSearchId != null)
                {
                    SearchFilter filter = new SearchFilter.IsEqualTo(AuditLogSearchBaseEwsSchema.Identity.StorePropertyDefinition, auditLogSearchId.Guid.ToString());
                    using (IEnumerator <MailboxAuditLogSearch> enumerator = this.FindInFolder <MailboxAuditLogSearch>(filter, this.GetDefaultFolder()).GetEnumerator())
                    {
                        if (enumerator.MoveNext())
                        {
                            MailboxAuditLogSearch mailboxAuditLogSearch  = enumerator.Current;
                            MailboxAuditLogSearch mailboxAuditLogSearch2 = new MailboxAuditLogSearch();
                            mailboxAuditLogSearch2.SetId(mailboxAuditLogSearch.Identity);
                            mailboxAuditLogSearch2.Name                 = mailboxAuditLogSearch.Name;
                            mailboxAuditLogSearch2.StartDateUtc         = new DateTime?(mailboxAuditLogSearch.StartDateUtc.Value);
                            mailboxAuditLogSearch2.EndDateUtc           = new DateTime?(mailboxAuditLogSearch.EndDateUtc.Value);
                            mailboxAuditLogSearch2.StatusMailRecipients = NewAuditLogSearchBase <MailboxAuditLogSearch> .GetMultiValuedStringsAsSmptAddresses(mailboxAuditLogSearch.StatusMailRecipients);

                            mailboxAuditLogSearch2.CreatedBy   = mailboxAuditLogSearch.CreatedBy;
                            mailboxAuditLogSearch2.CreatedByEx = mailboxAuditLogSearch.CreatedByEx;
                            mailboxAuditLogSearch2.Mailboxes   = mailboxAuditLogSearch.Mailboxes;
                            mailboxAuditLogSearch2.LogonTypes  = mailboxAuditLogSearch.LogonTypes;
                            mailboxAuditLogSearch2.Operations  = mailboxAuditLogSearch.Operations;
                            mailboxAuditLogSearch2.ShowDetails = (mailboxAuditLogSearch.ShowDetails != null && mailboxAuditLogSearch.ShowDetails.Value);
                            bool value;
                            if (!string.IsNullOrEmpty(mailboxAuditLogSearch.ExternalAccess) && bool.TryParse(mailboxAuditLogSearch.ExternalAccess, out value))
                            {
                                mailboxAuditLogSearch2.ExternalAccess = new bool?(value);
                            }
                            return(mailboxAuditLogSearch2);
                        }
                    }
                }
                return(null);
            }
            public override void Save(IConfigurable instance)
            {
                AdminAuditLogSearch adminAuditLogSearch  = (AdminAuditLogSearch)instance;
                AdminAuditLogSearch adminAuditLogSearch2 = new AdminAuditLogSearch();

                adminAuditLogSearch2.Identity             = (AuditLogSearchId)adminAuditLogSearch.Identity;
                adminAuditLogSearch2.Name                 = adminAuditLogSearch.Name;
                adminAuditLogSearch2.StartDateUtc         = new DateTime?(adminAuditLogSearch.StartDateUtc.Value);
                adminAuditLogSearch2.EndDateUtc           = new DateTime?(adminAuditLogSearch.EndDateUtc.Value);
                adminAuditLogSearch2.StatusMailRecipients = NewAuditLogSearchBase <AdminAuditLogSearch> .GetMultiValuedSmptAddressAsStrings(adminAuditLogSearch.StatusMailRecipients);

                adminAuditLogSearch2.CreatedBy   = adminAuditLogSearch.CreatedBy;
                adminAuditLogSearch2.CreatedByEx = adminAuditLogSearch.CreatedByEx;
                adminAuditLogSearch2.Cmdlets     = adminAuditLogSearch.Cmdlets;
                adminAuditLogSearch2.Parameters  = adminAuditLogSearch.Parameters;
                adminAuditLogSearch2.ObjectIds   = adminAuditLogSearch.ObjectIds;
                if (adminAuditLogSearch.ExternalAccess != null)
                {
                    adminAuditLogSearch2.ExternalAccess = (adminAuditLogSearch.ExternalAccess.Value ? bool.TrueString : bool.FalseString);
                }
                adminAuditLogSearch2.UserIds                = adminAuditLogSearch.UserIds;
                adminAuditLogSearch2.ResolvedUsers          = adminAuditLogSearch.ResolvedUsers;
                adminAuditLogSearch2.RedactDatacenterAdmins = adminAuditLogSearch.RedactDatacenterAdmins;
                base.Save(adminAuditLogSearch2);
                AuditQueuesOpticsLogData auditQueuesOpticsLogData = new AuditQueuesOpticsLogData
                {
                    QueueType      = AuditQueueType.AsyncAdminSearch,
                    EventType      = QueueEventType.Queue,
                    CorrelationId  = adminAuditLogSearch2.Identity.Guid.ToString(),
                    OrganizationId = this.organizationId,
                    QueueLength    = ((this.defaultFolder != null) ? (this.defaultFolder.TotalCount + 1) : 1)
                };

                auditQueuesOpticsLogData.Log();
                instance.ResetChangeTracking();
            }