public SendAddressDataProvider(ExchangePrincipal userPrincipal, string mailboxIdParameterString) { SyncUtilities.ThrowIfArgumentNull("userPrincipal", userPrincipal); SyncUtilities.ThrowIfArgumentNullOrEmpty("mailboxIdParameterString", mailboxIdParameterString); this.userPrincipal = userPrincipal; this.mailboxIdParameterString = mailboxIdParameterString; }
internal static void ValidateIncomingServerLength(string incomingServer, Task.TaskErrorLoggingDelegate taskErrorLoggingDelegate) { SyncUtilities.ThrowIfArgumentNullOrEmpty("incomingServer", incomingServer); SyncUtilities.ThrowIfArgumentNull("taskErrorLoggingDelegate", taskErrorLoggingDelegate); if (incomingServer.Length > SyncUtilities.MaximumFqdnLength) { taskErrorLoggingDelegate(new IncomingServerTooLongException(), ErrorCategory.InvalidArgument, null); } }
internal static void ValidateUnicodeInfoOnUserNameAndPassword(string userName, SecureString password, Task.TaskErrorLoggingDelegate taskErrorLoggingDelegate) { SyncUtilities.ThrowIfArgumentNullOrEmpty("userName", userName); SyncUtilities.ThrowIfArgumentNull("password", password); SyncUtilities.ThrowIfArgumentNull("taskErrorLoggingDelegate", taskErrorLoggingDelegate); if (SyncUtilities.HasUnicodeCharacters(userName) || (password.Length > 0 && SyncUtilities.HasUnicodeCharacters(password))) { taskErrorLoggingDelegate(new InvalidOperationException(Strings.InvalidUnicodeCharacterUsage), ErrorCategory.InvalidArgument, null); } }
internal static bool TryTestUserCache(string databaseServer, string primarySmtpAddress, SubscriptionCacheAction cacheAction, out string failureReason, out uint cacheActionResult, out List <SubscriptionCacheObject> cacheObjects, out ObjectState objectState) { SyncUtilities.ThrowIfArgumentNullOrEmpty("databaseServer", databaseServer); SyncUtilities.ThrowIfArgumentNullOrEmpty("primarySmtpAddress", primarySmtpAddress); failureReason = null; cacheActionResult = 268435456U; cacheObjects = null; objectState = ObjectState.Unchanged; byte[] testUserCacheInputBytes = SubscriptionCacheClient.GetTestUserCacheInputBytes(primarySmtpAddress, cacheAction); byte[] array = null; using (SubscriptionCacheRpcClient subscriptionCacheRpcClient = new SubscriptionCacheRpcClient(databaseServer)) { try { array = subscriptionCacheRpcClient.TestUserCache(0, testUserCacheInputBytes); } catch (RpcException exception) { failureReason = Strings.CacheRpcExceptionEncountered(exception); return(false); } } MdbefPropertyCollection args = MdbefPropertyCollection.Create(array, 0, array.Length); int num; if (!RpcHelper.TryGetProperty <int>(args, 2835349507U, out num)) { failureReason = Strings.CacheRpcInvalidServerVersionIssue(databaseServer); return(false); } cacheActionResult = (uint)num; RpcHelper.TryGetProperty <string>(args, 2835415071U, out failureReason); byte[] buffer; if (RpcHelper.TryGetProperty <byte[]>(args, 2835480834U, out buffer)) { using (MemoryStream memoryStream = new MemoryStream(buffer)) { cacheObjects = (List <SubscriptionCacheObject>)SubscriptionCacheClient.binaryFormatter.Deserialize(memoryStream); } } if (RpcHelper.TryGetProperty <int>(args, 2835546115U, out num)) { objectState = (ObjectState)num; } return(true); }
protected ConnectedAccountsNotificationManagerBase(Guid userMailboxGuid, Guid userMdbGuid, string userMailboxServerFQDN, IConnectedAccountsConfiguration configuration, ISyncNowNotificationClient notificationClient, Func <TimerCallback, object, TimeSpan, TimeSpan, IGuardedTimer> createGuardedTimer) { SyncUtilities.ThrowIfGuidEmpty("userMailboxGuid", userMailboxGuid); SyncUtilities.ThrowIfGuidEmpty("userMdbGuid", userMdbGuid); SyncUtilities.ThrowIfArgumentNullOrEmpty("userMailboxServerFQDN", userMailboxServerFQDN); SyncUtilities.ThrowIfArgumentNull("configuration", configuration); SyncUtilities.ThrowIfArgumentNull("notificationClient", notificationClient); SyncUtilities.ThrowIfArgumentNull("createGuardedTimer", createGuardedTimer); this.configuration = configuration; this.notificationClient = notificationClient; this.userMailboxGuid = userMailboxGuid; this.userMdbGuid = userMdbGuid; this.userMailboxServerFQDN = userMailboxServerFQDN; if (this.configuration.PeriodicSyncNowEnabled) { ExTraceGlobals.ConnectedAccountsTracer.TraceDebug <Guid, TimeSpan>((long)this.GetHashCode(), "ConnectedAccountsNotificationManager::Setting up periodicSyncNowTimer for User:{0}, PeriodicSyncNowInterval:{1}", this.userMdbGuid, this.configuration.PeriodicSyncNowInterval); this.periodicSyncNowTimer = createGuardedTimer(new TimerCallback(this.SendPeriodicSyncNowRequest), null, this.configuration.PeriodicSyncNowInterval, this.configuration.PeriodicSyncNowInterval); } }