Conversation Class
- java.
lang. Object - com.
microsoft. cognitiveservices. speech. transcription. Conversation
- com.
Implements
public final class Conversation
implements java.lang.AutoCloseable
Performs conversation management including add and remove participants. Note: close() must be called in order to release underlying resources held by the object. Added in version 1.8.0
Constructor Summary
Modifier | Constructor | Description |
---|---|---|
protected | Conversation(long handleValue) |
Protected constructor. |
Method Summary
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.Future<Participant> |
addParticipantAsync(Participant participant)
Add a participant to a conversation using a participant object. |
java.util.concurrent.Future<User> |
addParticipantAsync(User user)
Add a participant to a conversation using a user object. |
java.util.concurrent.Future<Participant> |
addParticipantAsync(String userId)
Add a participant to a conversation using the user's id. |
void |
close()
Dispose of associated resources. |
static java.util.concurrent.Future<Conversation> |
createConversationAsync(SpeechConfig speechConfig)
Initializes a new instance of Conversation. |
static java.util.concurrent.Future<Conversation> |
createConversationAsync(SpeechConfig speechConfig, String conversationId)
Initializes a new instance of Conversation. |
java.util.concurrent.Future<java.lang.Void> |
deleteConversationAsync()
Delete a conversation. |
protected void |
dispose(boolean disposing)
PROTECTED |
java.util.concurrent.Future<java.lang.Void> |
endConversationAsync()
End a conversation. |
java.lang.String |
getAuthorizationToken()
Gets the authorization token used to communicate with the service. |
java.lang.String |
getConversationId()
Gets the conversation Id. |
Safe |
getImpl()
Returns the comversation implementation. |
Property |
getProperties()
The collection of properties and their values defined for this Conversation. |
java.util.concurrent.Future<java.lang.Void> |
lockConversationAsync()
Lock a conversation. |
java.util.concurrent.Future<java.lang.Void> |
muteAllParticipantsAsync()
Mute all other participants in the conversation. |
java.util.concurrent.Future<java.lang.Void> |
muteParticipantAsync(String userId)
Mute a participant. |
java.util.concurrent.Future<java.lang.Void> |
removeParticipantAsync(Participant participant)
Remove a participant from a conversation using a participant object. |
java.util.concurrent.Future<java.lang.Void> |
removeParticipantAsync(User user)
Remove a participant from a conversation using a user object. |
java.util.concurrent.Future<java.lang.Void> |
removeParticipantAsync(String userId)
Remove a participant from a conversation using a user id. |
void |
setAuthorizationToken(String token)
Sets the authorization token used to communicate with the service. |
java.util.concurrent.Future<java.lang.Void> |
startConversationAsync()
Start a conversation. |
java.util.concurrent.Future<java.lang.Void> |
unlockConversationAsync()
Unlocks a conversation. |
java.util.concurrent.Future<java.lang.Void> |
unmuteAllParticipantsAsync()
Unmute all other participants in the conversation. |
java.util.concurrent.Future<java.lang.Void> |
unmuteParticipantAsync(String userId)
Unmute a participant. |
Methods inherited from java.lang.Object
Constructor Details
Conversation
protected Conversation(long handleValue)
Protected constructor.
Parameters:
Method Details
addParticipantAsync
public Future
Add a participant to a conversation using a participant object.
Parameters:
Returns:
addParticipantAsync
public Future
Add a participant to a conversation using a user object.
Parameters:
Returns:
addParticipantAsync
public Future
Add a participant to a conversation using the user's id.
Parameters:
Returns:
close
public void close()
Dispose of associated resources. Note: close() must be called in order to release underlying resources held by the object.
createConversationAsync
public static Future
Initializes a new instance of Conversation.
Parameters:
Returns:
createConversationAsync
public static Future
Initializes a new instance of Conversation.
Parameters:
Returns:
deleteConversationAsync
public Future
Delete a conversation. After this no one will be able to join the conversation.
Returns:
dispose
protected void dispose(boolean disposing)
PROTECTED
Parameters:
endConversationAsync
public Future
End a conversation.
Returns:
getAuthorizationToken
public String getAuthorizationToken()
Gets the authorization token used to communicate with the service.
Returns:
getConversationId
public String getConversationId()
Gets the conversation Id.
Returns:
getImpl
public SafeHandle getImpl()
Returns the comversation implementation.
Returns:
getProperties
public PropertyCollection getProperties()
The collection of properties and their values defined for this Conversation.
Returns:
lockConversationAsync
public Future
Lock a conversation. This will prevent new participants from joining.
Returns:
muteAllParticipantsAsync
public Future
Mute all other participants in the conversation. After this no other participants will have their speech recognitions broadcast, nor be able to send text messages.
Returns:
muteParticipantAsync
public Future
Mute a participant.
Parameters:
Returns:
removeParticipantAsync
public Future
Remove a participant from a conversation using a participant object.
Parameters:
Returns:
removeParticipantAsync
public Future
Remove a participant from a conversation using a user object.
Parameters:
Returns:
removeParticipantAsync
public Future
Remove a participant from a conversation using a user id.
Parameters:
Returns:
setAuthorizationToken
public void setAuthorizationToken(String token)
Sets the authorization token used to communicate with the service. Note: The caller needs to ensure that the authorization token is valid. Before the authorization token expires, the caller needs to refresh it by calling this setter with a new valid token. Otherwise, the recognizer will encounter errors during recognition.
Parameters:
startConversationAsync
public Future
Start a conversation.
Returns:
unlockConversationAsync
public Future
Unlocks a conversation.
Returns:
unmuteAllParticipantsAsync
public Future
Unmute all other participants in the conversation.
Returns:
unmuteParticipantAsync
public Future
Unmute a participant.
Parameters:
Returns: