/** * This method maps the VM's open sessions with users. Engine currently does not regard sessions as business * entities, and therefore a session doesn't have an ID. Generating IDs for sessions is outside the scope of this * method and should be done by the method's invoker. * * The session involves a user. Sometimes this is an ovirt-user, and sometimes not. Engine provides only the user * name, and this method maps it by placing it inside a 'User' object in the session. If invokers want to identify * the ovirt user and provide a link to it, it's their responsibility to do so; this is out of the scope of this * method. */ public static Sessions map(org.ovirt.engine.core.common.businessentities.VM vm, Sessions sessions) { if (sessions == null) { sessions = new Sessions(); } mapConsoleSession(vm, sessions); mapGuestSessions(vm, sessions); return sessions; }