net.drijf.javaone
Class RoleMappingImpl

java.lang.Object
  |
  +--net.drijf.javaone.RoleMappingImpl
All Implemented Interfaces:
RoleMapping

public class RoleMappingImpl
extends java.lang.Object
implements RoleMapping

This class implements a basic role mapping, using a memory based table. In real life, one would do this mapping based on property files ar a database.

Author:
Otto Moerbeek

Constructor Summary
RoleMappingImpl(java.util.Map roledefs)
          Construct a new role mapping, based on a map.
 
Method Summary
 Role getRole(java.lang.String alias)
          Return the role associated with a name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleMappingImpl

public RoleMappingImpl(java.util.Map roledefs)
Construct a new role mapping, based on a map.
Parameters:
roledefs - a map containing name to role mappings.
Method Detail

getRole

public Role getRole(java.lang.String alias)
Return the role associated with a name.
Specified by:
getRole in interface RoleMapping
Parameters:
alias - the name the return a role for.
Returns:
the role associated with the name, or null if the name is unknown.