- cleanup

This commit is contained in:
Richard Alam 2012-10-24 18:09:12 +00:00
parent 959e6ba7da
commit 09926ef823
3 changed files with 20 additions and 31 deletions

View File

@ -24,8 +24,7 @@ package org.bigbluebutton.main.model.users
{ {
private var _status:ArrayCollection; private var _status:ArrayCollection;
public function StatusCollection() public function StatusCollection() {
{
_status = new ArrayCollection(); _status = new ArrayCollection();
} }
@ -33,15 +32,13 @@ package org.bigbluebutton.main.model.users
_status = s; _status = s;
} }
public function addStatus(status:Status):void public function addStatus(status:Status):void {
{
if (! hasStatus(status.name)) { if (! hasStatus(status.name)) {
_status.addItem(status); _status.addItem(status);
} }
} }
public function hasStatus(name:String):Boolean public function hasStatus(name:String):Boolean {
{
var index:int = getStatusIndex(name); var index:int = getStatusIndex(name);
if (index > -1) { if (index > -1) {
@ -57,8 +54,7 @@ package org.bigbluebutton.main.model.users
} }
} }
public function getStatus(name:String):Status public function getStatus(name:String):Status {
{
var index:int = getStatusIndex(name); var index:int = getStatusIndex(name);
if (index > -1) { if (index > -1) {
@ -68,8 +64,7 @@ package org.bigbluebutton.main.model.users
return null; return null;
} }
public function removeStatus(name:String):void public function removeStatus(name:String):void {
{
var index : int = getStatusIndex(name); var index : int = getStatusIndex(name);
if (index > -1) { if (index > -1) {
@ -77,10 +72,8 @@ package org.bigbluebutton.main.model.users
} }
} }
private function getStatusIndex(name:String):int private function getStatusIndex(name:String):int {
{ for (var i:int=0;i<_status.length;i++) {
for (var i:int=0;i<_status.length;i++)
{
var s:Status = _status.getItemAt(i) as Status; var s:Status = _status.getItemAt(i) as Status;
if (s.name == name) { if (s.name == name) {
@ -92,13 +85,11 @@ package org.bigbluebutton.main.model.users
return -1; return -1;
} }
public function removeAll():void public function removeAll():void {
{
_status.removeAll(); _status.removeAll();
} }
public function getAll():ArrayCollection public function getAll():ArrayCollection {
{
return _status; return _status;
} }
} }

View File

@ -49,8 +49,7 @@ package org.bigbluebutton.main.model.users {
private static const SO_NAME : String = "participantsSO"; private static const SO_NAME : String = "participantsSO";
private static const STATUS:String = "_STATUS"; private static const STATUS:String = "_STATUS";
// private var netConnectionDelegate: NetConnectionDelegate; private var _connectionManager:ConnectionManager;
private var _connectionManager:ConnectionManager;
private var _room:String; private var _room:String;
private var _applicationURI:String; private var _applicationURI:String;
@ -59,19 +58,21 @@ package org.bigbluebutton.main.model.users {
public function UsersSOService(uri:String) { public function UsersSOService(uri:String) {
_applicationURI = uri; _applicationURI = uri;
_connectionManager = BBB.initConnectionManager(); _connectionManager = BBB.initConnectionManager();
_connectionManager.setUri(uri); _connectionManager.setUri(uri);
dispatcher = new Dispatcher(); dispatcher = new Dispatcher();
} }
public function connect(params:ConferenceParameters):void { public function connect(params:ConferenceParameters):void {
_room = params.room; _room = params.room;
_connectionManager.connect(params); _connectionManager.connect(params);
} }
public function disconnect(onUserAction:Boolean):void { public function disconnect(onUserAction:Boolean):void {
if (_participantsSO != null) _participantsSO.close(); if (_participantsSO != null) {
_connectionManager.disconnect(onUserAction); _participantsSO.close();
}
_connectionManager.disconnect(onUserAction);
} }
public function join(userid:String, room:String):void { public function join(userid:String, room:String):void {
@ -338,14 +339,12 @@ package org.bigbluebutton.main.model.users {
} }
} }
private function asyncErrorHandler(event:AsyncErrorEvent):void private function asyncErrorHandler(event:AsyncErrorEvent):void {
{
LogUtil.debug(LOGNAME + "participantsSO asyncErrorHandler " + event.error); LogUtil.debug(LOGNAME + "participantsSO asyncErrorHandler " + event.error);
sendConnectionFailedEvent(ConnectionFailedEvent.ASYNC_ERROR); sendConnectionFailedEvent(ConnectionFailedEvent.ASYNC_ERROR);
} }
public function get connection():NetConnection public function get connection():NetConnection {
{
return _connectionManager.connection; return _connectionManager.connection;
} }

View File

@ -84,8 +84,7 @@ package org.bigbluebutton.modules.listeners.business.vo
listeners.removeAll(); listeners.removeAll();
} }
public function newUserStatus(id:Number, newStatus:String) : void public function newUserStatus(id:Number, newStatus:String):void {
{
var l:Listener = getListener(id); var l:Listener = getListener(id);
if (l != null) { if (l != null) {