use of org.jivesoftware.openfire.entity.RosterItemEntity in project Openfire by igniterealtime.
the class UserServicePluginNG method getRosterEntities.
/**
* Gets the roster entities.
*
* @param username
* the username
* @return the roster entities
* @throws ServiceException
* the service exception
*/
public RosterEntities getRosterEntities(String username) throws ServiceException {
Roster roster = getUserRoster(username);
List<RosterItemEntity> rosterEntities = new ArrayList<RosterItemEntity>();
for (RosterItem rosterItem : roster.getRosterItems()) {
RosterItemEntity rosterItemEntity = new RosterItemEntity(rosterItem.getJid().toBareJID(), rosterItem.getNickname(), rosterItem.getSubStatus().getValue());
rosterItemEntity.setGroups(rosterItem.getGroups());
rosterEntities.add(rosterItemEntity);
}
return new RosterEntities(rosterEntities);
}
Aggregations