Skip to content

Commit

Permalink
getMeetingInfo API call working
Browse files Browse the repository at this point in the history
now just need to add more information to it


git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@3796 af16638f-c34d-0410-8cfa-b39d5352b314
  • Loading branch information
jthomerson committed Mar 4, 2010
1 parent bdb9832 commit 500604e
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ import java.lang.Long
unmodifiableStatus = Collections.unmodifiableMap(status)
}

public boolean isModerator() {
return "MODERATOR".equals(role);
}

public String getName() {
return name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ 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);
}
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -60,7 +62,6 @@ public class RoomsManager {
}

private boolean checkEvtListener() {
println "RoomsManager event listener: " + conferenceEventListener
log.debug("RoomsManager event listener: " + conferenceEventListener)
return conferenceEventListener != null;
}
Expand Down Expand Up @@ -110,11 +111,18 @@ public class RoomsManager {
}
log.warn("Removing listener from a non-existing room ${roomName}")
}

public void addParticipant(String roomName, Participant participant) {
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
}
Expand All @@ -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
}
Expand Down
7 changes: 7 additions & 0 deletions bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-apps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
10 changes: 10 additions & 0 deletions bigbluebutton-web/grails-app/conf/spring/resources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 500604e

Please sign in to comment.