Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


com.oracle.sft.api
Interface IMConference

All Superinterfaces:
Communication, Interaction

public interface IMConference
extends Interaction

Represents a multi-party pager-mode instant messaging. It extends an Interaction. There are two ways to create this interaction object:

   CommunicationSession.createIMConference(String)
   CommunicationSession.createIMConference(String, IMConversation)
 

Usage Example

When a participant tries to send a text message to an IM conference, Container will receive MESSAGE request and will trigger an event to the CommunicationBean. The CommunicationBean can make use of this communication object to send message to all other the attendees , like this:


 @CommunicationBean public class IMConferenceBean {

     @Context CommunicationSession session;
     @Context CommunicationContext context;
     @Context CommunicationService service;

     @CommunicationEvent(type = CommunicationEvent.Type.INITIALIZATION,
                         communicationType = IMConversation.class)
     void handleInit() {

         IMConversation conv = (IMConversation) context.getCommunication();
         TextMessage msg = (TextMessage)ctx.getMessage();
  
         String confName = conv.getParticipant().getName()
        
         if (confName.equalsIgnoreCase("imconf@example.com")) {
                 // Create a new IMConference or add into the IMConference.
                IMConference conf = session.createIMConference(confName, conv);
                
                // send message to other attendees.
                conf.createTextMessage(msg.getText()).send(conv.getInitiator());
        }
     }   
 

Nested Class Summary

 

Nested classes/interfaces inherited from interface com.oracle.sft.api.Communication
Communication.State

 

Method Summary
 CommonPresenceInstantMessage createCommonPresenceInstantMessage()
          Create a Common Presence and Instant Messaging message
 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.
 Collection<UserParticipant> getAllParticipants()
          Return all the participants in the conference.
 String getDescription()
          Return the description of the conference.
 int getIdleTime()
          Return the current value of the idle time.
 void setDescription(String description)
          Set the description of the conference.
 void setIdleTime(int idleTime)
          An IM conference by default gets destroyed as soon as the message is received successfully or sent successfully.

 

Methods inherited from interface com.oracle.sft.api.Interaction
addParticipant, addParticipant, addParticipant, addParticipant, getParticipant, getParticipant, removeParticipant, removeParticipant, replaceParticipant, replaceParticipant

 

Methods inherited from interface com.oracle.sft.api.Communication
addAgent, end, getAgent, getAgents, getInitiator, getName, getState, removeAgent

 

Method Detail

setDescription

void setDescription(String description)
Set the description of the conference.
Parameters:
description - Description of the IMConference

getDescription

String getDescription()
Return the description of the conference.
Returns:
the description of the conference.

getAllParticipants

Collection<UserParticipant> getAllParticipants()
Return all the participants in the conference.
Returns:
a Collection of UserParticipant objects.

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
Returns:
a MessageIndication object.
See Also:
MessageIndication

createCommonPresenceInstantMessage

CommonPresenceInstantMessage createCommonPresenceInstantMessage()
Create a Common Presence and Instant Messaging message
Returns:
CommonPresenceInstantMessage object

setIdleTime

void setIdleTime(int idleTime)
An IM conference 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 conference 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 conference will always be active. Default value is -1, which means that the conference 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.

Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


Copyright © 2012 Oracle Corporation. All Rights Reserved.