FileDocCategorySizeDatePackage
PortletPrincipalProxy.javaAPI DocExample1966Mon Jul 23 13:26:38 BST 2007org.apache.struts2.portlet.interceptor

PortletPrincipalProxy

public class PortletPrincipalProxy extends Object implements org.apache.struts2.interceptor.PrincipalProxy
PrincipalProxy implementation for using PortletRequest Principal related methods.

Fields Summary
private javax.portlet.PortletRequest
request
Constructors Summary
public PortletPrincipalProxy(javax.portlet.PortletRequest request)
Constructs a proxy

param
request The underlying request

        this.request = request;
    
Methods Summary
public java.lang.StringgetRemoteUser()
Gets the user id

return
The user id

        return request.getRemoteUser();
    
public javax.servlet.http.HttpServletRequestgetRequest()
Gets the request.

return
The request
throws
UnsupportedOperationException not supported in this implementation.
deprecated
To obtain the HttpServletRequest in your action, use {@link org.apache.struts2.servlet.ServletRequestAware}, since this method will be dropped in future.

        throw new UnsupportedOperationException("Usage of getRequest() method is deprecadet and not supported for this implementation");
    
public java.security.PrincipalgetUserPrincipal()
Gets the user principal

return
The principal

        return request.getUserPrincipal();
    
public booleanisRequestSecure()
Is the request using https?

return
True if using https

        return request.isSecure();
    
public booleanisUserInRole(java.lang.String role)
True if the user is in the given role

param
role The role
return
True if the user is in that role

        return request.isUserInRole(role);