public IEnumerable<MessageWrapper> GetMessageByFilter(int projectid, int tag, Guid departament, Guid participant,
                                                              ApiDateTime createdStart, ApiDateTime createdStop, int lastId,
                                                              bool myProjects, bool follow, MessageStatus? status)
        {
            var messageEngine = EngineFactory.GetMessageEngine();
            var taskFilter = new TaskFilter
            {
                DepartmentId = departament,
                UserId = participant,
                FromDate = createdStart,
                ToDate = createdStop,
                SortBy = _context.SortBy,
                SortOrder = !_context.SortDescending,
                SearchText = _context.FilterValue,
                TagId = tag,
                Offset = _context.StartIndex,
                Max = _context.Count,
                MyProjects = myProjects,
                LastId = lastId,
                Follow = follow,
                MessageStatus = status
            };

            if (projectid != 0)
                taskFilter.ProjectIds.Add(projectid);

            _context.SetDataPaginated();
            _context.SetDataFiltered();
            _context.SetDataSorted();
            _context.TotalCount = messageEngine.GetByFilterCount(taskFilter);

            return messageEngine.GetByFilter(taskFilter).NotFoundIfNull().Select(r => new MessageWrapper(r)).ToSmartList();
        }
 public MessageEventArgs(string message, int queuedMessageCount, MessageStatus status, string error)
 {
     _message = message;
     _queuedMessageCount = queuedMessageCount;
     _status = status;
     _error = error;
 }
 /// <summary>Initializes a new instance of the <see cref="TextMessage"/> class.</summary>
 /// <param name="_message">The message.</param>
 /// <param name="fromNumber">The number.</param>
 /// <param name="toNumber"></param>
 /// <param name="_dateTime">The date time.</param>
 /// <param name="_sentOrRecieved">The sent or recieved status.</param>
 /// <param name="_filePath">Path of the file.</param>
 public TextMessage(MessageFormat format, string _message, string fromNumber, string toNumber, DateTime _dateTime, MessageStatus _sentOrRecieved, string _filePath)
     : base(_message, fromNumber, toNumber, _dateTime)
 {
     Format = format;
     sentOrRecieved = _sentOrRecieved;
     filePath = _filePath;
 }
        public static void ErrorFsctlrvRequestResumeKeyResponse(int messageId, MessageStatus messageStatus)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue((messageStatus == MessageStatus.NetworkSessionExpired)
                                || (messageStatus == MessageStatus.NotSupported));
            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.FsctlSrvRequestResumeKey);
            FsctlSrvResumeKeyRequest request = (FsctlSrvResumeKeyRequest)smbConnection.sentRequest[messageId];

            if (messageStatus == MessageStatus.NetworkSessionExpired)
            {
                smbConnection.sessionList.Remove(request.sessionId);
                smbState = SmbState.Closed;
            }
            else if (messageStatus == MessageStatus.NotSupported)
            {
                // As input paramter is valid, that the SUT still reuturn error code indicates that the SUT does not
                // support this operation.
                if (!Parameter.isSupportResumeKey)
                {
                    ModelHelper.CaptureRequirement(
                        30023,
                        @"[In Receiving an FSCTL_SRV_REQUEST_RESUME_KEY Function Code] If this operation [Receiving an
                        FSCTL_SRV_REQUEST_RESUME_KEY Function Code] is successful, then the server MUST construct an
                        FSCTL_SRV_CHOPYCHUNK response as specified in section 2.2.7.2.2, with the following additional
                        requirements: If the server does not support this operation [Receiving an
                        FSCTL_SRV_REQUEST_RESUME_KEY Function Code], then it MUST fail the request with
                        STATUS_NOT_SUPPORTED.");
                }
                smbState = SmbState.End;
            }
            smbConnection.sentRequest.Remove(messageId);
        }
 public MessageErrorInfo(MessageStatus status)
 {
     _statusSpecified = true;
     Status = status;
     Image = GetImage();
     Description = status.GetDescription();
 }
Beispiel #6
0
		public void Process(MessageQueue msgQueue)
		{
			if (IsValid)
			{
				vStatus = MessageStatus.Processing;
				vProcessor(msgQueue, this);
			}
		}
        public void RemoveFlag_ShouldRemoveSingleFlag()
        {
            _status = _status.RemoveFlag(MessageStatus.New);

            Assert.That(_status.HasFlag(MessageStatus.New), Is.False);
            Assert.That(_status.HasFlag(MessageStatus.Sent), Is.False);
            Assert.That(_status.HasFlag(MessageStatus.Received), Is.False);
        }
        public void RemoveFlag_ShouldChainMultipleFlags()
        {
            _status = _status.AddFlag(MessageStatus.Sent).AddFlag(MessageStatus.Received).RemoveFlag(MessageStatus.New);

            Assert.That(_status.HasFlag(MessageStatus.New), Is.False);
            Assert.That(_status.HasFlag(MessageStatus.Sent), Is.True);
            Assert.That(_status.HasFlag(MessageStatus.Received), Is.True);
        }
        public void AddFlag_ShouldAddSingleFlag()
        {
            _status = _status.AddFlag(MessageStatus.Sent);

            Assert.That(_status.HasFlag(MessageStatus.New), Is.True);
            Assert.That(_status.HasFlag(MessageStatus.Sent), Is.True);
            Assert.That(_status.HasFlag(MessageStatus.Received), Is.False);
        }
