org.objectweb.jonas.security.realm.web.jetty50
Class JettyPrincipal

java.lang.Object
  extended by org.objectweb.jonas.security.realm.web.jetty50.JettyPrincipal
All Implemented Interfaces:
java.security.Principal

public class JettyPrincipal
extends java.lang.Object
implements java.security.Principal

Define a principal which can be used by Jetty

Author:
Florent Benoit

Constructor Summary
JettyPrincipal(java.lang.String name, java.util.ArrayList roles)
          Constructor
 
Method Summary
 java.lang.String getName()
          Get the name of this principal
 java.util.ArrayList getRoles()
          Gets the roles of this user
 boolean isAuthenticated()
          This user is authenticated ?
 boolean isUserInRole(java.lang.String role)
          Check if the given role is in the user's roles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 

Constructor Detail

JettyPrincipal

public JettyPrincipal(java.lang.String name,
                      java.util.ArrayList roles)
Constructor

Parameters:
name - name of this principal
roles - roles for this principal
Method Detail

getName

public java.lang.String getName()
Get the name of this principal

Specified by:
getName in interface java.security.Principal
Returns:
the name of this principal

isAuthenticated

public boolean isAuthenticated()
This user is authenticated ?

Returns:
true if it is authenticated

isUserInRole

public boolean isUserInRole(java.lang.String role)
Check if the given role is in the user's roles

Parameters:
role - the given role
Returns:
true if the role is in the user's roles

getRoles

public java.util.ArrayList getRoles()
Gets the roles of this user

Returns:
roles of this user