@Service
public class UserIdService
extends java.lang.Object
This Spring-managed bean is responsible for extracting the userId from the
PortletRequest. The NewsReaderPortlet uses userId as a foreign key when it
stores data. Normally this process is simple -- all authenticated users use
PortletRequest.getRemoteUser as a userId. Unauthenticated
users, however, need a different strategy. Users who aren't authenticated
will have null for both getRemoteUser and the
USER_INFO map. We need to differentiate them (in the case of
multiple guest users) based on the role(s) they belong to.