Beispiel #10
0
        /// <summary>
        /// Retrieve a list of messages by status and type
        /// </summary>
        /// <param name="status"></param>
        /// <param name="type"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public Paginator<Message> FindPagedMessagesBySiteAndStatusAndType(Site site, MessageStatus status, MessageType type, string orderBy, bool orderAscending, int pageSize)
        {
            DetachedCriteria criteria = DetachedCriteria.For<Message>()
                                       .AddOrder(new Order(orderBy, orderAscending))
                                       .Add(Restrictions.Eq("Site", site));

             return Repository<Message>.GetPaginator(criteria, pageSize);
        }
        public void AddFlag_ShouldChainMultipleFlags()
        {
            status = status.AddFlag(MessageStatus.Sent).AddFlag(MessageStatus.Received);

            Assert.That(status.HasFlag(MessageStatus.New), Is.True);
            Assert.That(status.HasFlag(MessageStatus.Sent), Is.True);
            Assert.That(status.HasFlag(MessageStatus.Received), Is.True);
        }
        public static void ErrorFindFirst2Response(int messageId, MessageStatus messageStatus)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue(messageStatus == MessageStatus.NetworkSessionExpired
                                || messageStatus == MessageStatus.NotSupported
                                || messageStatus == MessageStatus.ObjectNameNotFound
                                || messageStatus == MessageStatus.InvalidParameter);

            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.TransFindFirst2);
            Trans2FindFirst2Request request = (Trans2FindFirst2Request)smbConnection.sentRequest[messageId];
            switch (messageStatus)
            {
                case MessageStatus.NotSupported:
                    Condition.IsTrue(Parameter.sutPlatform == Platform.NonWindows);
                    Condition.IsTrue(request.gmtTokenIndex != -1);

                    if (request.informationLevel == InformationLevel.SmbFindFileIdBothDirectoryInfo
                            || request.informationLevel == InformationLevel.SmbFindFileIdFullDirectoryInfo)
                    {
                        ModelHelper.CaptureRequirement(
                            4898,
                            "[In Receiving a TRANS2_FIND_FIRST2 Request New Information Levels]If the server does not " +
                            "support the new Information Levels, then it MUST fail the operation with " +
                            "STATUS_NOT_SUPPORTED.<124>");
                    }
                    smbState = SmbState.End;
                    break;
                case MessageStatus.ObjectNameNotFound:
                    if (request.informationLevel == InformationLevel.SmbFindFileIdBothDirectoryInfo
                            || request.informationLevel == InformationLevel.SmbFindFileIdFullDirectoryInfo)
                    {
                        Condition.IsTrue(Parameter.sutPlatform != Platform.NonWindows);
                    }
                    Condition.IsTrue(request.gmtTokenIndex == -1);
                    Condition.IsTrue(request.isFlagsKnowsLongNameSet);
                    smbState = SmbState.End;
                    break;
                case MessageStatus.NetworkSessionExpired:
                    smbConnection.sessionList.Remove(request.sessionId);
                    smbState = SmbState.Closed;
                    break;
                case MessageStatus.InvalidParameter:
                    if (!request.isFlagsKnowsLongNameSet
                            && request.informationLevel != InformationLevel.SmbInfoStandard)
                    {
                        ModelHelper.CaptureRequirement(
                            9280,
                            @"[In Client Request Extensions] InformationLevel (2 bytes): If a client that has not
                            negotiated long names support requests an InformationLevel other than SMB_INFO_STANDARD,
                            then the server MUST return a status of STATUS_INVALID_PARAMETER(ERRDOS/ERRinvalidparam).");
                    }
                    smbState = SmbState.End;
                    break;
                default:
                    break;
            }
            smbConnection.sentRequest.Remove(messageId);
        }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="fullPath">Full path to the file</param>
 /// <param name="status">Current status of this data message</param>
 public ClientDataMessage(string fullPath, MessageStatus status)
 {
     this.FullPath = fullPath;
     if (!string.IsNullOrEmpty(this.FullPath))
     {
         this.Name = Path.GetFileName(this.FullPath);
     }
     this.MessageStatus = status;
 }
        /// <summary>
        /// Verify file standard information 
        /// </summary>
        /// <param name="info">An instance of FileStandardInformation</param>
        /// <param name="status">An instance of MessageStatus</param>
        private void VerifyFileStandardInformation(FileStandardInformation info, MessageStatus status)
        {
            if (this.fileSystem == FileSystem.NTFS)
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSA_R46036 Actual FileSystem: {0}", fileSystem);

                //
                // Verify MS-FSA requirement: MS-FSA_R46036
                //
                Site.CaptureRequirementIfAreEqual <MessageStatus>(
                    MessageStatus.SUCCESS,
                    status,
                    46036,
                    @"[In FileStandardInformation] <58> Section 3.1.5.11.27: This algorithm is implemented by NTFS. ");
            }

            if (this.fileSystem == FileSystem.FAT
                || this.fileSystem == FileSystem.EXFAT
                || this.fileSystem == FileSystem.CDFS
                || this.fileSystem == FileSystem.UDFS)
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSA_R4637");

                //
                // Verify MS-FSA requirement: MS-FSA_R4637
                //
                Site.CaptureRequirementIfAreEqual<uint>(
                    1,
                    info.NumberOfLinks,
                    4637,
                    @"[In FileStandardInformation] <58> Section 3.1.5.11.27:The FAT, EXFAT, CDFS, and UDFS file systems always return 1.");
            }

            if (info.NumberOfLinks == 0)
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSA_R2746");

                //
                // Verify MS-FSA requirement: MS-FSA_R2746
                //
                Site.CaptureRequirementIfAreEqual<byte>(
                    1,
                    info.DeletePending,
                    2746,
                    @"[In FileStandardInformation,Pseudocode for the operation is as follows:]If alignmentInfo.NumberOfLinks is 0,
                    set alignmentInfo.DeletePending to 1.");
            }
        }
