return xConnections.toArray(new XConnection[0]);
// TODO throw exception or return empty array !?!?!?
}
public XGroup[] getGroups(String sessionId, XUser xUser) throws SessionExpiredException {
AdministrationService adminService = ServiceProvider
.getAdministrationService(getLoggedInUser(sessionId));
List<XGroup> xGroups = new ArrayList<XGroup>();
User forUser = getNativeUser(sessionId, xUser);
if (forUser != null) {
for (Group group : adminService.getGroups(forUser)) {
XGroup xGroup = (XGroup) XConverter.createX(group);
xGroup.clearRoleNames();
for (Role r: group.getRoles()) {
xGroup.addRoleName(r.getName());
}