public Map<String, Object> convertToRoomSpec(MUCRoom room) {
   Map<String, Object> roomSpec = new HashMap();
   roomSpec.put("naturalLanguageName", room.getNaturalLanguageName());
   roomSpec.put("name", room.getName());
   roomSpec.put("description", room.getDescription());
   roomSpec.put("canAnyoneDiscoverJID", room.canAnyoneDiscoverJID());
   roomSpec.put("canChangeNickname", room.canChangeNickname());
   roomSpec.put("canOccupantsChangeSubject", room.canOccupantsChangeSubject());
   roomSpec.put("canOccupantsInvite", room.canOccupantsInvite());
   roomSpec.put("publicRoom", room.isPublicRoom());
   roomSpec.put("password", room.getPassword());
   roomSpec.put("ID", room.getID());
   roomSpec.put("persistent", room.isPersistent());
   roomSpec.put("registrationEnabled", room.isRegistrationEnabled());
   roomSpec.put("logEnabled", room.isLogEnabled());
   roomSpec.put("loginRestrictedToNickname", room.isLoginRestrictedToNickname());
   roomSpec.put("maxUsers", room.getMaxUsers());
   roomSpec.put("membersOnly", room.isMembersOnly());
   roomSpec.put("moderated", room.isModerated());
   roomSpec.put("owners", convertJIDsToStringList(room.getOwners()));
   roomSpec.put("admins", convertJIDsToStringList(room.getAdmins()));
   roomSpec.put("members", convertJIDsToStringList(room.getMembers()));
   roomSpec.put("outcasts", convertJIDsToStringList(room.getOutcasts()));
   roomSpec.put("broadcastPresenceRoles", room.getRolesToBroadcastPresence());
   roomSpec.put("creationDate", room.getCreationDate());
   roomSpec.put("modificationDate", room.getModificationDate());
   return roomSpec;
 }
Example #2
0
 public Map<String, String> getMucRoomAttributes(String domain, String roomName)
     throws NotFoundException {
   MultiUserChatService mucService = this.multiUserChatManager.getMultiUserChatService(domain);
   MUCRoom mucRoom = mucService.getChatRoom(roomName);
   if (mucRoom == null) {
     throw new NotFoundException("Room not found " + domain + " roomName " + roomName);
   }
   Map<String, String> retval = new HashMap<String, String>();
   retval.put("isModerated", "" + mucRoom.isModerated());
   retval.put("isLogEnabled", "" + mucRoom.isLogEnabled());
   retval.put("isMembersOnly", "" + mucRoom.isMembersOnly());
   retval.put("isPublicRoom", "" + mucRoom.isPublicRoom());
   retval.put("isLoginRestrictedToNickName", "" + mucRoom.isLoginRestrictedToNickname());
   retval.put("isLocked", "" + mucRoom.isLocked());
   retval.put("isRegistrationEnabled", "" + mucRoom.isRegistrationEnabled());
   retval.put("isPasswordProtected", "" + mucRoom.isPasswordProtected());
   retval.put("canAnyoneDiscoverJID", "" + mucRoom.canAnyoneDiscoverJID());
   retval.put("canChangeNickName", "" + mucRoom.canChangeNickname());
   retval.put("canOccupantsInvite", "" + mucRoom.canOccupantsInvite());
   retval.put("canOccupantsChangeSubject", "" + mucRoom.canOccupantsChangeSubject());
   return retval;
 }