Beispiel #15
0
 public BMessage(MessageStatus status, string type, string folder, VCard sender, string charset, int length, string body)
 {
     Status  = status;
     Type    = type ?? throw new ArgumentNullException(nameof(type));
     Folder  = folder ?? throw new ArgumentNullException(nameof(folder));
     Sender  = sender ?? throw new ArgumentNullException(nameof(sender));
     Charset = charset ?? throw new ArgumentNullException(nameof(charset));
     Length  = length;
     Body    = body ?? throw new ArgumentNullException(nameof(body));
 }
        public LoginForm()
        {
            InitializeComponent();
            _materialSkinManager = DesignSettings.GetDesign();
            _materialSkinManager.AddFormToManage(this);

            UserSession.ParentForm.Hide();
            _userRepository = new UserRepository();
            _messageStatus  = new MessageStatus();
        }
 /// <summary>
 /// To check if current transport supports Integrity.
 /// </summary>
 /// <param name="status">NTStatus code to compare with expected status.</param>
 /// <returns>Return True if supported, False if not supported.</returns>
 private bool IsCurrentTransportSupportIntegrity(MessageStatus status)
 {
     if (this.fsaAdapter.Transport == Transport.SMB)
     {
         this.fsaAdapter.AssertAreEqual(this.Manager, MessageStatus.NOT_SUPPORTED, status,
             "This operation is not supported for SMB transport.");
         return false;
     }
     return true;
 }
Beispiel #18
0
        internal void Reset()
        {
            Dead     = false;
            Recycled = false;
            State    = ConnectionState.Disconnected;
            Socket   = null;
            EndPoint = null;

            HailStatus = new MessageStatus();

            MTUStatus = new MessageStatus();

            ConnectionChallenge = 0;
            ChallengeDifficulty = 0;
            ChallengeAnswer     = 0;

            LastMessageOut    = DateTime.MinValue;
            LastMessageIn     = DateTime.MinValue;
            ConnectionStarted = DateTime.MinValue;

            SmoothRoundtrip          = 0;
            Roundtrip                = 500;
            LowestRoundtrip          = 500;
            RoundtripVarience        = 0;
            HighestRoundtripVarience = 0;

            MTU = 0;

            HandshakeLastSendTime   = DateTime.MinValue;
            HandshakeResendAttempts = 0;

            HeartbeatChannel.Reset();
            Merger.Clear();

            PreConnectionChallengeTimestamp = 0;
            PreConnectionChallengeCounter   = 0;
            PreConnectionChallengeIV        = 0;

            OutgoingPackets     = 0;
            OutgoingWirePackets = 0;
            OutgoingUserBytes   = 0;
            OutgoingTotalBytes  = 0;

            OutgoingResentPackets    = 0;
            OutgoingConfirmedPackets = 0;

            IncomingPackets     = 0;
            IncomingWirePackets = 0;
            IncomingUserBytes   = 0;
            IncomingTotalBytes  = 0;

            IncomingDuplicatePackets    = 0;
            IncomingDuplicateTotalBytes = 0;
            IncomingDuplicateUserBytes  = 0;
        }
Beispiel #19
0
        public override Task <SendMessageResponse> SendNews(SendNewsRequest request, ServerCallContext context)
        {
            var isWxApp       = _redis.KeyExists(CacheKey.UserIsWxAppPrefix + request.AppId);
            var targets       = _processTarget(request.Targets);
            var messageStatus = new MessageStatus(_redis);

            messageStatus.GenMessageId();
            var now  = Util.GetTimestamp();
            var resp = new SendMessageResponse
            {
                MessageId = messageStatus.GetMessageId(),
                SendTime  = request.Time == 0 ? now : request.Time
            };

            if (request.NoStatus)
            {
                resp.MessageId = string.Empty;
                messageStatus.SetMessageId(null);
            }
            else
            {
                messageStatus.Create(targets.Keys.ToArray(), resp.SendTime);
            }
            foreach (var item in targets)
            {
                var tmpTitle       = _processValue(item.Value, request.Title);
                var tmpDescription = _processValue(item.Value, request.Description);
                var tmpLink        = _processValue(item.Value, request.Link);
                if (request.Time == 0)
                {
                    if (request.HighPriority)
                    {
                        BackgroundJob.Enqueue <SendMessage>(x => x.HighPriorityNews(messageStatus.GetMessageId(), request.AppId, item.Key, tmpTitle, tmpDescription, tmpLink, request.Image, isWxApp, null));
                    }
                    else
                    {
                        BackgroundJob.Enqueue <SendMessage>(x => x.News(messageStatus.GetMessageId(), request.AppId, item.Key, tmpTitle, tmpDescription, tmpLink, request.Image, isWxApp, null));
                    }
                }
                else
                {
                    var tmpJobId = string.Empty;
                    if (request.HighPriority)
                    {
                        tmpJobId = BackgroundJob.Schedule <SendMessage>(x => x.HighPriorityNews(messageStatus.GetMessageId(), request.AppId, item.Key, tmpTitle, tmpDescription, tmpLink, request.Image, isWxApp, null), TimeSpan.FromSeconds(request.Time - now));
                    }
                    else
                    {
                        tmpJobId = BackgroundJob.Schedule <SendMessage>(x => x.News(messageStatus.GetMessageId(), request.AppId, item.Key, tmpTitle, tmpDescription, tmpLink, request.Image, isWxApp, null), TimeSpan.FromSeconds(request.Time - now));
                    }
                    messageStatus.AddJobId(tmpJobId);
                }
            }
            return(Task.FromResult(resp));
        }
