/// <summary> /// Sends messages to network agents instructing them to delete all queues /// and their associated RAPs for the specified TenantId. The messages are /// sent synchronously in parallel and control is not returned to the /// caller until all network agents have replied. /// </summary> private void DeleteTenant() { const MessageTypes replyType = MessageTypes.MessageTypeTenantDeleteAck; const int typeIndex = (int)replyType; ValidateState(RateControllerState.Fin, "DeleteTenant"); ManualResetEvent NetMessagesComplete = NetBeginMessagePairs(netRateController.DeleteTenant); lock (LockPendingReplies[typeIndex]) { foreach (Connection conn in AgentNameToConn.Values) { if (conn.ListQueues.Count > 0) { MessageTenantDelete mTenantDelete = new MessageTenantDelete(++SeqNo); SendParallel(conn, mTenantDelete.Serialize, replyType, mTenantDelete.SeqNo); } } WaitForParallelReplies(replyType, Parameters.DEFAULT_MESSAGE_TIMEOUT_MS); } // lock NetMessagesComplete.WaitOne(); }
public static MessageTenantDelete CreateFromNetBytes(byte[] buffer, int offset) { int oldOffset = offset; MessageTenantDelete msg = new MessageTenantDelete(0); msg.Length = (uint)Utils.Int32FromNetBytes(buffer, offset); offset += 4; msg.SeqNo = (uint)Utils.Int32FromNetBytes(buffer, offset); offset += 4; msg.MessageType = buffer[offset++]; return msg; }