Exemplo n.º 1
0
        public OutgoingEntry AddOutgoingEntry(ComplianceMessage message)
        {
            OutgoingEntry outgoingEntry = this.GetOutgoingEntry(message, false);

            if (outgoingEntry != null && outgoingEntry.Status != OutgoingEntry.OutgoingEntryStatus.Completed)
            {
                int value = 0;
                if (this.outgoingKeys.TryAdd(outgoingEntry.GetKey(), value))
                {
                    outgoingEntry.EvaluateState(false);
                }
            }
            return(outgoingEntry);
        }
Exemplo n.º 2
0
        public void CompleteOutgoingEntry(ComplianceMessage message)
        {
            OutgoingEntry outgoingEntry = this.GetOutgoingEntry(message, true);

            if (outgoingEntry != null)
            {
                int num;
                this.outgoingKeys.TryRemove(outgoingEntry.GetKey(), out num);
                outgoingEntry.Status = OutgoingEntry.OutgoingEntryStatus.Completed;
            }
            if (this.outgoingKeys.Count == 0 && this.Status == IncomingEntry.IncomingEntryStatus.Processed)
            {
                this.Status = IncomingEntry.IncomingEntryStatus.Returned;
            }
        }
Exemplo n.º 3
0
        public OutgoingEntry GetOutgoingEntry(ComplianceMessage message, bool onlyIfExists = false)
        {
            OutgoingEntry outgoingEntry = new OutgoingEntry(message);

            if (!onlyIfExists)
            {
                return(outgoingEntry.UpdateCache(RoutingCache.Instance.RoutingTable) as OutgoingEntry);
            }
            CacheItem cacheItem = RoutingCache.Instance.RoutingTable.GetCacheItem(outgoingEntry.GetKey(), null);

            if (cacheItem != null)
            {
                return(cacheItem.Value as OutgoingEntry);
            }
            return(null);
        }