Beispiel #20
0
        /// <summary>
        /// Sends sms through primary sms service i.e Nexmo SMS Gateway.
        /// </summary>
        /// <param name="phoneNumber">A string containing the receiving phone number.</param>
        /// <param name="messageBody">A string containing the message body text.</param>
        /// <param name="enableBackupServiceSupport">A bool specifies whether backup service support is enabled or not.</param>
        public static void SendThroughPrimaryApi(string phoneNumber, string messageBody, bool enableBackupServiceSupport = false)
        {
            if (_nexmoApiKey == null)
            {
                _nexmoApiKey = ConfigurationManager.AppSettings[NeeoConstants.NexmoApiKey].ToString();
            }

            if (_nexmoApiSecret == null)
            {
                _nexmoApiSecret = ConfigurationManager.AppSettings[NeeoConstants.NexmoApiSecret].ToString();
            }

            NexmoClient   nexmoClient   = new NexmoClient(_nexmoApiKey, _nexmoApiSecret);
            NexmoResponse smsResponse   = nexmoClient.SendMessage(phoneNumber, NeeoConstants.AppName, messageBody);
            MessageStatus messageStatus = (MessageStatus)Convert.ToUInt16(smsResponse.Messages[0].Status);

            switch (messageStatus)
            {
            case MessageStatus.InvalidMessage:
                LogManager.CurrentInstance.ErrorLogger.LogError(
                    System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "Nexmo - Phone # : " + phoneNumber + " Status : " + messageStatus.ToString() + ", Description : " + NexmoDictionaries.MessageStatusDescriptionDictionary[(short)messageStatus]);
                if (enableBackupServiceSupport)
                {
                    SendThroughSecondaryApi(phoneNumber, messageBody);
                }
                else
                {
                    throw new ApplicationException(CustomHttpStatusCode.InvalidNumber.ToString("D"));
                }
                break;

            case MessageStatus.Throttled:
            case MessageStatus.MissingParams:
            case MessageStatus.InvalidParams:
            case MessageStatus.InvalidCredentials:
            case MessageStatus.InternalError:
            case MessageStatus.NumberBarred:
            case MessageStatus.PartnerAccountBarred:
            case MessageStatus.PartnerQuotaExceeded:
            case MessageStatus.CommunicationFailed:
            case MessageStatus.InvalidSignature:
            case MessageStatus.InvalidSenderAddress:
                LogManager.CurrentInstance.ErrorLogger.LogError(
                    System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "Nexmo - Phone # : " + phoneNumber + " Status : " + messageStatus.ToString() + ", Description : " + NexmoDictionaries.MessageStatusDescriptionDictionary[(short)messageStatus]);
                if (enableBackupServiceSupport)
                {
                    SendThroughSecondaryApi(phoneNumber, messageBody);
                }
                else
                {
                    throw new ApplicationException(CustomHttpStatusCode.SmsApiException.ToString("D"));
                }
                break;
            }
        }
        public ContactListForm()
        {
            InitializeComponent();
            _materialSkinManager = DesignSettings.GetDesign();
            _materialSkinManager.AddFormToManage(this);

            UserSession.ParentForm.Hide();
            _contactRepository             = new ContactRepository();
            _messageStatus                 = new MessageStatus();
            ContactsListView.HideSelection = true;
        }
