public class ConversationBroker extends Object implements ConversationProvider
Constructor and Description |
---|
ConversationBroker() |
Modifier and Type | Method and Description |
---|---|
void |
addProvider(String topic,
ConversationProvider provider)
Add a new provider for the specified topic.
|
ConversationProvider |
getProvider(String topic)
Get the provider associated with the specified topic.
|
Set<String> |
getTopics()
Get the set of registered conversation topics.
|
Conversation |
newConversation(String topic,
int cid,
int parentId)
Get a conversation for the specified topic.
|
void |
removeConversation(Conversation c)
Remove the specified conversation.
|
void |
removeProvider(String topic)
Remove the provider associated with the specified topic.
|
public void addProvider(String topic, ConversationProvider provider)
topic
- conversation topicprovider
- conversation provider to which the requests for
conversations on the specified topic will be directedpublic void removeProvider(String topic)
topic
- conversation topic whose provider should be removedpublic ConversationProvider getProvider(String topic)
topic
- conversation topic whose provider is requestedpublic Set<String> getTopics()
public Conversation newConversation(String topic, int cid, int parentId)
ConversationProvider
newConversation
in interface ConversationProvider
topic
- name of the conversation topiccid
- conversation idparentId
- unique conversation id of the parent conversation; 0 if
no parent conversationpublic void removeConversation(Conversation c)
ConversationProvider
removeConversation
in interface ConversationProvider
c
- conversation to be removedCopyright © 2015. All Rights Reserved.