Example #1
0
        public IncomingEntry ReceiveMessage(ComplianceMessage message, out bool shouldProcess)
        {
            shouldProcess = true;
            message.ProtocolContext.Direction = ProtocolContext.MessageDirection.Incoming;
            IncomingEntry incomingEntry = this.GetIncomingEntry(message, false);

            if (incomingEntry != null)
            {
                if (incomingEntry.Status == IncomingEntry.IncomingEntryStatus.Processed)
                {
                    shouldProcess = false;
                }
                else if (incomingEntry.Status == IncomingEntry.IncomingEntryStatus.Completed)
                {
                    shouldProcess = false;
                    incomingEntry.RequestReissued();
                }
            }
            OutgoingEntry outgoingEntry = incomingEntry.ReturnOutgoingEntry(message);

            if (outgoingEntry != null && outgoingEntry.Status != OutgoingEntry.OutgoingEntryStatus.Completed)
            {
                message.ProtocolContext.Direction = ProtocolContext.MessageDirection.Return;
                if (!shouldProcess)
                {
                    shouldProcess = true;
                }
            }
            return(incomingEntry);
        }