Beispiel #22
0
        public ActionResult Edit([Bind(Include = "Id,StatusValue,Description,ActiveStatus,CreatedBy,CreatedAt,UpdatedAt")] MessageStatus messagestatus)
        {
            if (ModelState.IsValid)
            {
                db.Entry(messagestatus).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
//            ViewBag.CreatedBy = new SelectList(db.IdentityUsers, "Id", "UserName", messagestatus.CreatedBy);
            return(View(messagestatus));
        }
Beispiel #23
0
        public static HttpResponseMessage GenerateResponseMessage(MessageStatus messageStatus)
        {
            var gatewayResponse = new SmsGatewayResponse {
                MessageStatus = new[] { messageStatus }
            };
            var responseMessage = new HttpResponseMessage {
                Content = new StringContent(JsonConvert.SerializeObject(gatewayResponse))
            };

            return(responseMessage);
        }
 /// <summary>
 /// Print client or server acks if they exist
 /// </summary>
 public void PrintAck(MessageStatus messageStatus)
 {
     if (messageStatus.DeliveredTo == DeliveredTo.Server)
     {
         Console.WriteLine($"Your message to {messageStatus.RecipientId} was sent: { messageStatus.Content}{Environment.NewLine}");
     }
     else if (messageStatus.DeliveredTo == DeliveredTo.Recipient)
     {
         Console.WriteLine($"Your message to {messageStatus.RecipientId} was read: {messageStatus.Content}{Environment.NewLine}");
     }
 }
Beispiel #25
0
 /// <summary>
 /// Validates the Message Status property
 /// </summary>
 /// <param name="_MessageStatus"></param>
 public static ValidationResult MessageStatusValidator(MessageStatus _MessageStatus)
 {
     if (_MessageStatus != MessageStatus.Not_Specified)
     {
         return(ValidationResult.Success);
     }
     else
     {
         return(new ValidationResult("Message status is required"));
     }
 }
Beispiel #26
0
        private void WriteDataToFile(string fileName)
        {
            long          byteSize = (uint)2 * 1024 * this.fsaAdapter.ClusterSizeInKB;
            MessageStatus status   = this.fsaAdapter.WriteFile(0, byteSize, out _);

            this.fsaAdapter.AssertAreEqual(this.Manager, MessageStatus.SUCCESS, status,
                                           "Write data to file should succeed");

            this.fsaAdapter.CloseOpen();
            OpenFile(FileType.DataFile, fileName);
        }
Beispiel #27
0
        public void whenBuildingMessageStatusWithUnknownAPIValueThenUNRECOGNIZEDMessageStatusIsReturned()
        {
            string expectedSDKValue = "UNRECOGNIZED";


            MessageStatus classUnderTest = MessageStatus.valueOf("ThisMessageStatusDoesNotExistINSDK");
            String        actualSDKValue = classUnderTest.getSdkValue();


            Assert.AreEqual(expectedSDKValue, actualSDKValue);
        }
Beispiel #28
0
 public void TestMessageStatus()
 {
     foreach (MessageStatus messageStatus in MessageStatus.Values())
     {
         Assert.IsNotNull(messageStatus.ToString());
         Assert.IsNotEmpty(messageStatus.ToString());
     }
     Assert.AreEqual(0, (int)MessageStatus.NEW);
     Assert.AreEqual("READ", (string)MessageStatus.READ);
     Assert.AreEqual("TRASHED", MessageStatus.TRASHED.GetName());
 }
Beispiel #29
0
        public void whenBuildingMessageStatusWithAPIValueTRASHEDThenTRASHEDMessageStatusIsReturned()
        {
            string expectedSDKValue = "TRASHED";


            MessageStatus classUnderTest = MessageStatus.valueOf("TRASHED");
            String        actualSDKValue = classUnderTest.getSdkValue();


            Assert.AreEqual(expectedSDKValue, actualSDKValue);
        }
 /// <summary>
 /// Changes the status of a message in a thread-safe way
 /// </summary>
 /// <param name="msgId">The identifier of the message to update</param>
 /// <param name="status">The new status of a message</param>
 private void UpdateMessageStatus(decimal msgId, MessageStatus status)
 {
     lock (_msgStatus)
     {
         MessageData msg = _msgStatus[msgId];
         if (msg != null)
         {
             msg.Status = status;
         }
     }
 }
 internal static void TrapCallstackWithConfiguredSubstring(MessageStatus messageStatus, string substringOfCallstackToTrap)
 {
     if (!string.IsNullOrEmpty(substringOfCallstackToTrap))
     {
         string text = messageStatus.Exception.ToString();
         if (0 <= text.IndexOf(substringOfCallstackToTrap))
         {
             StoreDriverDeliveryDiagnostics.exceptionCallstackTrappedBySubstring = text;
         }
     }
 }
Beispiel #32
0
        public void SetUp()
        {
            Backendless.InitApp(Defaults.TEST_APP_ID, Defaults.TEST_SECRET_KEY);

            messageStatus = null;
            latch         = null;
            message       = null;
            publisher     = null;
            headers       = null;
            testResult    = null;
        }
        public ViewMessage Create(MessageStatus status, string messageName)
        {
            switch (status)
            {
            case MessageStatus.ERROR: return(CreateErrorMessage(messageName));

            case MessageStatus.SUCCESS: return(CreateSucessMessage(messageName));

            default: return(this.CreateDefaultMessage());
            }
        }
Beispiel #34
0
        public MessageStatus GetMessageStatus(string messageId)
        {
            if (messageId == null)
            {
                throw new ArgumentNullException(ExceptionMessage.NULL_MESSAGE_ID);
            }
            MessageStatus messageStatus =
                Invoker.InvokeSync <MessageStatus>(MESSAGING_MANAGER_SERVER_ALIAS, "getMessageStatus",
                                                   new object[] { messageId });

            return(messageStatus);
        }
Beispiel #35
0
 public Message(MessageStatus messageStatus, string room, string language, string forLastName, string forFirstName,
                string fromLastName, string fromFirtName, DateTime Date, string description)
 {
     this.Room          = room;
     this.Language      = language;
     this.ForFirstName  = forFirstName;
     this.ForLastName   = forLastName;
     this.FromFirstName = fromFirtName;
     this.FromLastName  = fromLastName;
     this.Description   = description;
     this.MessageStatus = messageStatus;
 }
Beispiel #36
0
 public static ConsoleColor GetStatusColor(MessageStatus status)
 {
     return(status switch
     {
         MessageStatus.Default => defaultStatusColor,
         MessageStatus.Success => successStatusColor,
         MessageStatus.Error => errorStatusColor,
         MessageStatus.Warning => warningStatusColor,
         MessageStatus.Info => infoStatusColor,
         MessageStatus.Question => questionStatusColor,
         _ => defaultStatusColor
     });
 internal static MessageStatus WorkaroundChangeNotificationForDir(bool allEntriesFitBufSize, MessageStatus returnedStatus, ITestSite site)
 {
     if (!allEntriesFitBufSize)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(1399, MessageStatus.NOTIFY_ENUM_DIR, returnedStatus, site);
     }
     else if (allEntriesFitBufSize)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(1399, MessageStatus.SUCCESS, returnedStatus, site);
     }
     return returnedStatus;
 }
