forked from bigbluebutton/bigbluebutton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added message-producer and message-recorder
- Loading branch information
1 parent
3856231
commit e187597
Showing
20 changed files
with
958 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
usePlugin 'java' | ||
usePlugin 'eclipse' | ||
usePlugin 'war' | ||
|
||
version=0.2 | ||
|
||
task copyToLib(dependsOn: configurations.default.buildArtifacts, type: Copy) { | ||
into('$buildDir/lib') | ||
from configurations.default | ||
from configurations.default.allArtifacts*.file | ||
} | ||
repositories { | ||
mavenCentral() | ||
add(new org.apache.ivy.plugins.resolver.URLResolver()) { | ||
name = "maven2-central" | ||
addArtifactPattern "http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact](-[revision])(-[classifier]).[ext]" | ||
addArtifactPattern "http://repo1.maven.org/maven2/[organisation]/[artifact]/[revision]/[artifact](-[revision])(-[classifier]).[ext]" | ||
} | ||
flatDir(name: 'fileRepo', dirs: "$projectDir/src/main/webapp/WEB-INF/lib") | ||
} | ||
dependencies { | ||
compile('org.apache.activemq:activemq-all:5.2.0') { | ||
artifact { name='activemq-all' ; type='jar' } | ||
} | ||
compile('commons-beanutils:commons-beanutils:1.8.3') { | ||
artifact { name='commons-beanutils' ; type='jar' } | ||
} | ||
compile('commons-collections:commons-collections:3.2') { | ||
artifact { name='commons-collections' ; type='jar' } | ||
} | ||
compile('commons-io:commons-io:1.4') { | ||
artifact { name='commons-io' ; type='jar' } | ||
} | ||
compile('commons-lang:commons-lang:2.5') { | ||
artifact { name='commons-lang' ; type='jar' } | ||
} | ||
compile('commons-logging:commons-logging:1.1.1') { | ||
artifact { name='commons-logging' ; type='jar' } | ||
} | ||
compile('net.sf.ezmorph:ezmorph:1.0.6') { | ||
artifact { name='ezmorph' ; type='jar' } | ||
} | ||
compile group: 'net.sf.json-lib', name: 'json-lib', version: '2.3', classifier: 'jdk15' | ||
|
||
compile('org.springframework:spring:2.5.6') { | ||
artifact { name='spring' ; type='jar' } | ||
} | ||
compile('org.springframework:spring-jms:2.5.6') { | ||
artifact { name='spring-jms' ; type='jar' } | ||
} | ||
compile('org.apache.tomcat:servlet-api:6.0.26') { | ||
artifact { name='servlet-api' ; type='jar' } | ||
} | ||
compile('xom:xom:1.2.5') { | ||
artifact { name='xom' ; type='jar' } | ||
} | ||
} | ||
uploadArchives { | ||
uploadDescriptor = false | ||
repositories { | ||
add project.repositories.fileRepo | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
labs/record-and-playback/message-producer/src/main/java/org/bbb/Event.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* 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/>. | ||
* | ||
*/ | ||
|
||
package org.bbb; | ||
|
||
import java.io.Serializable; | ||
/** | ||
* | ||
* @author Marco Calderon <[email protected]> | ||
*/ | ||
public class Event implements IEvent,Serializable { | ||
|
||
private String conferenceID; | ||
private String uuid; | ||
private String message; | ||
|
||
public Event() { | ||
super(); | ||
} | ||
|
||
public String getConferenceID() { | ||
return this.conferenceID; | ||
} | ||
|
||
public String getMessage() { | ||
return this.message; | ||
} | ||
|
||
/** | ||
* @param conferenceID the conferenceID to set | ||
*/ | ||
public void setConferenceID(String conferenceID) { | ||
this.conferenceID = conferenceID; | ||
} | ||
|
||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
|
||
public String getUUID() { | ||
return this.uuid; | ||
} | ||
|
||
public void setUUID(String uuid) { | ||
this.uuid=uuid; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
labs/record-and-playback/message-producer/src/main/java/org/bbb/IEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* 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/>. | ||
* | ||
*/ | ||
|
||
package org.bbb; | ||
|
||
/** | ||
* | ||
* @author Marco Calderon <[email protected]> | ||
*/ | ||
public interface IEvent extends java.io.Serializable { | ||
public String getConferenceID(); //conferenceid | ||
public void setConferenceID(String conferenceid); //conferenceid | ||
public String getUUID(); // UUID for each message | ||
public void setUUID(String uuid); // UUID for each message | ||
public String getMessage(); //JSON message | ||
public void setMessage(String message); //JSON message | ||
} |
32 changes: 32 additions & 0 deletions
32
...d-and-playback/message-producer/src/main/java/org/bbb/sender/IMessageGeneratorSender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* 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/>. | ||
* | ||
*/ | ||
|
||
package org.bbb.sender; | ||
|
||
import org.bbb.IEvent; | ||
|
||
|
||
/** | ||
* | ||
* @author Marco Calderon <[email protected]> | ||
*/ | ||
public interface IMessageGeneratorSender { | ||
public void sendEvents(IEvent event); | ||
} |
61 changes: 61 additions & 0 deletions
61
...rd-and-playback/message-producer/src/main/java/org/bbb/sender/MessageGeneratorSender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* 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/>. | ||
* | ||
*/ | ||
|
||
package org.bbb.sender; | ||
|
||
import javax.jms.JMSException; | ||
import javax.jms.Message; | ||
import javax.jms.Session; | ||
import org.bbb.IEvent; | ||
import org.springframework.jms.core.JmsTemplate; | ||
import org.springframework.jms.core.MessageCreator; | ||
|
||
/** | ||
* | ||
* @author Marco Calderon <[email protected]> | ||
*/ | ||
public class MessageGeneratorSender implements IMessageGeneratorSender { | ||
private JmsTemplate jmsTemplate; | ||
|
||
public void sendEvents(final IEvent event) { | ||
jmsTemplate.send(new MessageCreator() { | ||
|
||
public Message createMessage(Session sn) throws JMSException { | ||
Message msg=sn.createObjectMessage(event); | ||
return msg; | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* @return the jmsTemplate | ||
*/ | ||
public JmsTemplate getJmsTemplate() { | ||
return jmsTemplate; | ||
} | ||
|
||
/** | ||
* @param jmsTemplate the jmsTemplate to set | ||
*/ | ||
public void setJmsTemplate(JmsTemplate jmsTemplate) { | ||
this.jmsTemplate = jmsTemplate; | ||
} | ||
|
||
} |
Oops, something went wrong.