/** generated default serial number */
private static final long serialVersionUID = -6035121917190713696L;
public XAccount[] getAccounts(String sessionId, XUser xUser) throws SessionExpiredException {
AuthUser loggedInUser = getLoggedInUser(sessionId);
AdministrationService adminService = ServiceProvider
.getAdministrationService(loggedInUser);
List<XAccount> xAccounts = new ArrayList<XAccount>();
User forUser = getNativeUser(sessionId, xUser);
if (forUser != null) {
for (Account account : adminService.getAccounts(forUser)) {
XAccount xAccount = (XAccount) XConverter.createX(account);
xAccounts.add(xAccount);
}
}
return xAccounts.toArray(new XAccount[0]);