Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


com.oracle.sft.api
Interface MSRPConference

All Superinterfaces:
Communication, Interaction

public interface MSRPConference
extends Interaction

A interaction object that can represents 2 different type of MSRP session:

1. MSRPSessionType.INSTANT_MESSAGING - session-mode instant messaging among multiple participants.

2. MSRPSessionType.DATA_TRANSFER - file transferring among the multiple participants.

There are two ways to create this communication object:

   CommunicationSession.createMSRPConference(String)
   CommunicationSession.createMSRPConference(String, MSRPConversation)
 

The initial MSRPConference session type value is null, in the following 2 cases, the value will be set to INSTANT_MESSAGING

1. MSRP client call in MSRPConference for chat, application using createMSRPConference(String, MSRPConversation) to create a MSRPConfernce.

2. Application create MSRPConfernce using createMSRPConference(String) and then using addParticipant(...) method to invite user join.

And in below 2 cases the value will be set to DATA_TRANSFER

1. MSRP client call in MSRPConference for file transfer, application using createMSRPConference(String, MSRPConversation) to create a MSRPConfernce.

2. Application create MSRPConfernce using createMSRPConference(String), then add a MSRPPlayer as a participant, invoke MSRPPlayer.start(...) method.

Usage Example

During the Voice Conference, if one of the participant tries to send a large file to the conference using MSRP protocol, Container will receive the file transfer request and will trigger an event to the CommunicationBean. The CommunicationBean can make use of this communication object to send the file to either all the attendees or to the selective attendees, like this:


 @CommunicationBean public class MSRPConferenceBean {

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

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

         MSRPConversation msrpConv = (MSRPConversation) context.getCommunication();
         String callee = conv.getCallee().getName();
         String caller = conv.getCaller().getName();
         
         // Find the voice conference.
         Conference voiceConf = service.findByName(Conference.class, confName);      

         // Create a new msrp conference.
         MSRPConference msrpConf = session.createMSRPConference(callee, msrpConv);
         
         // Excluding the party who sent the file transfer request, add all the
         // other parties (as in this case) or add the parties selectively.
         for(UserParticipant party : voiceConf.getAllParticipants()) {
           if (!party.getName().equals(msrpConf.getInitiator())) {
             msrpConf.addParticipant(party.getName());
           }
         }

         // The file will be transferred to the parties application just added.          
      }
    }

 

In this example, the file which gets transferred can also be stored in the MSRP server by adding a MSRPRecorder, like this:

     void handleInit() {
         ......
         // After adding all the parties, add the MSRPRecorder to save the file locally.
         MSRPRecorder recorder = sess.createParticipant(MSRPRecorder.class, "recorder");
         msrpConf.addParticipant(recorder);
         recorder.start("/tmp/recorded.ext");
     }
 

Similarly, during the Voice Conference if the attendees want to chat using session-mode instant messaging, the above bean can be re-used without any changes. With the MSRPRecorder, the chat history will be saved to the file.


Nested Class Summary

 

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

 

Method Summary
 ConferenceInfo createConferenceInfo()
          Create an instance of ConferenceInfo.
 TextMessage createTextMessage(String msg)
          Creates the text message with the supplied text.
<P extends MediaParticipant>
Collection<P>
getAllMediaParticipants(Class<P> type)
          Get a collection of particular type of Participants in the conference.
 Collection<UserParticipant> getAllParticipants()
          Return all the participants in the conference.
 ConferenceInfo getConferenceInfo()
          Returns object that represent the conference-info defined in RFC 4575.
 MSRPSessionType getSessionType()
          Return the MSRPConference session type.
 void notify(ConferenceInfo conferenceInfo)
          Send a notification to interested subscribers for this conference state.

 

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

getSessionType

MSRPSessionType getSessionType()
Return the MSRPConference session type.
Returns:
an instance MSRPSessionType.

getAllParticipants

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

getAllMediaParticipants

<P extends MediaParticipant> Collection<P> getAllMediaParticipants(Class<P> type)
Get a collection of particular type of Participants in the conference.
Type Parameters:
P - Type of the Participant.
Parameters:
type - Class of the Participant.
Returns:
An instance of Participant

createTextMessage

TextMessage createTextMessage(String msg)
Creates the text message with the supplied text.
Parameters:
msg - Text data of the message
Returns:
A TextMessage object

getConferenceInfo

ConferenceInfo getConferenceInfo()
Returns object that represent the conference-info defined in RFC 4575.
Returns:
An instance of ConferenceInfo

createConferenceInfo

ConferenceInfo createConferenceInfo()
Create an instance of ConferenceInfo.
Returns:
an instance of ConferenceInfo

notify

void notify(ConferenceInfo conferenceInfo)
Send a notification to interested subscribers for this conference state. Notice that in most cases, the SFT Container will send the notification for event like participant joins or participant leaves. If application changed the ConferenceInfo, like conference identifiers and service URIs, application can trigger a notification by invoke this method.
Parameters:
conferenceInfo - The ConferenceInfo that will notify to subscriber.

Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


Copyright © 2012 Oracle Corporation. All Rights Reserved.