|
From: Leif M. <le...@ta...> - 2004-01-05 06:09:19
|
The next version of the Wrapper will include the ability to request information about the user currently running the Wrapper as well as the user, if any, that is currently logged in to a Windows box. This is implemented using the following two calls: WrapperUser WrapperManager.getUser( boolean groups ) WrapperUser WrapperManager.getInteractiveUser( boolean groups ) Both methods take a parameter that specifies whether or not the returned WrapperUser object should contain information about which groups the user belongs to. This is a fairly heavy operation on Windows so I wanted to give the user the option of not requesting the groups if it is not needed. The returned WrapperUser object is actually an instance of a WrapperWin32User or a WrapperUNIXUser. They each contain additional platform specific information. On Windows the getUser call will always return a user. But when the Wrapper is being run as a service, this will most likely be the SYSTEM user. Which is not very interesting. If the getInteractiveUser method is called before a user logs on to the machine it will return null. Otherwise it will return the user, if any, which currently has interactive status with the Wrapper as a service. If the service is not interactive then this will always return null. User code will need to poll these methods manually to detect when a user logs on. They are not super heavy, but heavy enough that I do not want the wrapper to be making the calls unless the user code actually needs the user information. First of all does anyone have any opinions or concerns about the Windows implementation? My next question is what do you think would be best to do on the UNIX side? The getUser call will return the user that is currently running the Wrapper. But what should the getInteractiveUser method return? Currently I am thinking of having it return null unless a DISPLAY environment variable is detected. Otherwise it would return null. Users often ask how to detect when a user has opened an XWindows session under Linux so they can display a GUI. This is actually not very simple under UNIX however. Thoughts? Cheers, Leif |