コード例 #1
0
 public override string Check(int tenantId)
 {
     try
     {
         log.Debug("CheckNotifyState");
         using (var notifyServiceClient = new NotifyServiceClient())
         {
             var userGuid = new Guid(fakeUserId);
             var user     = CoreContext.UserManager.GetUsers(userGuid);
             notifyServiceClient.SendNotifyMessage(new NotifyMessage
             {
                 To           = user.UserName,
                 Subject      = "Subject",
                 ContentType  = "ContentType",
                 Content      = "Content",
                 Sender       = Constants.NotifyMessengerSenderSysName,
                 CreationDate = DateTime.UtcNow
             });
         }
         log.Debug("Notify is OK!");
         return(string.Empty);
     }
     catch (Exception ex)
     {
         log.ErrorFormat("Notify is failed! {0} {1} {2}", ex.Message, ex.StackTrace,
                         ex.InnerException != null ? ex.InnerException.Message : string.Empty);
         return(HealthCheckResource.ServiceCheckFailed);
     }
 }
コード例 #2
0
 public NoticeSendResult Send(NotifyMessage m)
 {
     using (var notifyClient = new NotifyServiceClient())
     {
         notifyClient.SendNotifyMessage(m);
     }
     return NoticeSendResult.OK;
 }
コード例 #3
0
 public NoticeSendResult Send(NotifyMessage m)
 {
     using (var notifyClient = new NotifyServiceClient())
     {
         notifyClient.SendNotifyMessage(m);
     }
     return(NoticeSendResult.OK);
 }
コード例 #4
0
 private static void SendNotification(string method, int tenantId, params object[] args)
 {
     try
     {
         using (var notifyClient = new NotifyServiceClient())
         {
             notifyClient.InvokeSendMethod(NotifyService, method, tenantId, args);
         }
     }
     catch (Exception error)
     {
         LogManager.GetLogger("ASC.Backup").Warn("Error while sending notification", error);
     }
 }
コード例 #5
0
 private void SendStorageEncryptionNotification(string method, int tenantId)
 {
     try
     {
         using (var notifyClient = new NotifyServiceClient())
         {
             notifyClient.InvokeSendMethod(NotifyService, method, tenantId, ServerRootPath);
         }
     }
     catch (Exception error)
     {
         LogManager.GetLogger("ASC").Warn("Error while sending notification", error);
     }
 }
コード例 #6
0
 private static void SendNotification(string method, int tenantId, params object[] args)
 {
     try
     {
         using (var notifyClient = new NotifyServiceClient())
         {
             notifyClient.InvokeSendMethod(NotifyService, method, tenantId, args);
         }
     }
     catch (Exception error)
     {
         LogManager.GetLogger("ASC.Backup").Warn("Error while sending notification", error);
     }
 }
コード例 #7
0
        private void SendStorageEncryptionNotification(string method, int tenantId)
        {
            var notifyInvoke = new NotifyInvoke()
            {
                Service = NotifyService,
                Method  = method,
                Tenant  = tenantId
            };

            notifyInvoke.Parameters.Add(ServerRootPath);
            try
            {
                NotifyServiceClient.InvokeSendMethod(notifyInvoke);
            }
            catch (Exception error)
            {
                Log.Warn("Error while sending notification", error);
            }
        }
コード例 #8
0
 public NoticeSendResult Send(NotifyMessage m)
 {
     try
     {
         using (var notifyClient = new NotifyServiceClient())
         {
             notifyClient.SendNotifyMessage(m);
         }
         return(NoticeSendResult.OK);
     }
     catch (ReflectionTypeLoadException)
     {
         using (var notifyClient = new NotifyServiceClient())
         {
             notifyClient.SendNotifyMessage(m);
         }
         return(NoticeSendResult.OK);
     }
 }
コード例 #9
0
 public NoticeSendResult Send(NotifyMessage m)
 {
     try
     {
         using (var notifyClient = new NotifyServiceClient())
         {
             notifyClient.SendNotifyMessage(m);
         }
         return NoticeSendResult.OK;
     }
     catch (ReflectionTypeLoadException)
     {
         using (var notifyClient = new NotifyServiceClient())
         {
             notifyClient.SendNotifyMessage(m);
         }
         return NoticeSendResult.OK;
     }
 }
コード例 #10
0
 public NotifyHelper(IOptionsMonitor <ILog> option, NotifyServiceClient notifyServiceClient)
 {
     NotifyServiceClient = notifyServiceClient;
     Log = option.CurrentValue;
 }
コード例 #11
0
 public NotifyServiceSender(ICacheNotify <NotifyMessage> cacheNotify, ICacheNotify <NotifyInvoke> notifyInvoke)
 {
     NotifyServiceClient = new NotifyServiceClient(cacheNotify, notifyInvoke);
 }
コード例 #12
0
 public NotifyServiceSender(ICacheNotify <NotifyMessage> cacheNotify)
 {
     NotifyServiceClient = new NotifyServiceClient(cacheNotify);
 }
コード例 #13
0
 public NotifyServiceSender()
 {
     NotifyServiceClient = new NotifyServiceClient();
 }