|
Oracle Communications Converged Application Server Java API Reference 5.1 E36938-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MSRPConference
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.
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. |
|
|
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 |
---|
MSRPSessionType getSessionType()
Collection<UserParticipant> getAllParticipants()
UserParticipant
objects.<P extends MediaParticipant> Collection<P> getAllMediaParticipants(Class<P> type)
P
- Type of the Participant.type
- Class of the Participant.Participant
TextMessage createTextMessage(String msg)
msg
- Text data of the messageConferenceInfo getConferenceInfo()
ConferenceInfo
ConferenceInfo createConferenceInfo()
ConferenceInfo
.ConferenceInfo
void notify(ConferenceInfo conferenceInfo)
conferenceInfo
- The ConferenceInfo that will notify to subscriber.
|
Oracle Communications Converged Application Server Java API Reference 5.1 E36938-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2012 Oracle Corporation. All Rights Reserved.