org.apache.struts2.interceptor
Class PrincipalProxy

java.lang.Object
  extended by org.apache.struts2.interceptor.PrincipalProxy

public class PrincipalProxy
extends java.lang.Object

Proxy class used together with PrincipalAware interface. It allows to get indirect access to HttpServletRequest Principal related methods.


Constructor Summary
PrincipalProxy(javax.servlet.http.HttpServletRequest request)
          Constructs a proxy
 
Method Summary
 java.lang.String getRemoteUser()
          Gets the user id
 javax.servlet.http.HttpServletRequest getRequest()
          Gets the request
 java.security.Principal getUserPrincipal()
          Gets the user principal
 boolean isRequestSecure()
          Is the request using https?
 boolean isUserInRole(java.lang.String role)
          True if the user is in the given role
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrincipalProxy

public PrincipalProxy(javax.servlet.http.HttpServletRequest request)
Constructs a proxy

Parameters:
request - The underlying request
Method Detail

isUserInRole

public boolean isUserInRole(java.lang.String role)
True if the user is in the given role

Parameters:
role - The role
Returns:
True if the user is in that role

getUserPrincipal

public java.security.Principal getUserPrincipal()
Gets the user principal

Returns:
The principal

getRemoteUser

public java.lang.String getRemoteUser()
Gets the user id

Returns:
The user id

isRequestSecure

public boolean isRequestSecure()
Is the request using https?

Returns:
True if using https

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Gets the request

Returns:
The request


Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.