use of org.jivesoftware.openfire.entity.ParticipantEntities in project Openfire by igniterealtime.
the class MUCRoomController method getRoomParticipants.
/**
* Gets the room participants.
*
* @param roomName
* the room name
* @param serviceName
* the service name
* @return the room participants
*/
public ParticipantEntities getRoomParticipants(String roomName, String serviceName) {
ParticipantEntities participantEntities = new ParticipantEntities();
List<ParticipantEntity> participants = new ArrayList<ParticipantEntity>();
Collection<MUCRole> serverParticipants = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(serviceName).getChatRoom(roomName).getParticipants();
for (MUCRole role : serverParticipants) {
ParticipantEntity participantEntity = new ParticipantEntity();
participantEntity.setJid(role.getRoleAddress().toFullJID());
participantEntity.setRole(role.getRole().name());
participantEntity.setAffiliation(role.getAffiliation().name());
participants.add(participantEntity);
}
participantEntities.setParticipants(participants);
return participantEntities;
}
Aggregations