com.h3c.util.net.msg

## Class AbstractConversationTracker

- java.lang.Object
- - com.h3c.util.net.msg.AbstractConversationTracker

- All Implemented Interfaces:
    ConversationProvider
  Direct Known Subclasses:
    AbstractQueuedConversationTracker, Echo.Provider

      public abstract class AbstractConversationTracker
      extends Object
      implements ConversationProvider

  An abstract conversation provider that keeps track of the conversations using their id.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<Integer,Conversation>` | `conversations`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractConversationTracker()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Conversation` | `addConversation(Conversation c)` Add a new conversation to keep track of.
    `Map<Integer,Conversation>` | `conversations()` Get the map of conversations that are currently being tracked.
    `Conversation` | `get(int cid)` Get the conversation with the specified id.
    `void` | `removeConversation(Conversation c)` Remove the specified conversation.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.h3c.util.net.msg.ConversationProvider

      `newConversation`

- - ### Field Detail

    - #### conversations

          protected Map<Integer,Conversation> conversations

  - ### Constructor Detail

    - #### AbstractConversationTracker

          public AbstractConversationTracker()

  - ### Method Detail

    - #### addConversation

          protected Conversation addConversation(Conversation c)

      Add a new conversation to keep track of.
      Parameters:
        `c` - newly allocated conversation to start tracking
      Returns:
        the added conversation

    - #### removeConversation

          public void removeConversation(Conversation c)

      Description copied from interface: `ConversationProvider`
      Remove the specified conversation.
      Specified by:
        `removeConversation` in interface `ConversationProvider`
      Parameters:
        `c` - conversation to be removed

    - #### get

          public Conversation get(int cid)

      Get the conversation with the specified id.
      Parameters:
        `cid` - conversation id
      Returns:
        conversation with the specified id; null if no conversation with that id has been registered

    - #### conversations

          public Map<Integer,Conversation> conversations()

      Get the map of conversations that are currently being tracked.
      Returns:
        map of id-to-conversation bindings

Copyright © 2014. All Rights Reserved.