public static SyncNotificationResult NotifyStatusChanges(string identity, string targetServerFqdn, Guid tenantId, string statusUpdateSvcUrl, bool syncNow, IList <UnifiedPolicyStatus> statusUpdates) { if (string.IsNullOrEmpty(identity)) { throw new ArgumentNullException("identity"); } if (tenantId == Guid.Empty) { throw new ArgumentNullException("tenantId"); } if (string.IsNullOrEmpty(statusUpdateSvcUrl)) { throw new ArgumentNullException("statusUpdateSvcUrl"); } if (statusUpdates == null || statusUpdates.Count == 0) { throw new ArgumentNullException("statusUpdates"); } RpcClientWrapper.InitializeIfNeeded(); NotificationType type = NotificationType.ApplicationStatus; if (!RpcClientWrapper.instance.initialized) { return(new SyncNotificationResult(new SyncAgentTransientException("RPC client not initialized"))); } SyncNotificationResult result; try { using (UnifiedPolicyNotificationRpcClient unifiedPolicyNotificationRpcClient = new UnifiedPolicyNotificationRpcClient(targetServerFqdn ?? RpcClientWrapper.instance.localServer.Fqdn)) { SyncStatusUpdateWorkitem syncStatusUpdateWorkitem = new SyncStatusUpdateWorkitem(identity, syncNow, new TenantContext(tenantId, null), statusUpdates, statusUpdateSvcUrl, 0); byte[] data = unifiedPolicyNotificationRpcClient.Notify(1, (int)type, syncStatusUpdateWorkitem.Serialize()); NotificationRpcOutParameters notificationRpcOutParameters = new NotificationRpcOutParameters(data); result = notificationRpcOutParameters.Result; } } catch (RpcException ex) { result = new SyncNotificationResult(new SyncAgentTransientException(ex.Message, ex)); } return(result); }
public UnifiedPolicyStatusNotification(SyncStatusUpdateWorkitem workItem, ADObjectId mailboxOwnerId) : base(workItem, mailboxOwnerId) { }