Beispiel #38
0
 /// <remarks/>
 public void GetSearchMessagesAsync(int messageId, MessageStatus messageStatus, MessageType messageType, object userState)
 {
     if ((this.GetSearchMessagesOperationCompleted == null))
     {
         this.GetSearchMessagesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSearchMessagesOperationCompleted);
     }
     this.InvokeAsync("GetSearchMessages", new object[] {
         messageId,
         messageStatus,
         messageType
     }, this.GetSearchMessagesOperationCompleted, userState);
 }
 internal ChatMessage(string senderId, string sender, string text, MessageStatus status)
 {
     if (sender == null || senderId == null)
     {
         throw new System.ArgumentException("The senderId and sender values cannot be null.");
     }
     this.senderId    = senderId;
     this.senderAlias = sender;
     this.text        = text;
     this.id          = UUID.randomUUID();
     this.status      = status;
 }
Beispiel #40
0
	    public Message(Guid messageToken, Guid messageId, DateTime date, long receiverId, long senderId, string text, byte[] thumbnail, MessageStatus status, MessageType type = MessageType.Text)
	    {
	        Recipient = receiverId;
	        Sender = senderId;
	        Text = text;
	        Thumbnail = thumbnail;
            MessageId = messageId;
			MessageToken = messageToken;
	        Date = date;
	        Type = type;
	        Status = status;
	    }
Beispiel #41
0
        public JsonResponse(MessageStatus status, string message, T content = null)
        {
            var response = new
            {
                Status  = status,
                Message = message,
                Data    = content
            };

            Content     = JsonConvert.SerializeObject(response);
            ContentType = "application/json";
        }
		internal ChatMessage(string senderId, string sender, string text, MessageStatus status)
		{
			if (sender == null || senderId == null)
			{
				throw new System.ArgumentException("The senderId and sender values cannot be null.");
			}
			this.senderId = senderId;
			this.senderAlias = sender;
			this.text = text;
			this.id = UUID.randomUUID();
			this.status = status;
		}
Beispiel #43
0
 public Message(Guid messageToken, Guid messageId, DateTime date, long receiverId, long senderId, string text, byte[] thumbnail, MessageStatus status, MessageType type = MessageType.Text)
 {
     Recipient    = receiverId;
     Sender       = senderId;
     Text         = text;
     Thumbnail    = thumbnail;
     MessageId    = messageId;
     MessageToken = messageToken;
     Date         = date;
     Type         = type;
     Status       = status;
 }
Beispiel #44
0
        private void OpenFile(FileType fileType, string fileName)
        {
            MessageStatus status = this.fsaAdapter.CreateFile(
                fileName,
                FileAttribute.NORMAL,
                fileType == FileType.DataFile ? CreateOptions.NON_DIRECTORY_FILE : CreateOptions.DIRECTORY_FILE,
                FileAccess.GENERIC_READ | FileAccess.GENERIC_WRITE | FileAccess.FILE_WRITE_DATA | FileAccess.FILE_WRITE_ATTRIBUTES,
                ShareAccess.FILE_SHARE_READ | ShareAccess.FILE_SHARE_WRITE,
                CreateDisposition.OPEN);

            BaseTestSite.Assert.AreEqual(MessageStatus.SUCCESS, status, "Open should succeed.");
        }
Beispiel #45
0
 public Message(int senderId, int recieverId, DataType dataType, DateTime localTime, string data, MessageStatus status = MessageStatus.SendingInProgress, List <string> attachments = null, int id = 0)
 {
     Id = id;
     AttachmentsList      = attachments;
     SenderId             = senderId;
     ReceiverId           = recieverId;
     DataType             = dataType;
     LocalDate            = localTime;
     LocalLastTimeUpdated = localTime;
     Status = status;
     Data   = data;
 }
