public ProducerState removeProducer(ProducerId id) { ProducerState ret = producers[id]; producers.Remove(id); return(ret); }
public void AddProducer(ProducerState producer) { CheckShutdown(); if (this.producers.ContainsKey(producer.Info.ProducerId)) { this.producers[producer.Info.ProducerId] = producer; } else { this.producers.Add(producer.Info.ProducerId, producer); } }
public void AddProducer(ProducerInfo info) { CheckShutdown(); ProducerState producerState = new ProducerState(info); if (producers.ContainsKey(info.ProducerId)) { producers[info.ProducerId] = producerState; } else { producers.Add(info.ProducerId, producerState); } }
public ProducerState RemoveProducer(ProducerId id) { CheckShutdown(); ProducerState ret = null; if (producers.TryGetValue(id, out ret)) { producers.Remove(id); if (null != ret && ret.TransactionState != null) { ret.TransactionState.AddProducer(ret); } } return(ret); }
public override Response ProcessMessage(Message send) { if (send != null) { if (TrackTransactions && send.TransactionId != null) { ProducerId producerId = send.ProducerId; ConnectionId connectionId = producerId.ParentId.ParentId; if (connectionId != null) { ConnectionState cs = null; if (connectionStates.TryGetValue(connectionId, out cs)) { TransactionState transactionState = cs[send.TransactionId]; if (transactionState != null) { transactionState.AddCommand(send); if (isTrackTransactionProducers) { SessionState ss = cs[producerId.ParentId]; ProducerState producerState = ss[producerId]; producerState.TransactionState = transactionState; } } } } return(TRACKED_RESPONSE_MARKER); } else if (TrackMessages) { messageCache.Add(send.MessageId, (Message)send.Clone()); } } return(null); }