com.caucho.security
Interface SecurityContextProvider

All Known Implementing Classes:
AbstractHttpRequest, CompileRequest, HmuxRequest, HttpRequest, SocketPolicyRequest, StubServletRequest

public interface SecurityContextProvider

Defines the interface any security provider must implement.


Method Summary
 java.security.Principal getUserPrincipal()
          Returns the Principal for the context.
 boolean isTransportSecure()
          Returns true if the transport context is secure (SSL).
 boolean isUserInRole(java.lang.String permission)
          Returns true if the user principal plays the named role.
 void logout()
          Logs the principal out.
 java.lang.String runAs(java.lang.String roleName)
          Sets the current runAs role/principal.
 

Method Detail

getUserPrincipal

java.security.Principal getUserPrincipal()
                                         throws SecurityContextException
Returns the Principal for the context.

Returns:
the principal in the context or null.
Throws:
SecurityContextException

isUserInRole

boolean isUserInRole(java.lang.String permission)
Returns true if the user principal plays the named role.

Parameters:
permission - the permission to test against.

runAs

java.lang.String runAs(java.lang.String roleName)
Sets the current runAs role/principal. This should affect isUserInRole and getUserPrincipal.

Parameters:
roleName - the new role
Returns:
the old run-as role

isTransportSecure

boolean isTransportSecure()
                          throws SecurityContextException
Returns true if the transport context is secure (SSL).

Throws:
SecurityContextException

logout

void logout()
            throws SecurityContextException
Logs the principal out.

Throws:
SecurityContextException