コード例 #1
0
 internal void SetSpecifiedIndex(RequestIndexId index)
 {
     if (index == null)
     {
         throw new ArgumentNullException("index");
     }
     this.indexToUse = index;
 }
コード例 #2
0
 internal void SetDefaultIndex(RequestIndexId index)
 {
     if (index == null)
     {
         throw new ArgumentNullException("index");
     }
     if (this.indexToUse == null)
     {
         this.indexToUse = index;
     }
 }
コード例 #3
0
 private void ValidateRequestIndexId(RequestIndexId requestIndexId)
 {
     if (requestIndexId == null)
     {
         throw new ArgumentNullException("requestIndexId");
     }
     if (requestIndexId.Location != RequestIndexLocation.Mailbox)
     {
         throw new ArgumentException("This RequestIndexEntryHandler only supports saving IRequestIndexEntries to a mailbox.", "requestIndexId");
     }
     if (requestIndexId.Mailbox == null)
     {
         throw new ArgumentException("The RequestIndexId supplied must specify a mailbox.", "requestIndexId");
     }
 }
コード例 #4
0
        public static void CreateAndPopulateRequestIndexEntries(RequestJobBase requestJobBase, IConfigurationSession session)
        {
            if (requestJobBase == null)
            {
                throw new ArgumentNullException("requestJobBase");
            }
            if (requestJobBase.IndexEntries == null)
            {
                requestJobBase.IndexEntries = new List <IRequestIndexEntry>();
            }
            if (requestJobBase.IndexIds == null)
            {
                requestJobBase.IndexIds = new List <RequestIndexId>();
            }
            RequestIndexId indexId = new RequestIndexId(RequestIndexLocation.AD);

            RequestIndexEntryProvider.Handle(indexId.RequestIndexEntryType, delegate(IRequestIndexEntryHandler handler)
            {
                IRequestIndexEntry item = handler.CreateRequestIndexEntryFromRequestJob(requestJobBase, session);
                requestJobBase.IndexIds.Add(indexId);
                requestJobBase.IndexEntries.Add(item);
            });
        }
コード例 #5
0
        public override T CreateRequestIndexEntryFromRequestJob(RequestJobBase requestJob, RequestIndexId requestIndexId)
        {
            ArgumentValidator.ThrowIfNull("requestJob", requestJob);
            ArgumentValidator.ThrowIfNull("requestJob.TargetUser", requestJob.TargetUser);
            ArgumentValidator.ThrowIfNull("requestJob.TargetExchangeGuid", requestJob.TargetExchangeGuid);
            ArgumentValidator.ThrowIfInvalidValue <RequestJobBase>("requestJob.RequestType", requestJob, (RequestJobBase x) => x.RequestType == MRSRequestType.Sync);
            T result = Activator.CreateInstance <T>();

            result.UpdateData(requestJob);
            return(result);
        }
コード例 #6
0
 public override MRSRequestMailboxEntry CreateRequestIndexEntryFromRequestJob(RequestJobBase requestJob, RequestIndexId requestIndexId)
 {
     ArgumentValidator.ThrowIfNull("requestJob", requestJob);
     return(new MRSRequestMailboxEntry
     {
         Type = requestJob.RequestType,
         Name = requestJob.Name,
         RequestGuid = requestJob.RequestGuid,
         Status = requestJob.Status,
         Flags = requestJob.Flags,
         RemoteHostName = requestJob.RemoteHostName,
         BatchName = requestJob.BatchName,
         SourceMDB = requestJob.SourceDatabase,
         TargetMDB = requestJob.TargetDatabase,
         StorageMDB = requestJob.WorkItemQueueMdb,
         FilePath = requestJob.FilePath,
         TargetUserId = requestJob.TargetUserId,
         SourceUserId = requestJob.SourceUserId,
         OrganizationId = requestJob.OrganizationId,
         RequestIndexId = requestIndexId
     });
 }
コード例 #7
0
        public override bool Equals(object obj)
        {
            RequestIndexId requestIndexId = obj as RequestIndexId;

            return(requestIndexId != null && this.Location == requestIndexId.Location && this.Mailbox == requestIndexId.Mailbox);
        }
コード例 #8
0
 IRequestIndexEntry IRequestIndexEntryHandler.CreateRequestIndexEntryFromRequestJob(RequestJobBase requestJob, RequestIndexId requestIndexId)
 {
     return(this.CreateRequestIndexEntryFromRequestJob(requestJob, requestIndexId));
 }
コード例 #9
0
 public virtual T CreateRequestIndexEntryFromRequestJob(RequestJobBase requestJob, RequestIndexId requestIndexId)
 {
     throw new NotSupportedException();
 }
コード例 #10
0
 public RequestIndexEntryObjectId(Guid requestGuid, Guid targetExchangeGuid, MRSRequestType requestType, OrganizationId organizationId, RequestIndexId indexId, RequestBase owner = null) : this(requestGuid, requestType, organizationId, indexId, owner)
 {
     this.TargetExchangeGuid = targetExchangeGuid;
 }
コード例 #11
0
 public RequestIndexEntryObjectId(Guid requestGuid, MRSRequestType requestType, OrganizationId organizationId, RequestIndexId indexId, RequestBase owner = null)
 {
     this.RequestGuid    = requestGuid;
     this.RequestType    = requestType;
     this.OrganizationId = organizationId;
     this.IndexId        = indexId;
     this.RequestObject  = owner;
 }
コード例 #12
0
 public static void CreateAndPopulateRequestIndexEntries(RequestJobBase requestJobBase, RequestIndexId requestIndexId)
 {
     if (requestJobBase == null)
     {
         throw new ArgumentNullException("requestJobBase");
     }
     if (requestJobBase.IndexEntries == null)
     {
         requestJobBase.IndexEntries = new List <IRequestIndexEntry>();
     }
     if (requestJobBase.IndexIds == null)
     {
         requestJobBase.IndexIds = new List <RequestIndexId>();
     }
     RequestIndexEntryProvider.Handle(requestIndexId.RequestIndexEntryType, delegate(IRequestIndexEntryHandler handler)
     {
         IRequestIndexEntry item = handler.CreateRequestIndexEntryFromRequestJob(requestJobBase, requestIndexId);
         requestJobBase.IndexIds.Add(requestIndexId);
         requestJobBase.IndexEntries.Add(item);
     });
 }
コード例 #13
0
 public RequestIndexEntryQueryFilter(string name, ADObjectId id, MRSRequestType type, RequestIndexId idx, bool mbxSearch)
 {
     this.requestName          = name;
     this.mailboxId            = (mbxSearch ? id : null);
     this.dbId                 = (mbxSearch ? null : id);
     this.looseMailboxSearch   = false;
     this.wildcardedNameSearch = false;
     this.requestType          = type;
     this.indexId              = idx;
     this.requestGuid          = Guid.Empty;
     this.requestQueueId       = null;
     this.batchName            = null;
     this.sourceMailbox        = null;
     this.targetMailbox        = null;
     this.sourceDatabase       = null;
     this.status               = RequestStatus.None;
     this.flags                = RequestFlags.None;
     this.notFlags             = RequestFlags.None;
 }