/* (non-Javadoc)
@see com.tvd12.ezyfox.core.command.RoomInfo#room(java.lang.String)
179462
@Override
    public RoomInfo room(String name) {
        this.room = CommandUtil.getSfsRoom(name, extension);
        return this;
    }
174237
@Override
    public <T extends ApiUser> List<T> in(ApiRoom room) {
        Room sfsRoom = CommandUtil.getSfsRoom(room, extension);
        validateRoom(sfsRoom, room);
        return CommandUtil.getApiUserList(sfsRoom.getUserList());
    }
833738
function( userID, roomID ) {

		var userCount;

		if( roomUsers[ roomID ] === undefined ) {

			return promise.reject( 'No room with the id: ' + roomID );
		} else {

			var userIDX = roomUsers[ roomID ].indexOf( userID );

			if( userIDX != -1 ) {

				roomUsers[ roomID ].splice( userIDX, 1 );

				userCount = roomUsers[ roomID ].length;

				if( userCount == 0 ) {

					delete roomUsers[ roomID ];
				}

				return promise.resolve( userCount );
			} else {

				return promise.reject( 'User ' + userID + ' is not in the room: ' + roomID );
			}
		}
	}
1296665
public MUCRoomEntity getChatRoom(String roomName) {
		return restClient.get("chatrooms/" + roomName, MUCRoomEntity.class, new HashMap<String, String>());
	}
1290308
@XmlElementDecl(namespace = "http://www.opengis.net/citygml/building/1.0", name = "Room", substitutionHeadNamespace = "http://www.opengis.net/citygml/1.0", substitutionHeadName = "_CityObject")
    public JAXBElement<RoomType> createRoom(RoomType value) {
        return new JAXBElement<RoomType>(_Room_QNAME, RoomType.class, null, value);
    }
971780
function( userId ) {

		return this.memory.createRoom( userId )
			   .then( function( id ) {

			   		rooms[ id ] = room( this.memory, id );
			   			
						return promise.resolve( rooms[ id ] );
			   }.bind( this ), function() {

			   		return promise.reject( 'could not get a roomID to create a room' );
			   });
	}
756764
def send_to_room(self, message, room_name):
        
        room = self.get_room(room_name)

        if room is not None:
            room.send_message(message)
651226
public void create(String roomName, String subject, HashMap<String, String> customConfigs, List<Jid> occupants)
            throws Exception {
        MUCLightCreateIQ createMUCLightIQ = new MUCLightCreateIQ(room, roomName, occupants);

        messageCollector = connection.createStanzaCollector(fromRoomGroupChatFilter);

        try {
            connection.createStanzaCollectorAndSend(createMUCLightIQ).nextResultOrThrow();
        } catch (NotConnectedException | InterruptedException | NoResponseException | XMPPErrorException e) {
            removeConnectionCallbacks();
            throw e;
        }
    }
1361256
public void setRoomConfigs(String roomName, HashMap<String, String> customConfigs)
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ(room, roomName, customConfigs);
        connection.createStanzaCollectorAndSend(mucLightSetConfigIQ).nextResultOrThrow();
    }
1112024
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiRoom> T getRoomByName(String name) {
	    Room sfsRoom = getZone().getRoomByName(name);
	    if(sfsRoom != null && sfsRoom.containsProperty(APIKey.ROOM))
	        return (T) sfsRoom.getProperty(APIKey.ROOM);
	    return null;
	}
1254210
@Override
    public void setGroupId(String groupId) {
        room.setGroupId(groupId);
        apiRoom.setGroupdId(groupId);
    }
593208
def rooms_info(self, room_id=None, room_name=None):
        """"""
        if room_id is not None:
            return self.__call_api_get('rooms.info', roomId=room_id)
        elif room_name is not None:
            return self.__call_api_get('rooms.info', roomName=room_name)
        else:
            raise RocketMissingParamException('roomId or roomName required')
212449
private Room getSfsRoom() {
        if(StringUtils.isEmpty(roomName))
            return extension.getParentZone().getRoomById(roomId);
        return CommandUtil.getSfsRoom(roomName, extension);
    }
785612
@Override
    public <T extends ApiGameUser> List<T> in(ApiRoom room, Class<?> clazz) {
        Room sfsRoom = CommandUtil.getSfsRoom(room, extension);
        validateRoom(sfsRoom, room);
        return CommandUtil.getApiGameUserList(sfsRoom.getUserList(), clazz);
    }
74830
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiRoom> List<T> getRoomList() {
	    List<Room> sfsRooms = getZone().getRoomList();
        List<T> answer = new ArrayList<>();
        for(Room sfsRoom : sfsRooms) {
            if(sfsRoom.containsProperty(APIKey.ROOM))
                answer.add((T) sfsRoom.getProperty(APIKey.ROOM));
        }
        return answer;
	}
1100941
protected boolean checkHandler(RoomHandlerClass handler, 
            ApiRoom roomAgent, Object user) {
        return (handler.getRoomClass().isAssignableFrom(roomAgent.getClass())) &&
               (roomAgent.getName().startsWith(handler.getRoomName()));
    }
1194989
function(room) {
        this.rooms[room.roomId] = room;
        // add listeners for room member changes so we can keep the room member
        // map up-to-date.
        room.currentState.on("RoomState.members", this._onRoomMember.bind(this));
        // add existing members
        const self = this;
        room.currentState.getMembers().forEach(function(m) {
            self._onRoomMember(null, room.currentState, m);
        });
    }