org.glassfish.cafe.api
Interface IMConversation

All Superinterfaces:
Communication

public interface IMConversation
extends Communication

Represents a two party IM conversation. It extends a Communication. The application would use this communication type to send and receive messages.

Author:
binod

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.cafe.api.Communication
Communication.State
 
Method Summary
 MessageIndication createMessageIndication()
          Creates a message indication object.
 MessageIndication createMessageIndication(MessageIndication.State state)
          Creates a message indication object.
 TextMessage createTextMessage()
          Creats an empty text message object.
 TextMessage createTextMessage(String msg)
          Creates the text message with the supplied text.
 int getIdleTime()
          Return the current value of the idle time.
 UserParticipant getParticipant()
          Retrieve the participant which receives the messages from the initiator.
 void setIdleTime(int idleTime)
          An IM conversation by default gets destroyed as soon as the message is received successfully or sent successfully.
 
Methods inherited from interface org.glassfish.cafe.api.Communication
addAgent, addParticipant, addParticipant, addParticipant, addParticipant, end, getAgent, getAgents, getInitiator, getName, getParticipant, getParticipant, getState, removeAgent, removeParticipant, removeParticipant, replaceParticipant
 

Method Detail

createTextMessage

TextMessage createTextMessage()
Creats an empty text message object. Application would then fill it with text content and send to the participant.

Returns:
a TextMessage object.
See Also:
TextMessage

createTextMessage

TextMessage createTextMessage(String msg)
Creates the text message with the supplied text. This is equivalent to doing. TextMessage tm = im.createTextMessage(); tm.setText(msg);

Parameters:
msg - Text data of the message.
Returns:
a TextMessage object.
See Also:
TextMessage

createMessageIndication

MessageIndication createMessageIndication()
Creates a message indication object. The object will be created with default values specified in the MessageIndication class

Returns:
a MessageIndication object.
See Also:
MessageIndication

createMessageIndication

MessageIndication createMessageIndication(MessageIndication.State state)
Creates a message indication object. The object will be created with default values specified in the MessageIndication class

Parameters:
state - State of the MessageIndication.
Returns:
a MessageIndication object.
See Also:
MessageIndication, MessageIndication.State

setIdleTime

void setIdleTime(int idleTime)
An IM conversation by default gets destroyed as soon as the message is received successfully or sent successfully. However if the idletime is set to a value greater than zero, then the conversation will be alive until it is idle for the time specified. After the specified time period, the conversation will be removed. A value of zero means that the conversation will always be active. Default value is -1, which means that the conversation will be removed as soon as the SIP message gets committed.

Parameters:
idleTime - Idle time in seconds.

getIdleTime

int getIdleTime()
Return the current value of the idle time.

Returns:
Idle time in seconds.

getParticipant

UserParticipant getParticipant()
Retrieve the participant which receives the messages from the initiator.

Returns:
The participant who receives the messages from the initiator.


Copyright © 2010. All Rights Reserved.