Пример #1
0
        void transport_MessageResponseReceived(BlackberryMessageTransportResponse response)
        {
            var notification = response.Message;

            var singleResultNotification = BlackberryNotification.ForSingleRegistrationId(notification, notification.PushPin);

            if (response.ResponseCode == BlackberryMessageTransportResponseCode.Accepted ||
                response.ResponseCode == BlackberryMessageTransportResponseCode.OK)
            {
                //It worked! Raise success
                this.Events.RaiseNotificationSent(singleResultNotification);
            }
            else if (response.ResponseCode == BlackberryMessageTransportResponseCode.ServiceUnavailable)
            {
                this.QueueNotification(singleResultNotification);
            }
            else if (response.ResponseCode == BlackberryMessageTransportResponseCode.RimPushIdNotFound)
            {
                //Raise failure and device expired
                this.Events.RaiseDeviceSubscriptionExpired(PlatformType.Blackberry, singleResultNotification.PushPin, singleResultNotification);
            }
            else
            {
                //Raise failure, for unknown reason
                this.Events.RaiseNotificationSendFailure(singleResultNotification, new BlackberryMessageTransportException(response.ResponseCode.ToString(), response));
            }

            Interlocked.Decrement(ref waitCounter);
        }
Пример #2
0
 public BlackberryAuthenticationErrorTransportException(BlackberryMessageTransportResponse response)
     : base("Authentication Failed", response)
 {
 }
Пример #3
0
 public BlackberryMessageTransportException(string message, BlackberryMessageTransportResponse response)
     : base(message)
 {
     this.Response = response;
 }
Пример #4
0
 public BlackberryServiceUnavailableTransportException(TimeSpan retryAfter, BlackberryMessageTransportResponse response)
     : base("Service Temporarily Unavailable.  Please wait the retryAfter amount and implement an Exponential Backoff", response)
 {
     this.RetryAfter = retryAfter;
 }
Пример #5
0
 public BlackberryBadRequestTransportException(BlackberryMessageTransportResponse response)
     : base("Bad Request", response)
 {
 }