getMeetingInfo API call working

now just need to add more information to it


git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@3796 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Jeremy Thomerson 2010-03-04 23:59:02 +00:00
parent bdb9832e54
commit 500604eb55
8 changed files with 106 additions and 9 deletions

View File

@ -40,6 +40,10 @@ import java.lang.Long
unmodifiableStatus = Collections.unmodifiableMap(status)
}
public boolean isModerator() {
return "MODERATOR".equals(role);
}
public String getName() {
return name
}

View File

@ -132,4 +132,16 @@ public class Room implements Serializable {
return participants.size()
}
public int getNumberOfModerators() {
int sum = 0;
for (Iterator<Participant> it = participants.values().iterator(); it.hasNext(); ) {
Participant part = it.next();
if (part.isModerator()) {
sum++;
}
}
log.debug("Returning number of moderators: " + sum)
return sum;
}
}

View File

@ -35,9 +35,6 @@ public interface IConferenceEventListener {
@Gateway(requestChannel="conferenceEnded")
void ended(Room room);
/*
void participantJoined(Room room, Participant participant);
void participantLeft(Room room, Participant participant);
*/
@Gateway(requestChannel="participantsUpdated")
void participantsUpdated(Room room);
}

View File

@ -0,0 +1,54 @@
/*
* BigBlueButton - http://www.bigbluebutton.org
*
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
*
* BigBlueButton is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
*
* $Id: $
*/
package org.bigbluebutton.conference
public class ParticipantUpdatingRoomListener implements IRoomListener{
private IConferenceEventListener conferenceEventListener;
private Room room;
public ParticipantUpdatingRoomListener(IConferenceEventListener lstnr, Room room) {
this.conferenceEventListener = lstnr;
this.room = room;
}
def getName() {
return 'TEMPNAME'
}
public void participantStatusChange(Long userid, String status, Object value){
if (conferenceEventListener != null) {
conferenceEventListener.participantsUpdated(room);
}
}
public void participantJoined(Participant p) {
if (conferenceEventListener != null) {
conferenceEventListener.participantsUpdated(room);
}
}
public void participantLeft(Long userid) {
if (conferenceEventListener != null) {
conferenceEventListener.participantsUpdated(room);
}
}
}

View File

@ -41,8 +41,10 @@ public class RoomsManager {
rooms = new ConcurrentHashMap<String, Room>()
}
public void addRoom(Room room) {
public void addRoom(final Room room) {
log.debug("In RoomsManager adding room ${room.name}")
room.addRoomListener(new ParticipantUpdatingRoomListener(conferenceEventListener, room));
if (checkEvtListener()) {
conferenceEventListener.started(room)
log.debug("notified event listener of conference start")
@ -60,7 +62,6 @@ public class RoomsManager {
}
private boolean checkEvtListener() {
println "RoomsManager event listener: " + conferenceEventListener
log.debug("RoomsManager event listener: " + conferenceEventListener)
return conferenceEventListener != null;
}
@ -115,6 +116,13 @@ public class RoomsManager {
log.debug("In RoomsManager - ${roomName} add participant ${participant.name}")
Room r = getRoom(roomName)
if (r != null) {
if (checkEvtListener()) {
conferenceEventListener.participantsUpdated(room);
if (r.getNumberOfParticipants() == 0) {
conferenceEventListener.started(room)
log.debug("notified event listener of conference start")
}
}
r.addParticipant(participant)
return
}
@ -125,6 +133,9 @@ public class RoomsManager {
log.debug("In RoomsManager - ${roomName} remove participant ${participant.name}")
Room r = getRoom(roomName)
if (r != null) {
if (checkEvtListener()) {
conferenceEventListener.participantsUpdated(room);
}
r.removeParticipant(userid)
return
}

View File

@ -137,4 +137,11 @@
<constructor-arg value="conferenceEndedEvents"/>
</bean>
<!-- participantsUpdated -->
<integration:channel id="participantsUpdated" />
<jms:outbound-channel-adapter id="participantsUpdatedJmsOut" destination="participantsUpdatedEvents" channel="participantsUpdated" />
<bean id="participantsUpdatedEvents" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="participantsUpdatedEvents"/>
</bean>
</beans>

View File

@ -63,12 +63,22 @@
<integration:interval-trigger interval="5" time-unit="SECONDS"/>
</integration:poller>
</jms:inbound-channel-adapter>
<jms:inbound-channel-adapter id="jmsInParticipantsUpdated"
destination-name="participantsUpdatedEvents"
channel="participantsUpdated"
extract-payload="true">
<integration:poller>
<integration:interval-trigger interval="5" time-unit="SECONDS"/>
</integration:poller>
</jms:inbound-channel-adapter>
<integration:channel id="conferenceStarted"/>
<integration:channel id="conferenceEnded"/>
<integration:channel id="participantsUpdated"/>
<integration:service-activator input-channel="conferenceStarted" ref="dynamicConferenceService" method="conferenceStarted" />
<integration:service-activator input-channel="conferenceEnded" ref="dynamicConferenceService" method="conferenceEnded" />
<integration:service-activator input-channel="participantsUpdated" ref="dynamicConferenceService" method="participantsUpdated" />
<!-- <stream:stdout-channel-adapter id="stdout" channel="jmsinToStdoutChannel" append-newline="true"/>-->

View File

@ -327,6 +327,8 @@ class ApiController {
attendeePW("${conf.attendeePassword}")
moderatorPW("${conf.moderatorPassword}")
running(conf.isRunning() ? "true" : "false")
participantCount(room.getNumberOfParticipants())
moderatorCount(room.getNumberOfModerators())
messageKey(msgKey == null ? "" : msgKey)
message(msg == null ? "" : msg)
}