Beispiel #46
0
        internal void HandleMTUResponse(uint size)
        {
            _stateLock.EnterReadLock();

            try
            {
                if (State == ConnectionState.Connected)
                {
                    // Calculate the new MTU
                    int attemptedMtu = (int)(MTU * Config.MTUGrowthFactor);

                    if (attemptedMtu > Config.MaximumMTU)
                    {
                        attemptedMtu = Config.MaximumMTU;
                    }

                    if (attemptedMtu < Config.MinimumMTU)
                    {
                        attemptedMtu = Config.MinimumMTU;
                    }

                    if (attemptedMtu == size)
                    {
                        // This is a valid response

                        if (Merger != null)
                        {
                            Merger.ExpandToSize((int)attemptedMtu);
                        }

                        // Set new MTU
                        MTU = (ushort)attemptedMtu;

                        // Set new status
                        MTUStatus = new MessageStatus()
                        {
                            Attempts    = 0,
                            HasAcked    = false,
                            LastAttempt = NetTime.MinValue
                        };

                        if (Logging.CurrentLogLevel <= LogLevel.Debug)
                        {
                            Logging.LogInfo("Client " + EndPoint + " MTU was increased to " + MTU);
                        }
                    }
                }
            }
            finally
            {
                _stateLock.ExitReadLock();
            }
        }
Beispiel #47
0
        /// <summary>
        /// Extract MessageStatus from web response
        /// </summary>
        /// <param name="response"></param>
        /// <returns></returns>
        /// <example>Raw response - ID: 7cc7f93f441819406a6c839564eb89f7 Status: 001</example>
        private static MessageStatus GetMessageStatusFromResponse(string response)
        {
            var messageStatus = new MessageStatus();

            if (response.Contains("ID:") && response.Contains("Status:"))
            {
                messageStatus.APIMessageID = response.Substring(response.IndexOf(":") + 1, response.LastIndexOf("Status:") - (response.IndexOf(":") + 1)).Trim();
                messageStatus.Status       = response.Substring(response.LastIndexOf(":") + 1, response.Length - (response.LastIndexOf(":") + 1)).Trim();
                messageStatus.Description  = GetStatusCodeDescription(messageStatus.Status);
            }
            return(messageStatus);
        }
Beispiel #48
0
 private void updateMessageStatus(TaskMessage msg, MessageStatus status)
 {
     using (var entity = new messageEntities())
     {
         var m = entity.mq_message.FirstOrDefault(p => p.code == msg.code);
         if (m != null)
         {
             m.status = (int)status;
             entity.SaveChanges();
         }
     }
 }
 public MessageBuilder()
 {
     messageId = Guid.NewGuid().ToString();
     criticalTime = TimeSpan.FromSeconds(5);
     deliveryTime = TimeSpan.FromSeconds(4);
     processingTime = TimeSpan.FromSeconds(3);
     messageType = typeof(SubmitOrder);
     messageStatus = MessageStatus.Successful;
     timeSent = DateTime.Now.AddMinutes(-5);
     conversationId = Guid.NewGuid().ToString();
     headers = new List<StoredMessageHeader>();
     receivingEndpoint = null;
     sendingEndpoint = null;
 }
Beispiel #50
0
		public virtual void Process(MessageQueue msgQueue)
		{
			if (IsValid)
			{
				if (IsParallel)
				{
					vStatus = MessageStatus.ParallelProcessing;
				}
				else
				{
					vStatus = MessageStatus.Processing;
				}
				vProcessor(msgQueue, this);
			}
		}
Beispiel #51
0
        public void SetStatus(string message, MessageStatus status)
        {
            statusLabel.Text = message;
            statusLabel.Visibility = Visibility.Visible;

            switch (status)
            {
                case(MessageStatus.Success):
                    statusLabel.Foreground = new SolidColorBrush(Colors.Green);
                    break;
                case (MessageStatus.Error):
                    statusLabel.Foreground = new SolidColorBrush(Colors.Red);
                    break;
                case (MessageStatus.Information):
                    statusLabel.Foreground = new SolidColorBrush(Colors.Blue);
                    break;
            }
        }
 internal static MessageStatus WorkaroundCreateFile(FileNameStatus fileNameStatus, CreateOptions createOption, FileAccess desiredAccess, FileType openFileType, FileAttribute desiredFileAttribute, MessageStatus returnedStatus, ITestSite site)
 {
     if (openFileType == FileType.DirectoryFile && desiredFileAttribute == FileAttribute.TEMPORARY)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(507, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     else if (createOption == CreateOptions.SYNCHRONOUS_IO_ALERT
        && desiredAccess == FileAccess.FILE_READ_DATA)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(369, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     else if (createOption == CreateOptions.SYNCHRONOUS_IO_NONALERT
        && desiredAccess == FileAccess.FILE_READ_DATA)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(2373, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     else if (createOption == CreateOptions.DELETE_ON_CLOSE &&
         (desiredAccess == FileAccess.ACCESS_SYSTEM_SECURITY))
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(371, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     else if (createOption == (CreateOptions.SYNCHRONOUS_IO_NONALERT | CreateOptions.SYNCHRONOUS_IO_ALERT))
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(373, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     else if (createOption == (CreateOptions.COMPLETE_IF_OPLOCKED | CreateOptions.RESERVE_OPFILTER))
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(375, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     else if (fileNameStatus == FileNameStatus.StreamTypeNameIsINDEX_ALLOCATION)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(507, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     else if (createOption == CreateOptions.NO_INTERMEDIATE_BUFFERING &&
         (desiredAccess == FileAccess.FILE_APPEND_DATA || desiredAccess == FileAccess.FILE_ADD_SUBDIRECTORY))
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(376, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     return returnedStatus;
 }
Beispiel #53
0
            //Needs be be triggered by an external source
            //When changes the status based on the analyzed sentiment then triggers status changed
            protected virtual void OnMessageReceived(string message)
            {
                _timer.Stop();
                var answer = AnalyzeSentiment(message);
                switch (answer)
                {
                    case Answer.Yes:
                        Status = MessageStatus.Yes;
                        break;
                    case Answer.No:
                        Status = MessageStatus.No;
                        break;
                    case Answer.Unknown:
                        Status = MessageStatus.Unknown;
                        break;
                }
                if (invitationStatusChanged != null)
                {
                    invitationStatusChanged(this.Status, EventArgs.Empty);
                }

            }
 /// <summary>
 /// Updates the message status.
 /// </summary>
 /// <param name="status">The message status.</param>
 /// <returns></returns>
 public static bool UpdateStatus(IMessage message, MessageStatus status)
 {
     try
     {
         // Update message status in database
         OutgoingMessage outgoingMessage = OutgoingMessage.SingleOrDefault(msg => msg.Id == message.Identifier);
         if (outgoingMessage == null) return false;
         outgoingMessage.Status = StringEnum.GetStringValue(status);
         outgoingMessage.LastUpdate = DateTime.Now;
         if (status == MessageStatus.Sent)
         {
             outgoingMessage.SentDate = outgoingMessage.LastUpdate;
         }
         outgoingMessage.Update();
     }
     catch (Exception ex)
     {
         log.Error(string.Format("Error updating message: {0} ", ex.Message), ex);
         return false;
     }
     return true;
 }
Beispiel #55
0
        public void Process()
        {
            try
              {
            if (!this.haveHeader)
            {
              if (this.client.Available >= 8)
              {
            this.requestType = (MessageType)this.reader.ReadByte();
            this.requestFunction = (MessageFunction)this.reader.ReadByte();
            this.requestStatus = (MessageStatus)this.reader.ReadByte();
            this.requestTag = this.reader.ReadByte();
            this.requestLength = this.reader.ReadInt32();

            if (this.requestLength > 0)
            {
              this.haveHeader = true;
            }
            else
            {
              Handle(new byte[] { });
            }
              }
            }
            else
            {
              if (this.client.Available >= this.requestLength)
              {
            byte[] requestData = this.reader.ReadBytes(this.requestLength);

            Handle(requestData);

            this.haveHeader = false;
              }
            }
              }
              catch { }
        }
 internal static MessageStatus WorkaroundFsCtlDeleteReparsePoint(ReparseTag reparseTag, bool reparseGuidEqualOpenGuid, MessageStatus returnedStatus, ITestSite site)
 {
     if (reparseTag == ReparseTag.EMPTY && reparseGuidEqualOpenGuid)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(5001, MessageStatus.SUCCESS, returnedStatus, site);
     }
     else if (reparseTag == ReparseTag.IO_REPARSE_TAG_RESERVED_ONE || reparseTag == ReparseTag.IO_REPARSE_TAG_RESERVED_ZERO)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(2437, MessageStatus.IO_REPARSE_TAG_INVALID, returnedStatus, site);
     }
     else if ((reparseTag == ReparseTag.NON_MICROSOFT_RANGE_TAG) && (!reparseGuidEqualOpenGuid))
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(990, MessageStatus.REPARSE_ATTRIBUTE_CONFLICT, returnedStatus, site);
     }
     else if (reparseTag == ReparseTag.NON_MICROSOFT_RANGE_TAG && reparseGuidEqualOpenGuid)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(1257, MessageStatus.IO_REPARSE_DATA_INVALID, returnedStatus, site);
     }
     else if (reparseTag == ReparseTag.NotEqualOpenFileReparseTag)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(989, MessageStatus.IO_REPARSE_TAG_MISMATCH, returnedStatus, site);
     }
     return returnedStatus;
 }
Beispiel #57
0
		public virtual void Release()
		{
			vStatus = MessageStatus.Processed;
		}
 public MessageErrorInfo(MessageStatus status)
 {
     Status = status;
     Image = GetImage();
     Description = status.GetDescription();
 }
        public void SetMessageStatus(MessageBookmark bookmark, MessageStatus status)
        {
            _messages.MoveTo(bookmark);
            var id = _messages.GetMessageId();

            _messages.Update(() => _messages.ForColumnType<IntColumn>().Set("status", (int)status));

            _logger.Debug("Changing message {0} status to {1} on {2}",
                               id, status, _queueName);
        }
 public void SetMessageStatus(MessageBookmark bookmark, MessageStatus status, string subqueue)
 {
     _messages.MoveTo(bookmark);
     var id = _messages.GetMessageId();
     _messages.Update(() =>
     {
         _messages.ForColumnType<IntColumn>().Set("status", (int)status);
         _messages.ForColumnType<StringColumn>().Set("subqueue", subqueue);
     });
     _logger.Debug("Changing message {0} status to {1} on queue '{2}' and set subqueue to '{3}'",
                        id, status, _queueName, subqueue);
 }